Project: Netdata (Observability and Analysis / Observability)
File: elasticsearch.md

<!--startmeta customediturl: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/elasticsearch.md" meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml" sidebar_label: "Elasticsearch" learn_status: "Published" learnrelpath: "Collecting Metrics/Search Engines" most_popular: True message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> <img src="https://netdata.cloud/img/elasticsearch.svg" width="150"/> Plugin: go.d.plugin Module: elasticsearch <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> This collector monitors the performance and health of the Elasticsearch cluster. It uses to collect metrics. Used endpoints: | Endpoint | Description | API | ||-|-| | `/` | Node info | | | `/_nodes/stats` | Nodes metrics | | | `/nodes/local/stats` | Local node metrics | | | `/_cluster/health` | Cluster health stats | | | `/_cluster/stats` | Cluster metrics | | This collector is supported on all platforms. This collector supports collecting metrics from multiple instances of this integration, including remote instances. By default, it detects instances running on localhost by attempting to connect to port 9200: http://127.0.0.1:9200 https://127.0.0.1:9200 By default, this collector monitors only the node it is connected to. To monitor all cluster nodes, set the `cluster_mode` configuration option to `yes`. The default configuration for this integration is not expected to impose a significant performance impact on the system. Metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. These metrics refer to the cluster node. Labels: | Label | Description | |:--|:-| | cluster_name | Name of the cluster. Based on the . | | node_name | Human-readable identifier for the node. Based on the . | | host | Network host for the node, based on the . | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | elasticsearch.nodeindicesindexing | index | operations/s | | elasticsearch.nodeindicesindexing_current | index | operations | | elasticsearch.nodeindicesindexing_time | index | milliseconds | | elasticsearch.nodeindicessearch | queries, fetches | operations/s | | elasticsearch.nodeindicessearch_current | queries, fetches | operations | | elasticsearch.nodeindicessearch_time | queries, fetches | milliseconds | | elasticsearch.nodeindicesrefresh | refresh | operations/s | | elasticsearch.nodeindicesrefresh_time | refresh | milliseconds | | elasticsearch.nodeindicesflush | flush | operations/s | | elasticsearch.nodeindicesflush_time | flush | milliseconds | | elasticsearch.nodeindicesfielddatamemoryusage | used | bytes | | elasticsearch.nodeindicesfielddata_evictions | evictions | operations/s | | elasticsearch.nodeindicessegments_count | segments | segments | | elasticsearch.nodeindicessegmentsmemoryusage_total | used | bytes | | elasticsearch.nodeindicessegmentsmemoryusage | terms, storedfields, termvectors, norms, points, docvalues, indexwriter, versionmap, fixedbit_set | bytes | | elasticsearch.nodeindicestranslog_operations | total, uncommitted | operations | | elasticsearch.nodeindicestranslog_size | total, uncommitted | bytes | | elasticsearch.nodefiledescriptors | open | fd | | elasticsearch.nodejvmheap | inuse | percentage | | elasticsearch.nodejvmheap_bytes | committed, used | bytes | | elasticsearch.nodejvmbufferpoolscount | direct, mapped | pools | | elasticsearch.nodejvmbufferpooldirect_memory | total, used | bytes | | elasticsearch.nodejvmbufferpoolmapped_memory | total, used | bytes | |

| young, old | gc/s | | elasticsearch.nodejvmgc_time | young, old | milliseconds | | elasticsearch.nodethreadpoolqueued | generic, search, searchthrottled, get, analyze, write, snapshot, warmer, refresh, listener, fetchshardstarted, fetchshardstore, flush, force_merge, management | threads | | elasticsearch.nodethreadpoolrejected | generic, search, searchthrottled, get, analyze, write, snapshot, warmer, refresh, listener, fetchshardstarted, fetchshardstore, flush, force_merge, management | threads | | elasticsearch.nodeclustercommunication_packets | received, sent | pps | | elasticsearch.nodeclustercommunication_traffic | received, sent | bytes/s | | elasticsearch.nodehttpconnections | open | connections | | elasticsearch.nodebreakerstrips | requests, fielddata, inflightrequests, model_inference, accounting, parent | trips/s | These metrics refer to the cluster. Labels: | Label | Description | |:--|:-| | cluster_name | Name of the cluster. Based on the . | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | elasticsearch.clusterhealthstatus | green, yellow, red | status | | elasticsearch.clusternumberofnodes | nodes, datanodes | nodes | | elasticsearch.clustershardscount | activeprimary, active, relocating, initializing, unassigned, delayedunaasigned | shards | | elasticsearch.clusterpendingtasks | pending | tasks | | elasticsearch.clusternumberofinflightfetch | inflight_fetch | fetches | | elasticsearch.clusterindicescount | indices | indices | | elasticsearch.clusterindicesshards_count | total, primaries, replication | shards | | elasticsearch.clusterindicesdocs_count | docs | docs | | elasticsearch.clusterindicesstore_size | size | bytes | | elasticsearch.clusterindicesquery_cache | hit, miss | events/s | | elasticsearch.clusternodesbyrolecount | coordinatingonly, data, datacold, datacontent, datafrozen, datahot, datawarm, ingest, master, ml, remoteclusterclient, voting_only | nodes | These metrics refer to the index. Labels: | Label | Description | |:--|:-| | cluster_name | Name of the cluster. Based on the . | | index | Name of the index. | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | elasticsearch.nodeindexhealth | green, yellow, red | status | | elasticsearch.nodeindexshards_count | shards | shards | | elasticsearch.nodeindexdocs_count | docs | docs | | elasticsearch.nodeindexstoresize | storesize | bytes | The following alerts are available: | Alert name | On metric | Description | |:|:-|:| | | elasticsearch.nodeindicessearch_time | search performance is degraded, queries run slowly. | | | elasticsearch.nodeindicessearch_time | search performance is degraded, fetches run slowly. | | | elasticsearch.clusterhealthstatus | cluster health status is red. | | | elasticsearch.clusterhealthstatus | cluster health status is yellow. | | | elasticsearch.nodeindexhealth | node index $label:index health status is red. | No action required. The configuration file name for this integration is `go.d/elasticsearch.conf`. You can edit the configuration file using the `edit-config` script from the Netdata . ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata sudo ./edit-config go.d/elasticsearch.conf ``` The following options can be defined globally: updateevery, autodetectionretry. <details><summary>Config options</summary> | Name | Description | Default | Required | |:-|:--|:-|:--:| | update_every | Data collection frequency. | 5 | no | | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be

| 0 | no | | url | Server URL. | http://127.0.0.1:9200 | yes | | cluster_mode | Controls whether to collect metrics for all nodes in the cluster or only for the local node. | false | no | | collectnodestats | Controls whether to collect nodes metrics. | true | no | | collectclusterhealth | Controls whether to collect cluster health metrics. | true | no | | collectclusterstats | Controls whether to collect cluster stats metrics. | true | no | | collectindicesstats | Controls whether to collect indices metrics. | false | no | | timeout | HTTP request timeout. | 2 | no | | username | Username for basic HTTP authentication. | | no | | password | Password for basic HTTP authentication. | | no | | proxy_url | Proxy URL. | | no | | proxy_username | Username for proxy basic HTTP authentication. | | no | | proxy_password | Password for proxy basic HTTP authentication. | | no | | method | HTTP request method. | GET | no | | body | HTTP request body. | | no | | headers | HTTP request headers. | | no | | notfollowredirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | | tlsskipverify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | | tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | | tls_cert | Client TLS certificate. | | no | | tls_key | Client TLS key. | | no | </details> A basic example configuration. ```yaml jobs: name: local url: http://127.0.0.1:9200 ``` Cluster mode example configuration. <details><summary>Config</summary> ```yaml jobs: name: local url: http://127.0.0.1:9200 cluster_mode: yes ``` </details> Basic HTTP authentication. <details><summary>Config</summary> ```yaml jobs: name: local url: http://127.0.0.1:9200 username: username password: password ``` </details> Elasticsearch with enabled HTTPS and self-signed certificate. <details><summary>Config</summary> ```yaml jobs: name: local url: https://127.0.0.1:9200 tlsskipverify: yes ``` </details> Note: When you define multiple jobs, their names must be unique. Collecting metrics from local and remote instances. <details><summary>Config</summary> ```yaml jobs: name: local url: http://127.0.0.1:9200 name: remote url: http://192.0.2.1:9200 ``` </details> To troubleshoot issues with the `elasticsearch` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. ```bash cd /usr/libexec/netdata/plugins.d/ ``` Switch to the `netdata` user. ```bash sudo -u netdata -s ``` Run the `go.d.plugin` to debug the collector: ```bash ./go.d.plugin -d -m elasticsearch ```