Elasticsearch monitoring integration
Gain deep insights into Elasticsearch performance with seamless data integration into New Relic. Monitor key metrics at the cluster, node, and index level - all within our powerful platform. Create alerts to stay ahead of performance anomalies, build custom dashboards for tailored views, and proactively optimize your Elasticsearch monitoring.
To get the most out of this page, select the installation method that fits your environment. You need a New Relic account before starting the installation process.
Tip
Use guided install to quickly see your data in the UI
The guided install is a single CLI command you can run to monitor your Elasticsearch instance. It's a good option for small organizations, or for anyone who wants to test out New Relic.
For a more permanent and scalable solution, we recommend the standard manual install of the agent: keep reading for how to do that.
Elasticsearch-config.yml sample files
Here are some example basic and advanced sample config files:
This is the basic configuration used to collect metrics and inventory from your localhost:
integrations: - name: nri-elasticsearch env: HOSTNAME: localhost PORT: 9200 USERNAME: elasticsearch_user PASSWORD: elasticsearch_password CONFIG_PATH: /etc/elasticsearch/elasticsearch.yml interval: 15s labels: environment: production inventory_source: config/elasticsearch
This configuration collects metrics every 15 seconds and inventory every 60 seconds:
integrations: - name: nri-elasticsearch env: METRICS: true HOSTNAME: localhost PORT: 9200 USERNAME: elasticsearch_user PASSWORD: elasticsearch_password REMOTE_MONITORING: true interval: 15s labels: environment: production
- name: nri-elasticsearch env: INVENTORY: true HOSTNAME: localhost PORT: 9200 USERNAME: elasticsearch_user PASSWORD: elasticsearch_password CONFIG_PATH: /etc/elasticsearch/elasticsearch.yml interval: 60s labels: environment: production inventory_source: config/elasticsearch
In this configuration we are using the environment variable ELASTIC_HOST
to populate the HOSTNAME
setting of the integration:
integrations: - name: nri-elasticsearch env: METRICS: "true" HOSTNAME: {{ELASTIC_HOST}} PORT: 9200 USERNAME: elasticsearch_user PASSWORD: elasticsearch_password interval: 15s labels: env: production role: load_balancer
The integration is capable of collecting all metrics from the cluster just connecting to one of the nodes, using a basic configuration showed before all the cluster metrics can be scraped.
Another way to configure the integration is to configure the scrape of all instances but activating the MASTER_ONLY
parameter which makes the integration only collect metrics if the scraped instance is master. This allows to share the same config for all the nodes and avoid data duplication.
This is how the config file of each of the nodes should look like:
integrations: - name: nri-elasticsearch env: HOSTNAME: localhost PORT: 9200 USERNAME: elasticsearch_user PASSWORD: elasticsearch_password MASTER_ONLY: "true" CONFIG_PATH: /etc/elasticsearch/elasticsearch.yml interval: 15s labels: environment: production inventory_source: config/elasticsearch
Elasticsearch config settings
You can use the env
section of the elasticsearch-config.yml
file, to define specific settings related to Elasticsearch. These settings control the connection to your Elasticsearch instance, as well as other security settings and features.
The Elasticsearch integration collects both Metrics and Inventory information. In the table, use the Applies to column for the settings available to each collection:
Setting | Description | Default | Applies to |
---|---|---|---|
| Hostname or IP where Elasticsearch is running. |
| M/I |
| Hostname or IP of the Elasticsearch node from which to collect inventory data. Should only be set if you do not wish to collect inventory data against localhost. |
| M |
| Port on which Elasticsearch is listening. |
| M/I |
| Username for accessing Elasticsearch Node. | N/A | M/I |
| Password for the given user. | N/A | M/I |
| A way to further specify which cluster we are gathering data, for example, 'staging'. | N/A | M/I |
| Use SSL when communicating with the Elasticsearch node. |
| M/I |
| Location of SSL certificate on the host. Only required if | N/A | M/I |
| Alternative Certificate Authority bundle directory. | N/A | M/I |
| Alternative server hostname that the integration will accept as valid for the purposes of SSL negotiation. | N/A | M/I |
| Skip the verification of the server's certificate chain and hostname. |
| M/I |
| Path to the Elasticsearch configuration file. |
| I |
| Timeout for API requests, in seconds. |
| M/I |
| Signals whether to collect indices metrics or not. |
| M |
| Signals whether to collect primaries metrics or not. |
| M |
| Filter which indices are collected. | N/A | M |
| Collect cluster metrics on the elected master only. |
| M |
| Set to |
| |
| Set to |
|
Metric data
The Elasticsearch integration collects the following metrics. Each metric name is prefixed with a category indicator and a period, such as cluster.
or shards.
.
Metric | Description |
---|---|
| The number of data nodes in the cluster. |
| The number of nodes in the cluster. |
| The Elasticsearch cluster health: |
| The number of active shards in the cluster. |
| The number of shards that are currently initializing. |
| The number of active primary shards in the cluster. |
| The number of shards that are relocating from one node to another. |
| The number of shards that are unassigned to a node. |
Metric | Description |
---|---|
| The number of active searches. |
| The time spent on the search fetch. |
| The estimated size of the field data circuit breaker, in bytes. |
| The estimated size of the parent circuit breaker, in bytes. |
| The estimated size of the request circuit breaker, in bytes. |
| The number of times the field data circuit breaker has tripped. |
| The number of times the parent circuit breaker has tripped. |
| The number of times the request circuit breaker has tripped. |
| The size of the id cache, in bytes. |
| The number of index flushes to disk since start. |
| The time spent flushing the index to disk. |
| Bytes available to this Java virtual machine on this file store, in bytes. |
| The total bytes read from the file store, in bytes. |
| The total bytes used for all I/O operations on the file store, in bytes. |
| The total I/O operations on the file store. |
| The total number of reads from the file store. |
| The total size of the file store, in bytes. |
| The total number of unallocated bytes in the file store, in bytes. |
| The total number of writes to the file store. |
| The total bytes written to the file store, in bytes. |
| The number of get requests currently running. |
| The number of get requests where the document existed. |
| The time spent on get requests where the document existed. |
| The number of get requests where the document was missing. |
| The time spent on get requests where the document was missing. |
| The time spent on get requests. |
| The number of get requests. |
| The number of current open HTTP connections. |
| The number of opened HTTP connections. |
| The number of documents currently being deleted from an index. |
| The number of documents currently being indexed to an index. |
| The number of documents indexed to an index. |
| The time spent deleting documents from an index. |
| The time spent indexing documents to an index. |
| The number of documents deleted from an index. |
| The number of failed indexing operations. |
| The time indexing waited due to throttling. |
| The memory used by the query cache, in bytes. |
| The number of documents across all primary shards assigned to the node. |
| The number of query cache evictions. |
| The number of query cache hits. |
| The number of query cache misses. |
| The number of ongoing recoveries for which a shard serves as a source. |
| The number of ongoing recoveries for which a shard serves as a target. |
| The total time recoveries waited due to throttling. |
| The number of request cache evictions. |
| The number of request cache hits. |
| The memory used by the request cache, in bytes. |
| The number of request cache misses. |
| The number of segments in an index shard. |
| The maximum memory used by the index writer, in bytes. |
| The memory used by doc values, in bytes. |
| The memory used by fixed bit set, in bytes. |
| The memory used by index segments, in bytes. |
| The memory used by the index writer, in bytes. |
| The memory used by norm, in bytes. |
| The memory used by the segment version map, in bytes. |
| The memory used by stored fields, in bytes. |
| The memory used by terms, in bytes. |
| The memory used by term vectors, in bytes. |
| The number of operations in the transaction log. |
| The size of the transaction log, in bytes. |
| The number of garbage collections run by the JVM. |
| The time spent on garbage collection in the JVM. |
| The number of concurrent mark & sweep GCs in the JVM. |
| The time spent on concurrent mark & sweep GCs in the JVM. |
| The number of major GCs in the JVM that collect old generation objects. |
| The time spent in major GCs in the JVM that collect old generation objects. |
| The number of minor GCs in the JVM that collects young generation objects. |
| The time spent in minor GCs in the JVM that collects young generation objects. |
| The number of parallel new GCs in the JVM. |
| The time spent on parallel new GCs in the JVM. |
| The amount of memory guaranteed to be available to the JVM heap, in bytes. |
| The maximum amount of memory that can be used by the JVM heap, in bytes. |
| The percentage of memory currently used by the JVM heap as a value between |
| The amount of memory currently used by the JVM heap, in bytes. |
| The maximum amount of memory that can be used by the old generation heap, in bytes. |
| The maximum amount of memory that can be used by the survivor space, in bytes. |
| The maximum amount of memory that can be used by the young generation heap, in bytes. |
| The amount of memory guaranteed to be available to JVM non-heap, in bytes. |
| The amount of memory currently used by the JVM non-heap, in bytes. |
| The amount of memory currently used by the old generation heap, in bytes. |
| The amount of memory currently used by the survivor space, in bytes. |
| The amount of memory currently used by the young generation heap, in bytes. |
| The number of active threads in the JVM. |
| The peak number of threads used by the JVM. |
| The number of currently active segment merges. |
| The number of documents across segments currently being merged. |
| The number of documents across all merged segments. |
| The size of all merged segments, in bytes. |
| The number of segment merges. |
| The size of the segments currently being merged, in bytes. |
| The time spent on segment merging. |
| The number of opened file descriptors associated with the current process, or |
| The number of queries. |
| The number of index refreshes. |
| The time spent on index refreshes. |
| The number of search fetches currently running. |
| The number of search fetches. |
| The size of the store, in bytes. |
| The number of queued threads in the bulk pool. |
| The number of active threads in the bulk pool. |
| The number of rejected threads in the bulk pool. |
| The number of threads in the bulk pool. |
| The number of queued threads in the fetch shard started pool. |
| The number of rejected threads in the fetch shard started pool. |
| The number of threads in the fetch shard started pool. |
| The number of active threads in the fetch shard store pool. |
| The number of queued threads in the fetch shard store pool. |
| The number of rejected threads in the fetch shard store pool. |
| The number of threads in the fetch shard store pool. |
| The number of active threads in the flush queue. |
| The number of queued threads in the flush pool. |
| The number of rejected threads in the flush pool. |
| The number of threads in the flush pool. |
| The number of active threads for force merge operations. |
| The number of queued threads for force merge operations. |
| The number of rejected threads for force merge operations. |
| The number of threads for force merge operations. |
| The number of active threads in the generic pool. |
| The number of queued threads in the generic pool. |
| The number of rejected threads in the generic pool. |
| The number of threads in the generic pool. |
| The number of active threads in the get pool. |
| The number of queued threads in the get pool. |
| The number of rejected threads in the get pool. |
| The number of threads in the get pool. |
| The number of active threads in the listener pool. |
| The number of queued threads in the listener pool. |
| The number of rejected threads in the listener pool. |
| The number of threads in the listener pool. |
| The number of active threads in the management pool. |
| The number of queued threads in the management pool. |
| The number of rejected threads in the management pool. |
| The number of threads in the management pool. |
| The number of active threads in the merge pool. |
| The number of queued threads in the merge pool. |
| The number of rejected threads in the merge pool. |
| The number of threads in the merge pool. |
| The number of active threads in the percolate pool. |
| The number of queued threads in the percolate pool. |
| The number of rejected threads in the percolate pool. |
| The number of threads in the percolate pool. |
| The number of active threads in the refresh pool. |
| The number of queued threads in the refresh pool. |
| The number of rejected threads in the refresh pool. |
| The number of threads in the refresh pool. |
| The number of active threads in the search pool. |
| The number of queued threads in the search pool. |
| The number of rejected threads in the search pool. |
| The number of threads in the search pool. |
| The number of active threads in the snapshot pool. |
| The number of queued threads in the snapshot pool. |
| The number of rejected threads in the snapshot pool. |
| The number of threads in the snapshot pool. |
| The number of active threads in the fetch shard started pool. |
| The number of connections opened for cluster communication. |
| The number of packets received in cluster communication. |
| The size of data received in cluster communication, in bytes. |
| The number of packets sent in cluster communication. |
| The size of data sent in cluster communication, in bytes. |
Metric | Description |
---|---|
| The number of documents deleted from the primary shards. |
| The number of documents in the primary shards. |
| The number of index flushes to disk from the primary shards since start. |
| The time spent flushing the index to disk from the primary shards. |
| The number of get requests on primary shards where the document existed. |
| The time spent on get requests from the primary shards where the document existed. |
| The number of get requests from the primary shards where the document was missing. |
| The time spent on get requests from the primary shards where the document was missing. |
| The number of get requests from the primary shards. |
| The number of get requests currently running on the primary shards. |
| The time spent on get requests from the primary shards. |
| The number of documents currently being deleted from an index on the primary shards. |
| The time spent deleting documents from an index on the primary shards. |
| The number of documents currently being indexed to an index on the primary shards. |
| The time spent indexing documents to an index on the primary shards. |
| The number of documents deleted from an index on the primary shards. |
| The number of documents indexed to an index on the primary shards. |
| The number of index refreshes on the primary shards. |
| The time spent on index refreshes on the primary shards. |
| The number of currently active segment merges on the primary shards. |
| The number of documents across segments currently being merged on the primary shards. |
| The number of documents across all merged segments on the primary shards. |
| The size of the segments currently being merged on the primary shards, in bytes. |
| The number of segment merges on the primary shards. |
| The size of all merged segments on the primary shards, in bytes. |
| The time spent on segment merging on the primary shards. |
| The time spent querying on the primary shards. |
| The number of queries to the primary shards. |
| The number of currently active queries on the primary shards. |
| The number of query fetches currently running on the primary shards. |
| The time spent on query fetches on the primary shards. |
| The number of query fetches on the primary shards. |
| The size of all the primary shards, in bytes. |
Metric | Description |
---|---|
| The number of documents in the index. |
| The number of deleted documents in the index. |
| The status of the index: |
| The number of primary shards in the index. |
| The store size of primary shards in the index. |
| The number of replica shards in the index. |
| The store size of primary and replica shards in the index, in bytes. |