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 |
---|---|
prometheus_server | 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:
Build the query
Using metric name and attributes, you can query your data. For more information about facets, time series, and time selection, see the NRQL documentation.
To build PromQL-style queries, see our docs.
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: Go to one.newrelic.com > Query your data. For more information, see New Relic's query builder documentation.
Create histograms and summaries
With remote write or version 1.2.0 or higher of the Prometheus OpenMetrics integration, you can create histograms and percentiles (summaries) of your data. The OpenMetrics data is based on New Relic's guidelines in GitHub for higher level metric abstractions, while the remote write data closely matches the schema of the original Prometheus data.
Data presentation | Comments |
---|---|
Histograms | A bucket
|
Percentiles | Quantiles (summaries) are transformed into percentiles. A metric The dimension will be this:
|
NRQL has two functions that work on remote write ingested PromQL: bucketPercentile()
and histogram()
. The links include query examples.These two functions don't work on OpenMetrics ingested buckets.
To better support visualization of histograms, percentiles are calculated based on the histogram metrics and sent to New Relic. To configure the calculated percentiles for OpenMetrics, use the percentiles
configuration option.
For more help
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 and and documentation.