To query and visualize the metrics collected for your Prometheus OpenMetrics or remote write integration with New Relic, you can use NRQL. You can also translate your PromQL-style queries to NRQL using either Grafana or the query builder.
All metrics for Docker and Kubernetes are stored in the Metric
type.
Default attributes for the OpenMetrics integration
By default, the following attributes will be added to all metrics for Docker and Kubernetes integrations:
Default attributes | Description |
---|---|
| The name of the cluster provided in the scraper configuration. |
| The name of this integration ( |
| The version of the integration; for example, |
| The name of the metric itself. |
| The type of the New Relic |
| The metric type of the Prometheus metric |
| The URL of the endpoint is being scraped. |
Kubernetes: If the scraper is running in Kubernetes, New Relic also adds the following attributes to all the metrics:
Additional Kubernetes attributes | Description |
---|---|
| Name of the deployment, if scraping a pod. |
| The Kubernetes labels of the object being scraped, prefixed by |
| Name of the namespace. |
| Name of the node where the pod being scraped is running, if applicable. |
| Name of the pod being scraped, if applicable. |
| Name of the service being scraped, if applicable |
Default attributes for the remote write integration
By default, the following attributes will be added to Prometheus remote write metrics:
Default attributes | Description |
---|---|
| A user supplied label specified as a Prometheus remote write URL parameter. The value supplied should be unique as it is intended to differentiate between source Prometheus servers at query time. Unspecified by default. |
| The name of the New Relic ingest point ( |
|
|
|
|
| A user supplied identifier for the source of the Prometheus data that matches the value of |
| Used to identify the version of the remote write API; for example, |
NRQL query examples
When you build queries, be aware that there is no linking between the metrics, entities, and attributes. Use the following NRQL queries to find out which metrics are available and which attributes are present on these metrics:
For more information about facets, time series, and time selection, see the NRQL documentation.
Build the query
To build PromQL-style queries, see our documentation about supported PromQL features.
View data in New Relic
When you query the data, you can view the results in the New Relic UI. You can also visualize the data as charts, histograms, etc.
To view the NRQL query results for your Prometheus integration's data:
- In New Relic, expand the query builder by clicking the bar at the bottom.
- Open the query builder menu by clicking the three dots next to the Copy your query link action, and then select PromQL.
- In the translator, enter your PromQL query. It's auto-translated into an NRQL query.
- Click Submit.
For more information, see our query builder documentation.
Generate histograms and calculate percentiles
Using Prometheus remote write or version 2.0.0 and higher of the Prometheus OpenMetrics Integration (POMI), you can generate histograms and calculate percentiles from your data. For Prometheus histograms, a bucket <basename>_bucket{le="42"}
will be sent as the metric <basename>_bucket
, and the dimension will be {histogram.bucket.le="42"}
.
NRQL has two functions that work on Prometheus histograms ingested via remote write or the Prometheus OpenMetrics Integration (starting with version 2.0.0): bucketPercentile()
, and histogram()
. The links include query examples.