New Relic's Metric API can be used to send metric data to New Relic from a variety of sources. This API is how metrics from some of our integrations and exporters get into New Relic.
Want to try out our Metric API? Create a New Relic account for free! No credit card required.
What is the Metric API?
The Metric API is a way to get metric data into New Relic. The API works by sending a POST request to our HTTP endpoint with a JSON payload containing the metric data.
The Metric API is how metrics are ingested from some of our integrations, including our open source exporters (like DropWizard and Prometheus). The Metric API is also used by our Telemetry SDKs, which are language-specific tools that make it easier to use our data-ingest APIs.
The Metric API can be used 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.
- Fully control the metric data you're sending, including the resolution and associated dimensions.
- Leverage the power of NRQL, New Relic's query language, for querying your metric data.
- Set up alerts for your metric data.
Ensure outbound connectivity on TCP port 443 is allowed to the CIDR range that matches your region.
The preferred configuration method is to use the DNS name
You'll need a New Relic for the New Relic account you want to send data to. For information on limits and restricted attributes, see Metric API requirements and limits.
If we don't have an existing integration or quickstart that meets your metric-reporting needs, you have two options:
- Use our Telemetry SDKs, which are language-specific tools that help you send us metrics and other data.
- Use the Metric API directly.
Find and use your data
You can find data sent via the Metric API (including from integrations that use this API) in these locations:
From one.newrelic.com, select Explorer and look for your service.
By querying the
Metricdata type. For example, you can use NRQL to run:SELECT * FROM Metric
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, automatically uses the finest granularity data available (the raw metric data points) to evaluate alerts.
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.