Prometheus exporter for New Relic data. This exporter allows you to collect metrics from New Relic's API and expose them in Prometheus format.
✅ Actively Maintained - This project is actively maintained and accepting contributions.
We welcome:
- 🐛 Bug reports and fixes
- ✨ Feature requests and implementations
- 📖 Documentation improvements
- 🧪 Test coverage improvements
- ✅ Export New Relic APM metrics to Prometheus
- ✅ Support for multiple applications
- ✅ Configurable metric filtering to reduce API usage
- ✅ Built-in caching to optimize API calls
- ✅ Docker support with multi-architecture images (amd64, arm64)
- ✅ Kubernetes deployment via Helm chart
- ✅ Comprehensive configuration with validation
- ✅ Automated CI/CD with GitHub Actions and CircleCI
- A New Relic account with API access
- New Relic REST API key
- Prometheus server (for collecting metrics)
# Pull the latest image
docker pull ghcr.io/mrf/newrelic-exporter:latest
# Create a configuration file
cat > newrelic_exporter.yml <<EOF
api.key: YOUR_API_KEY_HERE
api.service: applications
api.timeout: 15s
api.include-metric-filters:
- "HttpDispatcher"
- "Database"
- "Apdex"
EOF
# Run the exporter
docker run -d \
-p 9126:9126 \
-v $(pwd)/newrelic_exporter.yml:/app/newrelic_exporter.yml \
ghcr.io/mrf/newrelic-exporter:latest# Add the Helm chart
helm install newrelic-exporter ./helm/newrelic-exporter \
--set newrelic.apiKey=YOUR_API_KEY \
--set newrelic.service=applications \
--set newrelic.includeMetricFilters[0]="HttpDispatcher"See the Helm chart README for detailed configuration options.
cp newrelic_exporter.yml.example newrelic_exporter.yml
# Edit newrelic_exporter.yml with your API key and settings
docker run -v $(pwd)/newrelic_exporter.yml:/app/newrelic_exporter.yml ghcr.io/mrf/newrelic-exportergit clone https://github.com/mrf/newrelic_exporter.git
cd newrelic_exporter
make
cp newrelic_exporter.yml.example newrelic_exporter.yml
# Edit newrelic_exporter.yml with your API key and settings
./newrelic_exporter| Name | Description | Default |
|---|---|---|
--config |
Config file path | newrelic_exporter.yml |
The exporter uses a YAML configuration file. See newrelic_exporter.yml.example for a comprehensive example with detailed documentation.
| Setting | Description |
|---|---|
api.key |
Your New Relic API key |
api.service |
Service type (e.g., applications, mobile) |
api.timeout |
API request timeout (e.g., 15s) - must include time unit |
api.include-metric-filters |
List of metric filters (at least one required) |
| Setting | Description | Default |
|---|---|---|
api.server |
API server URL | https://api.newrelic.com |
api.period |
Data request period in seconds | 60 |
api.apps-list-cache-time |
Application list cache duration | 0 (no cache) |
api.metric-names-cache-time |
Metric names cache duration | 0 (no cache) |
api.include-apps |
Filter specific applications | [] (all apps) |
api.include-values |
Filter specific metric values | [] (all values) |
web.listen-address |
HTTP server listen address | :9126 |
web.telemetry-path |
Metrics endpoint path | /metrics |
debug.proxy-address |
Proxy for debugging | "" |
api.key: YOUR_API_KEY
api.service: applications
api.timeout: 15s
api.include-metric-filters:
- "HttpDispatcher"
- "Apdex"api.key: YOUR_API_KEY
api.service: applications
api.timeout: 30s
api.apps-list-cache-time: 1h
api.metric-names-cache-time: 1h
api.include-apps:
- name: "Production Web"
- name: "Production API"
api.include-metric-filters:
- "HttpDispatcher"
- "Database"
- "External"See newrelic_exporter.yml.example for more examples.
Add the following to your prometheus.yml:
scrape_configs:
- job_name: 'newrelic'
static_configs:
- targets: ['localhost:9126']
scrape_interval: 60s # Match api.period in exporter configgo test -v ./...make
# or
go build -o newrelic_exporter .docker build -t ghcr.io/mrf/newrelic-exporter:latest .This project includes automated CI/CD pipelines:
- GitHub Actions: Builds, tests, and publishes Docker images on every push and release
- Helm Chart Testing: Automated Helm chart validation and testing with Kind
- CircleCI: Alternative CI/CD pipeline with advanced features
See .github/workflows/ and .circleci/ for configuration details.
The Helm chart is automatically tested using Kind (Kubernetes in Docker) to ensure it works correctly. Tests include:
- Chart linting and validation
- Installation in a real Kubernetes cluster
- Resource validation (deployments, services, pods, etc.)
- Connectivity and metrics endpoint testing
- Upgrade scenario testing
For local testing and detailed information, see the Helm Testing Guide.
Quick local test:
./scripts/test-helm-chart.shWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests:
- Go tests:
go test ./... - Helm chart tests:
./scripts/test-helm-chart.sh
- Go tests:
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Error: "Config validation failed: api.timeout is not set"
- Solution: Ensure timeout includes time units (e.g.,
"15s"not"15")
Error: "Config validation failed: api.key is required"
- Solution: Set your New Relic API key in the config file
No metrics appearing
- Check that your API key is valid
- Verify application names/IDs are correct
- Ensure metric filters match available metrics in New Relic
Slow scrapes or timeouts
- Reduce the number of metric filters
- Enable and increase cache times
- Filter to specific applications only
- Increase the timeout value
See the configuration example for a comprehensive troubleshooting guide.
- Issues: GitHub Issues
- Pull Requests: GitHub Pull Requests
- Discussions: GitHub Discussions
This project is licensed under the terms specified in the LICENSE file.
- Built with Prometheus Go client library
- New Relic API documentation: https://docs.newrelic.com/docs/apis/rest-api-v2/
- Prometheus - Monitoring system and time series database
- New Relic - Application performance monitoring platform
- Grafana - Visualization platform (works great with this exporter)