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.
To use APIs and the rest of our observability platform, join the New Relic family! Sign up to create your free account in only a few seconds. Then ingest up to 100GB of data for free each month. Forever.
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, OpenCensus, 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
If we don't have an existing integration 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.
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
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.
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.
If you receive an
NrIntegrationError, see Troubleshoot a
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.