To install the Prometheus OpenMetrics integration, follow the procedures for Docker or Kubernetes as applicable:
To install the New Relic Prometheus OpenMetrics integration in a Docker environment:
Create a configuration file config.yaml. Use the example configuration file, or look at the nri-prometheus-latest.yaml manifest file, which includes the nri-prometheus-cfg config map and an example configuration.
Required: Add your New Relic license key and a cluster name to identify your Docker container.
Add the endpoints to scrape; for example, add the http://localhost:8080/metrics endpoint to collect metrics about the integration itself.
Specify which metrics you want to ignore or include according to the prefixes for the metrics and labels. For more information, see the metrics filtering documentation.
Confirm that the integration has been configured correctly: Wait a few minutes, then go to the New Relic UI, and run this NRQL query to see if data has been reported:
FROM Metric SELECT count(*) WHERE clusterName = 'YOUR_CLUSTER_NAME' since 1 hour ago
Important
To prevent your data from being duplicated, configure your New Relic Prometheus OpenMetrics integration only with one replica. Running two or more replicas will result in duplicated data. For more information, see the troubleshooting procedures for restarts and gaps in data.
To install the New Relic Prometheus OpenMetrics integration in a Kubernetes environment:
Specify which metrics you want to ignore or include according to the prefixes for the metrics and labels. By default, the New Relic Prometheus OpenMetrics integration uses the same labels as Prometheus to discover targets. For more information, see the metrics filtering documentation.
Deploy the integration in your Kubernetes cluster:
kubectl apply -f nri-prometheus-latest.yaml
To confirm that the deployment has been created successfully, look at the CURRENT replicas in the results generated by this command:
kubectl get deployments nri-prometheus
Confirm that the integration has been configured correctly: Wait a few minutes, then go to the New Relic UI, and run this NRQL query to see if data has been reported:
FROM Metric SELECT count(*) WHERE clusterName = 'YOUR_CLUSTER_NAME' since 1 hour ago
Update the integration
To update the Prometheus OpenMetrics integration, follow the procedures for Docker or Kubernetes as applicable: