Is it possible to record custom metrics to an app with another secondary agent? - newrelic-platform

We are running Elasticsearch with the NewRelic Java agent installed. We want to record custom metrics without changing anything in ES.
I know the NewRelic proposed way to do this is Steven Eksteens Elasticsearch Plugin but it's Ruby based and we try to avoid adding another language to our stack. I tried to replicate Stevens efforts in Python, using the NewRelic Python agent and the newrelic.agent.record_custom_metric function:
import newrelic.agent
from time import sleep
import logging
logger = logging.getLogger()
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
# generate config file with 'newrelic-admin generate-config <apicode> newrelic.ini'
newrelic.agent.initialize('newrelic.ini')
application_str = dict(newrelic.agent.newrelic.core.config.global_settings())["app_name"]
application = newrelic.agent.register_application(application_str)
while True:
newrelic.agent.record_custom_metric('Custom/Value', 1, application)
sleep(10)
This works fine. Only problem: If configured to use the same app_name as the existing java-agent controlled App it registers a new app in NewRelic with the appendix '(Python)'. What I want is to add the metrics to the original one. Is this possible?

Applications in the New Relic Dashboard have to be the same language to be consolidated. Otherwise you will end up with multiple applications with the same name and an appended language name due to the type of metrics and manner of reporting in different languages.
There is no way to consolidate two applications of the same name written in different languages in your New Relic account. You could however create a custom dashboard which will allow you to place charts from multiple applications in one dashboard.

Related

Create h2 database with Spring Boot if it not exists, then don't delete. Desktop application

I am writing a desktop applicaiton, which requires language dictationary.
I want my application to create h2 database only when user first time run my application, and then load translations into db from .xdxf dictationary.
After a quick looking through a few articles I got that the common use case is to create a new schema every time when application starts and destroy it on exit. Did I get it correctly?
Is there a way to keep created schema after application was stopped?
P.S. any link for suitable tutorial will be enougth for me. Thanks.
You are referring to what Spring Boot does by default. You can configure it in many ways, reading the documentation should help.
H2 can also be configured in many ways, including file-based persistence (i.e. surviving a restart of the application).
With your current setup that works with H2 in memory, you could give this configuration a try and look at the doc for the remaining pieces:
spring.datasource.url = jdbc:h2:file:~/testdb
We will figure out the driver based on the URL. Note that since you took control over this setup, Hibernate won't be configured to create the schema automatically on startup (if you were relying on that). Check this question for more details.

Is PAA a good candidate for automating wcm library deployment and setup in portal?

I have created a Web Content Management library for use in WebSphere Portal. At the moment I'm using import-wcm-data to import the library, then I need to add some additional propeties to 2-3 files on the server under Resource Environment Providers and then restart particular services so those changes are detected.
Can anyone explain the benefits of using a paa over writing a simple bash (or similar) script to automate this process?
I don't understand if I get any advantages when using paa, or is paa even capable of updating properties files and restarting services?
I have been working intensively with PAA files and I must say that it is a very stable way of deploying a app requirering multiple depl steps and components.
It does need a startup process but is well worth it in a multi server environment.
You can do all the tasks that you can do in a Ant file as well as using the wsadmin script interface. I only update res env settings and the such in WAS and do not touch any props files for that reason since all settings are stored in WAS.
In my experience, a PAA is not a good method if you're merely importing a content library.
I don't think I understand why you are doing the import manually and not syndicating, but even if there's a good reason not to syndicate, the PAA process was too involved and required too many precursor actions (deleting libraries, remove PAA, deploy PAA and then activate the portliest) to be a viable option for something as simple as importing a WCM library.
Since activating the portlets I was importing with the PAA was an extra step, I don't believe you can restart applications either.

Creating a user-configurable New Relic Plugin

I've been playing around with the New Relic Ruby SDK and created a proof-of-concept plugin which gets data out of Graphite, and sends it to New Relic.
Other plugins I've seen target a well-known set of data (e.g. Apache Requests or CPU load). However, in this case I cannot pre-configure the dashboards for publishing, because the data for each user will be completely different, depending on how they configure it and the data they store on their graphite.
Is there a way to publish a plugin without a pre-configured dashboard / charts?
Every New Relic published plugin necessarily includes a Dashboard. You could record metrics like "Component/Graphite/" and then expose the results generically in your associated dashboard with "Component/Graphite/*". Most likely those won't be very useful graphs.
If you treat this as a Graphite plugin SDK for users who want to easily collect Graphite metrics by configuration, it will make more sense. When doing this, you should make the GUID configurable as well and include clear instructions on changing the GUID for each use of the SDK. That way, users will get their own fresh Dashboards each time their use your SDK.
Yoav, I strongly suggest you do not distribute your plugin agent with a GUID in place (you currently have com.gingerlime.graphite.graphite).
If another user runs your agent with their New Relic license key, and doesn't change the GUID, they will be unable to customize their plugin dashboards, and any customizing you do will not be seen by them.
In other words, un-published plugins should not be distributed publicly - anyone that uses a un-published plugin will have a bad experience (unless they first customize the GUID).

in-app A|B Testing for Mobile

Is there a good solution for A|B Testing in mobile apps like online? I know with iOS it's against the TOS to have different user experiences with identical actions, but what about Android? And what about firms like Apsalar which claim to offer A|B Testing in their analytics for apps? How would one implement that?
Artisan mobile makes an A/B testing solution for iOS and Android.
The basic idea is that you drop the SDK in your app and then put it out in the app store. You can use the service to create A/B tests and optimize your application without having to touch the code or go back through the app store for each test.
For mobile apps, A/B testing basically works by replacing static, hard-coded objects with dynamic objects that can be controlled from a remote server.
This methodology raises a potential performance issue: What if the end user's device is not connected to pull configuration data for an object being tested? We've built Splitforce (http://splitforce.com) to seamlessly setup and manage A/B testing in mobile apps while controlling for performance risk.
Los details
Once the SDK and experiment has been integrated, non-technical product or marketing folks can setup new tests or tweak existing tests on-the-fly - without having to resubmit to the app stores or hassle engineers.
On first app launch, the mobile app requests configuration data from the server and then caches that data locally on the device. This is to both ensure a consistent user experience on subsequent app launches, and prevent corrupt test results by guaranteeing accurate attribution of conversion events to variations.
If the end user's connection fails or is timed-out on first app launch, the library displays a hard-coded 'default' variation. And to make sure that everything is looking good before you go live, we've built a 'shake to preview' functionality in debug mode that does just that :-)
Once the app is deployed with Splitforce event data are stored locally and sent back to the website to be displayed for each variation alongside measurements of observed improvement and statistical confidence.
Instructions on integration of the SDKs and new tests can be found at https://splitforce.com/documentation.
And how is it used?
We've seen Splitforce used to A/B test:
UI elements + layouts (color, text, images, ad/menu placements)
UX workflows
Game dynamics + rules
Prices + promotions
We've also seen the tool used to control mobile apps remotely, by essentially setting one variation of a test subject to 100%.
Yes there is: E.g. the company Leanplum offers a Visual Interface Editor for iOS and Android: This requires no coding, and Leanplum will automatically detect the elements and allow you to change them. No engineers or app store resubmissions required.
Apple must have updated their TOS (https://developer.apple.com/app-store/review/guidelines/#user-interface) - At least I am not aware of anything that prohibits altering the UI in a way that the Leanplum Visual Editor is doing it.
Generally that is achieved by method swizzling (iOS) and reflection (Android).
To learn more about the Leanplum Visual Interface Editor, check out leanplum.com. They offer a free 30-day trial.
(Disclaimer: I am an Engineer at Leanplum.)
I wrote a small open source project called Switchboard.
It let's you A/B test, remote configure and stage rollout things in your native mobile app. It contains a server component that specifies what information the application should have and 2 native clients for android and iOS.
You can find the codebase at github.com/keepsafe/switchboard and a blog post about how you can use it HERE
The new kid around the block is Arise.io. They provide an A/B testing service for iOS and Android.
I wrote MSActiveConfig, an extremely flexible framework to do remote configuration + A/B testing on iOS, with a portable format to be able to implement clients on other platforms: https://github.com/mindsnacks/MSActiveConfig.
This framework is being used in applications with more than 5 million users.
There have been a spate of new entrants in this field...you could check out Swerve, Appiterate, leanplum...all of them seem to be having SDKs for iOS as well, not really sure whether and how Apple TOS allows for that, but since there are some many of them doing it, there must be a way.
Yes, new entrants are showing up in app A/B testing practically every week! But, I think Appiterate has gone two steps ahead of other competitors by creating a visual interface, without any need to re-write code. I have seen their platform (you can ask for an invite. I got a demo within 12 hours) and believe me, it is actual WYSIWYG that they are providing.

How does one deploy after building on force.com

I've been directed to force.com as an alternative to creating an application using PHP and MySQL. My question is about deployment. What happens after I build the application on force.com. If the application is based on their API, will I be able to serve this application from my own domain if I wanted?
Simple answer is "no".
Your application is hosted on their servers, built in their own language (based on Java and Oracle DB but you'll never see them directly). You will create your application mostly with clicking through the setup (even for adding fields to tables there's GUI, no way to say ALTER TABLE ADD COLUMN), in some rare cases when you'll need complex logic you might resort to programming in Apex and Visualforce - but these languages won't work outside Salesforce.com platform.
Having said that - of course you can use your own domain name (to literally "serve this application from my own domain") and there are many integration possibilities so Salesforce app could interact with other application written in PHP for example... But there is no straightforward way to create your own "salesforce server" like you'd install an Apache or MySQL server.
You rely on their service for both hardware and software which will act as web server, execute your custom code etc.
Last thing - if you hope to build something reusable that might be helpful to other companies and you'd like to sell it in some sane way (not having to repeat all the clicking in each client's environment etc), have a look at appexchange. It's a place where you can find many pre-built Force.com apps (think about them like plugins to Wordpress, Joomla, osCommerce...).

Resources