Unless otherwise noted, configuration options for your Prometheus OpenMetrics integration with New Relic apply to both Docker and Kubernetes environments. At a minimum, the following configuration values are required:
Recommendation: Configure your New Relic license key as an environment variable named
LICENSE_KEY. This provides a more secure environment, as New Relic can load your environment variable from a mutual TLS authentication secret.
nri-prometheus-latest.yaml manifest file includes the
nri-prometheus-cfg map showing an example configuration. Use the manifest file to configure the following parameters.
If you want the target key in the configuration file to contain one or more objects, use the following structure in the YAML list:
A description for the URLs in this target.
A list of strings with the URLs to be scraped.
Authentication configuration used to send requests. It supports TLS and Mutual TLS. For more information, see the documentation about mutual TLS authentication.
The Prometheus OpenMetrics integration does not automatically reload the configuration when you make changes to the configuration file.
To reload the configuration, restart the container running the integration:
docker restart nri-prometheus
To reload the configuration, restart the integration. Recommendation: Scale the deployment down to zero replicas, and then scale it back to one replica:
kubectl scale deployment nri-prometheus --replicas=0kubectl scale deployment nri-prometheus --replicas=1
Docker: To run the integration with the previous configuration file:
Copy the content and save it to a
From within the same directory, run the command:
docker run -d --restart unless-stopped \ --name nri-prometheus \ -e CLUSTER_NAME="YOUR_CLUSTER_NAME" \ -e LICENSE_KEY="YOUR_LICENSE_KEY" \ -v "$(pwd)/config.yaml:/config.yaml" \ newrelic/nri-prometheus:latest --configfile=/config.yaml
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.