Planning plugin metrics

If you are running one of New Relic APM's agents to receive information about your applications, you can also recieve arbitrary custom metrics. With access to New Relic APM's custom dashboards, you can visualize custom metrics in a variety of useful ways.

Custom metrics and custom dashboards make it easy to collect information from your web application and display it in New Relic APM. You can already collect metrics from outside sources and visualize them in custom dashboards, but doing so without affecting your application's metrics has not necessarily been easy. Custom dashboards are also not designed to share your work with other people who want to monitor the same outside resource.

The ability to develop plugins and present custom dashboards through the New Relic Plugins product has made this easier, as explained in this section.

Collecting plugin metrics

The New Relic Plugins product allows you to write plugins agents that can be run anywhere to collect metrics from any available system and report them to New Relic Plugins for customized dashboard visualization. Plugins also allow for summary metrics and one or more dashboards to visualize metrics that can be shared with every user of the plugin. This allows you to create a consistent user interface for the metrics you collect.

The data that plugins can report to New Relic Plugins is in the form of a key/value pair. Values are numerical: either integers or floating point non-negative numbers. Negative numbers can be included in your summary metrics and tables; however, visualization in charts is limited to numbers greater than or equal to zero. Keys are strings which include the concept of name spaces and units. While values cannot be strings, parts of your metric name (the key) can be displayed in plugin dashboards.

Your plugin agent can run anywhere with internet access to New Relic Plugins. You can write an agent using the agent SDKs for New Relic Plugins. You can also write your agent to connect to New Relic Plugins via HTTP POST using the API for New Relic Plugins in any language with HTTP support.

Using the Plugin API might be the most appropriate solution when one agent is reporting metrics for more than one New Relic account. This is common for service providers to report specialized metrics for each of their customers using New Relic Plugins. This can be done with a small number of agents monitoring a large number of users.

Presenting plugin metrics

If you are already familiar with New Relic APM's Custom Dashboards feature, you will notice that plugin dashboards appear very similar. However, they are not exactly the same.

When creating a plugin agent, good metric name planning is critical to your success. Poorly chosen metrics names can make it difficult or impossible to display the information you intend. Plan ahead for how you want to visualize your information and to record metrics in a way that will facilitate this. You may even want to record the same metrics with more than one name in order to visualize different aspects of your data.

Note: Plugin dashboards do not have the ability to do mathematical calculations, so make sure your plugin agent handles any necessary calculations (sum, average, total, count, etc.) before recording metrics.

Once you have collected metrics with your plugin agent, you will need to create dashboards to visualize the information in your metrics. All plugins will have a default dashboard. You can add as many dashboards as necessary to visualize your metric data (maximum 15).

In addition to dashboards, you can choose up to five metrics to represent the summary of each instance. Summary metrics convey the health status of each instance and are used to trigger Caution events and Critical alerts for your plugins. The summary metrics appear on your plugin's summary page.

For more help

Recommendations for learning more: