Creating a user-configurable New Relic Plugin - newrelic-platform

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).

Related

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

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.

Publish one product to multiple sites

Is there a way to have one product definition and have it publish to multiple sites? I am looking for this ability specifically in DNN or Umbraco, either with free or paid extensions. I did install both the platforms and played with the free extensions and looked for any extension offering such functionality but did not find one. Any links or pointers are highly appreciated!
I had looked up for this info in many places before reaching over to the expert pool here, hoping to get some hints;
In umbraco there is the built in /base extension (http://our.umbraco.org/wiki/reference/umbraco-base) which enables you to access product data that is maintained in Umbraco from other websites. Base is REST-ish so the implementation is well documented - you can access the data as XML or JSON (Returning Json instead of XML with Umbraco Base).
Also as the implementation is REST-ish the other websites that consume the content maintained in the core site could be written in anything that can consume a REST feed eg html & javascript.
It's not 100% clear to me what setup you're after, but if you're looking to set up a traditional Authoring/Delivery configuration - one of the few paid offerings Umbraco has is called Courier. It's a very reasonably priced (~$135USD,/99EUR) deployment manager that handles syncing content between two sites, i.e., Authoring and a Delivery server.
It's a very smart tool that manages content, configuration, and dependencies. It's neat and also supports a great open-source project!
If you're looking to setup something more like a centralized product database that is used by many sites - amelvin is on good pointer with BASE. They have a nice api where you may also set up your own webservice (beyond their own webservice functaionality!).
If you need this centralized product data to notify the other sites to update their caches - i encourage you to look into the 'distributedCall' functionality.
There's a bit of documentation on distributed calls in this load-balancing tutorial that may help understand the concept a bit better.
...Hope this helps get pointed in the right direction.

Pre populate client database with PhoneGap (primary target Android)

There have been a few articles and questions about how to do this but they all seem to have a bias to iOS.
So first of all I am currently using PhoneGaps database functionality:
http://docs.phonegap.com/en/1.0.0/phonegap_storage_storage.md.html
I have a database I need for the app to run from as it contains a lot of information, probably about 1mb worth (can be exposed as .db/.sql). So I want to be able to make my PhoneGap app and build it for as many platforms as possible. However I want it so that as soon as the user has installed the app it automatically installs the database for them.
Some of the solutions seem to recommend creating the database on first boot, but this just seems a bit hack-ish and sidestepping the problem.
I am more than happy to switch over to use webSQL if Android, iOS and other providers support it, however as PhoneGap wraps any available native OS DB functionality it seemed more realistic that you can get an app to pre-populate an Android database and access it via PhoneGap than pre-populate a web database and access it via webSql.
Hopefully this question makes sense and there have been advances since mid last year, which seems to be the last up to date post on this sort of thing.
I just answered another similar question on this topic. First PhoneGap doesn't implement the Storage function that is documented. In fact we take advantage of the sqlite and localStorage functionality that is implemented in all webkit based browsers.
My recommendation is for you to pre-populate a SQLite DB and on application startup copy the DB to the correct location so your app can access it. There is a good blog post on this topic at:
http://gauravstomar.blogspot.com/2011/08/prepopulate-sqlite-in-phonegap.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+GauravSTomarBootstrappingIntelligence+%28Gaurav+S+Tomar+%3A+Bootstrapping+Intelligence%29

Cross-platform mobile API -- Looking for recommendations

So, yes, this is probably 1000th question on the subject. However, my question is somewhat different from others that were asked about this, so please bear with me:
I am looking to develop a single mobile-app that targets the three/four popular and/or growing mobile platforms (Iphone, Android, WinPhone7, RIM). This application is an extension of an existing SaaS system that my startup currently offers. This mobile-app would provide a quick-and-simple way to view up-to-date status & chart & report information for the data that SaaS application collects. Connection to the internet is required 100%. No data entry besides username/password. App is very simple with 5-6 "pages".
In phase 1, all that would need to be supported is for user to log in, get to see current status of his data stored in the cloud, get access to a few live reports
In phase 2, I'd like to be able to offer push-notification of certain key events from my servers in the cloud
My goals are:
1) The back-end processing that generates data for reports is already written in ASP.NET MVC2. I want to re-use it. It can be exposed as either a WCF service or published on a mobile-friendly website
2) I'd like to be able to deploy the patches faster than through the official app-stores/marketplaces.
3) I cannot afford to spend a lot of resources to target three-four proprietary platforms, for an app that is auxiliary to the vertical purpose of the business. I want to develop it once for all 3-4 platforms.
4) I do not have access, nor do I want to purchase a Macbook
5) I do want to deploy thru the vendor-specific application marketplaces
6) I'd like to stay way from proprietary languages/frameworks/lock-ins
Sounds like what I need is a shell around a mobile-friendly site that can be packaged as an app. Are there existing products that can make it REAL EASY for me to do so? Will doing so, preclude me from doing push notifications in phase 2?
Can anyone recommend a "shell" product that would make a wrapper around the website as well as Javascript library that would look the best across all 4 platforms. I've seen the names like Jqtouch, Jquery Mobile, etc... but not sure which ones are better for what I need.
Do I need PhoneGap? I am not 100% sure here. Can PhoneGap use online-only html/javascript pages to translate into native code or must html/javascript files be distributed with the application? I'd rather have the website itself drive the UI completely, as I can keep changing the website without various version approval processes from vendor market-stores.
Thank you for help
I don’t think you need Phonegap after reading about your project goals. You might consider a Web App instead of a native one if you 1) dont want to buy a mac (required for iOS even tho you can compile it in the cloud: https://build.phonegap.com/), and 2) want to apply and deploy updates anytime without going thru those platform independent marketplaces and approval processes.
jQuery Mobile would be an excellent choice, currently (at this very moment) in Alpha 3 but a very stable one and you can deploy your system on any of those platforms. Note that if you focus your efforts in a Web App you can’t target the second phase you mentioned: Push Notifications.
If you decide going Native, then Push Notifications services can be deployed into your Phonegap project once you setup the proper web services and certificates (take a look # http://easyapns.com);
..and one quick note, the idea of phonegap is that all resources (html, js, images. etc) have to be distributed locally within the app and then getting online data (like reports, etc) using JSON from another web service, and that’s another easy task to accomplish. Phonegap DOES NOT compile your HTML files into native code (ObjectiveC or Java), it just load your Web App into a UIWebKit component at run time (in the case of an iOS app)
Another alternative could be using Titanium - http://www.appcelerator.com but this approach is more javascript oriented and your final app looks much more native. (not HTMLs here so I think thats a drawback for you)
Hope it helps :)

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