Platform Data Now Available Through New Relic Performance Data API

nr_platform_70-5aa067171260459d321e95c0fd91396aWe are pleased to announce that New Relic Platform data is now available from our API. All data that powers our Platform plugin dashboards will be available through the API.

You can now do everything with your Platform data that you were able to do with other New Relic Data using the Performance Data API. Want to build your own charts based on the metric data? Include the data in your own dashboard? Send your own alerts based on the data? Now you can do all that and more.

Users can access the list of installed plugins by performing the following curl command:


curl -X GET 'https://api.newrelic.com/v2/plugins.json' \
-H 'X-Api-Key:' -i 

The result includes the plugin guid, publisher and summary metrics as well as extra plugin metadata that you may find useful. For example:


{ {
     "id": 1,
     "name": "MySQL",
     "guid": "com.newrelic.plugins.mysql.instance",
     "publisher": "New Relic Inc.",
     "summary_metrics": [
       {
         "id": 1,
         "name": "Connections",
         "metric": "Component/newrelic/connections_connected[Connections]",
         "value_function": "average_value",
         "thresholds": {
           "caution": null,
           "critical": null
         }
       },
       {
         "id": 2,
         "name": "Repl Lag",
         "metric": "Component/newrelic/replication_lag[Seconds]",
         "value_function": "average_value",
         "thresholds": {
           "caution": 5,
           "critical": 10
         }
       }
     ]
   }
}

This list can be filtered by plugin guide and/or a list of plugin ids. For example:


curl -X GET 'https://api.newrelic.com/v2/plugins.json' \
    -H 'X-Api-Key:' -i \
    -d 'filter[guid]=mysql&filter[ids]=123,234'

Additionally users can get a list of all reporting components (plugin agents) by performing the following curl command:


curl -X GET 'https://api.newrelic.com/v2/components.json' \
    -H 'X-Api-Key:' -i

This result includes the component name and summary metrics, including any component-specific summary metric values and thresholds.


{
 "components": [
   {
     "id": 1,
     "name": "Production Server",
     "summary_metrics": [
       {
         "id": 1,
         "name": "Connections",
         "metric": "Component/newrelic/connections_connected[Connections]",
         "value_function": "average_value",
         "thresholds": {
           "caution": null,
           "critical": null
         },
         "values": {
           "raw": 42.63625,
           "formatted": "42.6 Connections"
         }
       },
       {
         "id": 2,
         "name": "Repl Lag",
         "metric": "Component/newrelic/replication_lag[Seconds]",
         "value_function": "average_value",
         "thresholds": {
           "caution": 5,
           "critical": 10
         },
         "values": {
           "raw": 1.75,
           "formatted": "1.75 sec"
         }
       }
     ]
   },

The list of components can be filtered by component name, a list of component IDs, and/or the ID of the plugin that the component belongs to. For example:


curl -X GET 'https://api.newrelic.com/v2/components.json' \
    -H 'X-Api-Key:' -i \
    -d 'filter[name]=bytes&filter[ids]=1234,2345&filter[plugin_id]=123'

Additionally, users have access to all the metric names and data reported by the components. This is the same data we use to generate the charts and tables you see on the plugin dashboards. In order to see the list of metrics reported by a component, you could perform the following curl command:


curl -X GET 'https://staging-api.newrelic.com/v2/components/1/metrics.json' \
    -H 'X-Api-Key:' -i

The result would look like this:


{
 "metrics": [
   {
     "name": "Agent/MetricsReported/count",
     "values": [
       "average_response_time",
       "calls_per_minute",
       "call_count",
       "min_response_time",
       "max_response_time",
       "average_exclusive_time",
       "average_value",
       "requests_per_minute",
       "standard_deviation"
     ]
   },
   {
     "name": "Component/innodb_mutex/btr_search_latch_parti",
     "values": [
       "average_value",
       "min_value",
       "max_value",
       "sample_count",
       "total_value"
     ]
   }
}

You can get the reported data for these metrics by performing the following curl operation:


{
 "metric_data": {
   "from": "2014-05-15T21:58:29+00:00",
   "to": "2014-05-15T22:28:29+00:00",
   "metrics": [
     {
       "name": "Agent/MetricsReported/count",
       "timeslices": [
         {
           "from": "2014-05-15T21:57:00+00:00",
           "to": "2014-05-15T21:58:00+00:00",
           "values": {
             "average_response_time": 266,
             "calls_per_minute": 1,
             "call_count": 1,
             "min_response_time": 266,
             "max_response_time": 266,
             "average_exclusive_time": 266,
             "average_value": 0.266,
             "requests_per_minute": 1,
             "standard_deviation": 0
           }
         }
     }
   ]
}

For more information take a look at the Plugin and Component sections of the API Explorer.

tmacie@newrelic.com'

Tom Macie is a senior software engineer in New Relic’s Seattle office. He holds a Bachelors degree in Computer Science and a Masters in Software Engineering from Penn State. He worked for large companies like Lockheed Martin and Microsoft before joining New Relic. View posts by .

Interested in writing for New Relic Blog? Send us a pitch!