Introduction to the Metric API

New Relic's Metric API lets you send metric data to New Relic from a variety of sources.

Why use New Relic's Metric API?

New Relic's Metric API makes it easy to send virtually any metric data to New Relic. The Metric API is an HTTP endpoint; to send data, you make a POST request to the endpoint with a JSON payload containing your metric data points.

Use our Metric API if you want to:

  • Report metric data to New Relic without a New Relic agent.
  • Integrate metric data from an open source or in-house developed tool, library, or framework.
  • Have full control over the metric data you are sending including the resolution and associated dimensions.
  • Leverage the power of NRQL for querying your metric data.
  • Set up alerts for your metric data.

To integrate metric data from an open source library, tool, or framework, check out our exporters for Prometheus, Dropwizard, or Micrometer. If you're using one of our supported programming languages, you can also use the Telemetry SDK. The Telemetry SDK client libraries are built on top of the Metric API, and they encode best practices for sending metric data efficiently and reliably.

Get started

To start sending data, see Report metrics via the Metric API. It only takes a few steps to send your first metric data points to New Relic.

Access and requirements

This service is generally available. All you need to get started is a New Relic Insert API key. For additional information on limits and restricted attributes, see Metric API requirements and limits. For pricing information or to purchase New Relic Metrics, contact your New Relic account representative.

Data retention

All raw metric data points will be retained for 30 days. All additional aggregated data derived from the raw metric data points (for example, one-minute rollups) will be retained for 13 months. Any change to the retention period beyond such periods may result in a charge to you.

View and query your metrics

After you start sending us your metric data, you can use NRQL to view and query your metrics. For metric functions, examples, and sample queries, see Query metric data.

Alert on metric data

To alert on metrics created with the Metric API, use NRQL alert conditions: Select the NRQL category when defining your condition, then use the FROM Metric ... NRQL query syntax to express it. When you create these alert conditions, Alerts automatically uses the finest granularity data available (the raw metric data points) to evaluate alerts.

Troubleshooting

If receive an NrIntegrationError, see Troubleshoot a NrIntegrationError event.

For more help

Recommendations for learning more: