Skip to main content

Elasticsearch Receiver

Status Available in: contrib Maintainers: @jsirianni, @VihasMakwana, @rogercoll Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Note: in the future, Elasticsearch will be instrumented with the OpenTelemetry Java SDK directly (https://github.com/elastic/elasticsearch/issues/109335). When this is complete, native OpenTelemetry metrics may be added for measuring cluster health, index statistics, and so on. Please subscribe to the linked issue to keep updated.

Prerequisites

This receiver supports Elasticsearch versions 7.9+ If Elasticsearch security features are enabled, you must have either the monitor or manage cluster privilege. See the Elasticsearch docs for more information on authorization and Security privileges.

Configuration

The following settings are optional:
  • nodes (default: ["_all"]): Allows specifying node filters that define which nodes are scraped for node-level and cluster-level metrics. See the Elasticsearch documentation for allowed filters. If this option is left explicitly empty, then no node-level metrics will be scraped and cluster-level metrics will scrape only metrics related to cluster’s health.
  • skip_cluster_metrics (default: false): If true, cluster-level metrics will not be scraped.
  • indices (default: ["_all"]): Allows specifying index filters that define which indices are scraped for index-level metrics. See the Elasticsearch documentation for allowed filters. If this option is left explicitly empty, then no index-level metrics will be scraped.
  • endpoint (default = http://localhost:9200): The base URL of the Elasticsearch API for the cluster to monitor.
  • username (no default): Specifies the username used to authenticate with Elasticsearch using basic auth. Must be specified if password is specified.
  • password (no default): Specifies the password used to authenticate with Elasticsearch using basic auth. Must be specified if username is specified.
  • collection_interval (default = 10s): This receiver collects metrics on an interval. This value must be a string readable by Golang’s time.ParseDuration. On larger clusters, the interval may need to be lengthened, as querying Elasticsearch for metrics will take longer on clusters with more nodes.
  • initial_delay (default = 1s): defines how long this receiver waits before starting.

Example Configuration

receivers:
  elasticsearch:
    metrics:
      elasticsearch.node.fs.disk.available:
        enabled: false
    nodes: ["_local"]
    skip_cluster_metrics: true
    indices: [".geoip_databases"]
    endpoint: http://localhost:9200
    username: otel
    password: password
    collection_interval: 10s
The full list of settings exposed for this receiver are documented in config.go with detailed sample configurations in testdata/config.yaml.

Metrics

The following metric are available with versions:
  • elasticsearch.indexing_pressure.memory.limit >= 7.10
  • elasticsearch.node.shards.data_set.size >= 7.13
  • elasticsearch.cluster.state_update.count >= 7.16.0
  • elasticsearch.cluster.state_update.time >= 7.16.0
Details about the metrics produced by this receiver can be found in metadata.yaml. Refer to documentation.md for information on how to enable and disable metrics produced by this receiver.

Metrics

Metric NameDescriptionUnitTypeAttributes
elasticsearch.breaker.memory.estimatedEstimated memory used for the operation.ByGaugecircuit_breaker_name
elasticsearch.breaker.memory.limitMemory limit for the circuit breaker.ByUpDownCountercircuit_breaker_name
elasticsearch.breaker.trippedTotal number of times the circuit breaker has been triggered and prevented an out of memory error.1Countercircuit_breaker_name
elasticsearch.cluster.data_nodesThe number of data nodes in the cluster.{nodes}UpDownCounter
elasticsearch.cluster.healthThe health status of the cluster.{status}UpDownCounterhealth_status
elasticsearch.cluster.in_flight_fetchThe number of unfinished fetches.{fetches}UpDownCounter
elasticsearch.cluster.indices.cache.evictionsThe number of evictions from the cache for indices in cluster.{evictions}Countercache_name
elasticsearch.cluster.nodesThe total number of nodes in the cluster.{nodes}UpDownCounter
elasticsearch.cluster.pending_tasksThe number of cluster-level changes that have not yet been executed.{tasks}UpDownCounter
elasticsearch.cluster.published_states.differencesNumber of differences between published cluster states.1UpDownCountercluster_published_difference_state
elasticsearch.cluster.published_states.fullNumber of published cluster states.1UpDownCounter
elasticsearch.cluster.shardsThe number of shards in the cluster.{shards}UpDownCountershard_state
elasticsearch.cluster.state_queueNumber of cluster states in queue.1UpDownCountercluster_state_queue_state
elasticsearch.cluster.state_update.countThe number of cluster state update attempts that changed the cluster state since the node started.1Countercluster_state_update_state
elasticsearch.cluster.state_update.timeThe cumulative amount of time updating the cluster state since the node started.msCountercluster_state_update_state, cluster_state_update_type
elasticsearch.index.cache.evictionsThe number of evictions from the cache for an index.{evictions}Countercache_name, index_aggregation_type
elasticsearch.index.cache.memory.usageThe size in bytes of the cache for an index.ByUpDownCountercache_name, index_aggregation_type
elasticsearch.index.cache.sizeThe number of elements of the query cache for an index.1UpDownCounterindex_aggregation_type
elasticsearch.index.documentsThe number of documents for an index.{documents}UpDownCounterdocument_state, index_aggregation_type
elasticsearch.index.operations.completedThe number of operations completed for an index.{operations}Counteroperation, index_aggregation_type
elasticsearch.index.operations.merge.currentThe number of currently active segment merges{merges}Gaugeindex_aggregation_type
elasticsearch.index.operations.merge.docs_countThe total number of documents in merge operations for an index.{documents}Counterindex_aggregation_type
elasticsearch.index.operations.merge.sizeThe total size of merged segments for an index.ByCounterindex_aggregation_type
elasticsearch.index.operations.timeTime spent on operations for an index.msCounteroperation, index_aggregation_type
elasticsearch.index.segments.countNumber of segments of an index.{segments}UpDownCounterindex_aggregation_type
elasticsearch.index.segments.memorySize of memory for segment object of an index.ByUpDownCounterindex_aggregation_type, segments_memory_object_type
elasticsearch.index.segments.sizeSize of segments of an index.ByUpDownCounterindex_aggregation_type
elasticsearch.index.shards.sizeThe size of the shards assigned to this index.ByUpDownCounterindex_aggregation_type
elasticsearch.index.translog.operationsNumber of transaction log operations for an index.{operations}Counterindex_aggregation_type
elasticsearch.index.translog.sizeSize of the transaction log for an index.ByUpDownCounterindex_aggregation_type
elasticsearch.indexing_pressure.memory.limitConfigured memory limit, in bytes, for the indexing requests.ByGauge
elasticsearch.indexing_pressure.memory.total.primary_rejectionsCumulative number of indexing requests rejected in the primary stage.1Counter
elasticsearch.indexing_pressure.memory.total.replica_rejectionsNumber of indexing requests rejected in the replica stage.1Counter
elasticsearch.memory.indexing_pressureMemory consumed, in bytes, by indexing requests in the specified stage.ByUpDownCounterindexing_pressure_stage
elasticsearch.node.cache.countTotal count of query cache misses across all shards assigned to selected nodes.{count}UpDownCounterquery_cache_count_type
elasticsearch.node.cache.evictionsThe number of evictions from the cache on a node.{evictions}Countercache_name
elasticsearch.node.cache.memory.usageThe size in bytes of the cache on a node.ByUpDownCountercache_name
elasticsearch.node.cache.sizeTotal amount of memory used for the query cache across all shards assigned to the node.ByUpDownCounter
elasticsearch.node.cluster.connectionsThe number of open tcp connections for internal cluster communication.{connections}UpDownCounter
elasticsearch.node.cluster.ioThe number of bytes sent and received on the network for internal cluster communication.ByCounterdirection
elasticsearch.node.disk.io.readThe total number of kilobytes read across all file stores for this node.KiByUpDownCounter
elasticsearch.node.disk.io.writeThe total number of kilobytes written across all file stores for this node.KiByUpDownCounter
elasticsearch.node.documentsThe number of documents on the node.{documents}UpDownCounterdocument_state
elasticsearch.node.fs.disk.availableThe amount of disk space available to the JVM across all file stores for this node. Depending on OS or process level restrictions, this might appear less than free. This is the actual amount of free disk space the Elasticsearch node can utilise.ByUpDownCounter
elasticsearch.node.fs.disk.freeThe amount of unallocated disk space across all file stores for this node.ByUpDownCounter
elasticsearch.node.fs.disk.totalThe amount of disk space across all file stores for this node.ByUpDownCounter
elasticsearch.node.http.connectionsThe number of HTTP connections to the node.{connections}UpDownCounter
elasticsearch.node.ingest.documentsTotal number of documents ingested during the lifetime of this node.{documents}Counter
elasticsearch.node.ingest.documents.currentTotal number of documents currently being ingested.{documents}UpDownCounter
elasticsearch.node.ingest.operations.failedTotal number of failed ingest operations during the lifetime of this node.{operation}Counter
elasticsearch.node.open_filesThe number of open file descriptors held by the node.{files}UpDownCounter
elasticsearch.node.operations.completedThe number of operations completed by a node.{operations}Counteroperation
elasticsearch.node.operations.currentNumber of query operations currently running.{operations}Gaugeoperation
elasticsearch.node.operations.get.completedThe number of hits and misses resulting from GET operations.{operations}Counterget_result
elasticsearch.node.operations.get.timeThe time spent on hits and misses resulting from GET operations.msCounterget_result
elasticsearch.node.operations.timeTime spent on operations by a node.msCounteroperation
elasticsearch.node.pipeline.ingest.documents.currentTotal number of documents currently being ingested by a pipeline.{documents}UpDownCounteringest_pipeline_name
elasticsearch.node.pipeline.ingest.documents.preprocessedNumber of documents preprocessed by the ingest pipeline.{documents}UpDownCounteringest_pipeline_name
elasticsearch.node.pipeline.ingest.operations.failedTotal number of failed operations for the ingest pipeline.{operation}Counteringest_pipeline_name
elasticsearch.node.script.cache_evictionsTotal number of times the script cache has evicted old data.1Counter
elasticsearch.node.script.compilation_limit_triggeredTotal number of times the script compilation circuit breaker has limited inline script compilations.1Counter
elasticsearch.node.script.compilationsTotal number of inline script compilations performed by the node.{compilations}UpDownCounter
elasticsearch.node.segments.memorySize of memory for segment object of a node.ByUpDownCountersegments_memory_object_type
elasticsearch.node.shards.data_set.sizeTotal data set size of all shards assigned to the node. This includes the size of shards not stored fully on the node, such as the cache for partially mounted indices.ByUpDownCounter
elasticsearch.node.shards.reserved.sizeA prediction of how much larger the shard stores on this node will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities. A value of -1 indicates that this is not available.ByUpDownCounter
elasticsearch.node.shards.sizeThe size of the shards assigned to this node.ByUpDownCounter
elasticsearch.node.thread_pool.tasks.finishedThe number of tasks finished by the thread pool.{tasks}Counterthread_pool_name, task_state
elasticsearch.node.thread_pool.tasks.queuedThe number of queued tasks in the thread pool.{tasks}UpDownCounterthread_pool_name
elasticsearch.node.thread_pool.threadsThe number of threads in the thread pool.{threads}UpDownCounterthread_pool_name, thread_state
elasticsearch.node.translog.operationsNumber of transaction log operations.{operations}Counter
elasticsearch.node.translog.sizeSize of the transaction log.ByUpDownCounter
elasticsearch.node.translog.uncommitted.sizeSize of uncommitted transaction log operations.ByUpDownCounter
elasticsearch.os.cpu.load_avg.15mFifteen-minute load average on the system (field is not present if fifteen-minute load average is not available).1Gauge
elasticsearch.os.cpu.load_avg.1mOne-minute load average on the system (field is not present if one-minute load average is not available).1Gauge
elasticsearch.os.cpu.load_avg.5mFive-minute load average on the system (field is not present if five-minute load average is not available).1Gauge
elasticsearch.os.cpu.usageRecent CPU usage for the whole system, or -1 if not supported.%Gauge
elasticsearch.os.memoryAmount of physical memory.ByGaugememory_state
elasticsearch.process.cpu.timeCPU time used by the process on which the Java virtual machine is running.msCounter
elasticsearch.process.cpu.usageCPU usage in percent.1Gauge
elasticsearch.process.memory.virtualSize of virtual memory that is guaranteed to be available to the running process.ByUpDownCounter
jvm.classes.loadedThe number of loaded classes1Gauge
jvm.gc.collections.countThe total number of garbage collections that have occurred1Countercollector_name
jvm.gc.collections.elapsedThe approximate accumulated collection elapsed timemsCountercollector_name
jvm.memory.heap.committedThe amount of memory that is guaranteed to be available for the heapByGauge
jvm.memory.heap.maxThe maximum amount of memory can be used for the heapByGauge
jvm.memory.heap.usedThe current heap memory usageByGauge
jvm.memory.heap.utilizationFraction of heap memory usage1Gauge
jvm.memory.nonheap.committedThe amount of memory that is guaranteed to be available for non-heap purposesByGauge
jvm.memory.nonheap.usedThe current non-heap memory usageByGauge
jvm.memory.pool.maxThe maximum amount of memory can be used for the memory poolByGaugememory_pool_name
jvm.memory.pool.usedThe current memory pool memory usageByGaugememory_pool_name
jvm.threads.countThe current number of threads1Gauge

Attributes

Attribute NameDescriptionTypeValues
cache_nameThe name of cache.stringfielddata, query
nameThe name of circuit breaker.string
stateState of the published differencesstringincompatible, compatible
stateState of the published differencesstringpending, committed
stateState of cluster state updatestring
typeType of cluster state updatestringcomputation, context_construction, commit, completion, master_apply, notification
nameThe name of the garbage collector.string
directionThe direction of network data.stringreceived, sent
stateThe state of the document.stringactive, deleted
resultResult of get operationstringhit, miss
statusThe health status of the cluster.stringgreen, yellow, red
aggregationType of shard aggregation for index statisticsstringprimary_shards, total
stageStage of the indexing pressurestringcoordinating, primary, replica
nameName of the ingest pipeline.string
nameThe name of the JVM memory pool.string
stateState of the memorystringfree, used
operationThe type of operation.stringindex, delete, get, query, fetch, scroll, suggest, merge, refresh, flush, warmer
typeType of query cache countstringhit, miss
objectType of object in segmentstringterm, doc_value, index_writer, fixed_bit_set
stateThe state of the shard.stringactive, active_primary, relocating, initializing, unassigned, unassigned_delayed
stateThe state of the task.stringrejected, completed
thread_pool_nameThe name of the thread pool.string
stateThe state of the thread.stringactive, idle

Resource Attributes

Attribute NameDescriptionTypeEnabled
elasticsearch.cluster.nameThe name of the elasticsearch cluster.string
elasticsearch.index.nameThe name of the elasticsearch index.string
elasticsearch.node.nameThe name of the elasticsearch node.string
elasticsearch.node.versionThe version of the elasticsearch node.string

Configuration

Example Configuration

elasticsearch/defaults:
elasticsearch:
  metrics:
    elasticsearch.node.fs.disk.available:
      enabled: false
  nodes: [ "_local" ]
  skip_cluster_metrics: true
  indices: [ ".geoip_databases" ]
  endpoint: http://example.com:9200
  username: otel
  password: password
  collection_interval: 2m

Last generated: 2026-04-13