Install the New Relic Elasticsearch OpenTelemetry integration to monitor your Elasticsearch clusters with industry-standard protocols. This guide walks you through configuring the OpenTelemetry Collector to collect metrics and logs from your Elasticsearch infrastructure and send them to New Relic.
To install the integration, complete the following steps:
- Before you begin - Check requirements and prerequisites
- Configure the OpenTelemetry Collector - Set up data collection
- Set environment variables - Configure authentication
- Find and use data - View your Elasticsearch data in New Relic
- Set up alerts - Configure proactive monitoring
Step 1: Before you begin
Ensure you have:
- Required access privileges - Elasticsearch cluster admin privileges and New Relic account with access
- Elasticsearch version 7.16 or higher - This integration requires a modern Elasticsearch cluster
- Monitor or manage cluster privileges - If security is enabled, you need either monitor or manage cluster privilege. See the Elasticsearch security privileges documentation for more details
- Network connectivity - Outbound HTTPS connectivity (port 443) to New Relic's OTLP ingest endpoint
- OpenTelemetry Collector - OpenTelemetry Collector Contrib installed and running on your host. Install via an official package (.deb or .rpm) to ensure the systemd service unit is created correctly
- Configuration values ready - You'll need two key values for the configuration:
- Elasticsearch endpoint - Your actual Elasticsearch URL (replace
https://localhost:9200) - Cluster name - A unique name to identify your cluster in New Relic
- Elasticsearch endpoint - Your actual Elasticsearch URL (replace
Step 2: Configure the OpenTelemetry Collector
Configure the OpenTelemetry Collector to collect metrics and logs from your Elasticsearch cluster. Create or update your configuration file at /etc/otelcol-contrib/config.yaml.
The configuration varies based on your Elasticsearch setup and monitoring requirements. Choose the appropriate configuration below:
팁
Correlate APM with Elasticsearch: To connect your APM application and Elasticsearch cluster, include the resource attribute es.cluster.name="your-cluster-name" in your APM metrics. This enables cross-service visibility and faster troubleshooting within New Relic.
Step 3: Set environment variables
Configure authentication by adding your New Relic and OTLP endpoint to the collector service.
Create a systemd override directory:
bash$sudo mkdir -p /etc/systemd/system/otelcol-contrib.service.dWrite
environment.confwith your OTLP endpoint. ReplaceYOUR_LICENSE_KEYwith the New Relic license key andYOUR_OTLP_ENDPOINTwith the appropriate endpoint for your region. Refer to the OTLP endpoint configuration documentation to select the right endpoint.bash$cat <<EOF | sudo tee /etc/systemd/system/otelcol-contrib.service.d/environment.conf$[Service]$Environment="NEWRELIC_OTLP_ENDPOINT=YOUR_OTLP_ENDPOINT"$Environment="NEWRELIC_LICENSE_KEY=YOUR_LICENSE_KEY"$EOFReload systemd and restart the collector:
bash$sudo systemctl daemon-reload$sudo systemctl restart otelcol-contrib.service
Step 4: View your Elasticsearch data
Once the collector is running and sending data, you can view your Elasticsearch metrics in New Relic:
- Go to one.newrelic.com > Integrations & Agents
- Search for Elasticsearch (OpenTelemetry)
- Under Dashboards, click Elasticsearch OpenTelemetry Dashboard
- Select your account and click View dashboard
You should see dashboards showing cluster health, performance metrics, and resource usage.
팁
Not seeing data? It may take a few minutes for data to appear. If you don't see metrics after 10 minutes, check our troubleshooting guide.
Next steps with your data:
- Explore metrics: All Elasticsearch metrics are stored as
Metricevent types - Create custom queries: Use NRQL to build custom charts and dashboards
- Set up alerts: Continue to Step 5 to configure proactive monitoring
Step 5: Set up alerts
Proactive monitoring with alerts helps you catch issues before they impact your users. To create alert conditions in New Relic:
- Go to one.newrelic.com > Alerts > Alert Conditions.
- Click Create condition.
- Configure the alert using either Guided mode or the NRQL query builder.
The alert configurations below are recommended for robust Elasticsearch monitoring:
Essential Alerts (High Priority)
These alerts monitor critical cluster health issues that can cause data loss or service outages:
Alert Name | Threshold Rationale (Example Condition) |
|---|---|
Unassigned Shards Alert | Metric |
Healthy Data Nodes Alert | Metric |
Heap Usage Too High Alert | Heap usage percentage (Used/Max) is above 90% for at least 5 minutes. |
Pending Tasks Alert | Metric |
Additional Monitoring Alerts
These alerts help monitor performance and operational issues:
Alert Name | Threshold Rationale (Example Condition) |
|---|---|
Query Time Slow Alert | 95th percentile of |
Initializing Shards Too Long | Metric |
Relocating Shards Too Long | Metric |
Troubleshooting
If you encounter issues during installation or don't see data in New Relic, see our comprehensive troubleshooting guide for step-by-step solutions to common problems.