Elasticsearch

Elasticsearch monitoring for healthy clusters and fast search

by Obseria · Databases and messaging
  • OpenTelemetry
  • Infrastructure Observability
  • Databases and messaging
Category
Databases and messaging
Key metrics
10
Ready-made
5 dashboards & alerts
Setup
3 steps
Standard
OTLP

Point the OpenTelemetry Collector at your cluster with a read-only monitoring user and Obseria shows cluster health, shards, indexing and search rates, thread pool queues, JVM heap and disk for every node.

Read-only by design

The elasticsearch receiver only needs the monitor privilege and reads the node stats and cluster health APIs over HTTP.

Cluster and nodes in one view

Cluster health and shard states sit next to per-node heap, GC, disk and thread pools, so you see which node drags the cluster down.

Search latency with context

Obseria Intelligence links slow application requests to the Elasticsearch node, the rejected thread pool or the GC pause behind them.

Obseria interface

Obseria apps and capabilities: observability, APM, infrastructure and integrations
Obseria home dashboard with service health, open problems, SLO compliance and ingestion
Obseria trace explorer with span list and span attributes

Ready the moment data arrives

  • Elasticsearch cluster health, nodes and shards
  • Indexing and search throughput and latency per node
  • Alert on cluster health not green
  • Alert on thread pool rejections
  • JVM heap, GC and disk per node

What Obseria monitors in Elasticsearch

Cluster health

Green, yellow or red status, data nodes, pending cluster tasks and shard states such as unassigned or relocating.

Indexing and search

Completed index, search, fetch, refresh and merge operations per node and the time spent on them.

Thread pools

Queued and rejected tasks per thread pool, the clearest sign that a node is overloaded.

JVM

Heap usage, garbage collection counts and time per node.

Disk and storage

Available disk space per node and the size of shards and indices.

Caches

Query and field data cache memory and evictions.

The Elasticsearch signals that matter

Obseria collects these values automatically and shows them in ready-made dashboards and alerts.

MetricUnitWhat it tells you
elasticsearch.cluster.health{status}Cluster health status (green, yellow, red); anything other than green deserves attention.
elasticsearch.cluster.shards{shards}Shards by state; unassigned shards mean missing replicas or lost data on a node.
elasticsearch.cluster.pending_tasks{tasks}Cluster-level changes waiting for the master; a growing queue slows mapping and index updates.
elasticsearch.cluster.data_nodes{nodes}Number of data nodes in the cluster, to notice a node that left.
elasticsearch.node.operations.completed{operations}Completed operations per type (index, query, fetch, refresh, merge), the throughput signal.
elasticsearch.node.operations.timemsTime spent per operation type; divided by the count it gives average latency.
elasticsearch.node.thread_pool.tasks.queued{tasks}Tasks waiting in each thread pool; long queues come before rejections.
elasticsearch.node.thread_pool.tasks.finished{tasks}Finished tasks per thread pool by state, including rejected requests.
elasticsearch.node.fs.disk.availableByFree disk space per node; low values trigger the disk watermarks and block shard allocation.
jvm.memory.heap.usedByJVM heap in use per node; persistently high heap leads to long GC pauses.

Set up Elasticsearch monitoring in minutes

  1. 1

    Create a monitoring user

    Create a role with the cluster and index monitor privilege and a user such as otel that holds it.

  2. 2

    Add the receiver

    Add the elasticsearch receiver to the OpenTelemetry Collector or Obseria Agent with the cluster endpoint and the user's password from an environment variable.

  3. 3

    Send to Obseria

    Export the metrics via otlphttp to your Obseria OTLP endpoint; nodes and cluster health appear in the database view.

Example configuration · YAML
receivers:
  elasticsearch:
    endpoint: http://elasticsearch:9200
    username: otel
    password: ${env:ELASTIC_PASSWORD}
    collection_interval: 30s
exporters:
  otlphttp:
    endpoint: ${env:OBSERIA_OTLP_ENDPOINT}
    headers:
      Authorization: "Bearer ${env:OBSERIA_TOKEN}"
service:
  pipelines:
    metrics:
      receivers: [elasticsearch]
      exporters: [otlphttp]

Why Elasticsearch monitoring matters

Elasticsearch powers product search, log analytics and many internal tools. It is a distributed system on the JVM: data is split into shards across nodes, every node runs thread pools for indexing and search, and memory is shared between the heap and the filesystem cache. Problems rarely start as an outage. They begin with a yellow cluster, a node close to its disk watermark or a search thread pool that starts queueing. Elasticsearch monitoring catches these early signals and tells you which node and which operation is affected.

The OpenTelemetry Collector provides the elasticsearch receiver, which reads the node stats and cluster health APIs with a read-only user. It reports metrics such as elasticsearch.cluster.health and elasticsearch.node.operations.time, so Elasticsearch cluster monitoring works with open standards and without a plugin inside the cluster.

Signals that matter for Elasticsearch performance monitoring

  • Cluster health and shards: elasticsearch.cluster.health, elasticsearch.cluster.shards by state and elasticsearch.cluster.data_nodes show whether every shard has a home and every replica is assigned.
  • Throughput and latency: elasticsearch.node.operations.completed and elasticsearch.node.operations.time per operation type give indexing and search rates and their average time.
  • Saturation: elasticsearch.node.thread_pool.tasks.queued and rejected tasks in elasticsearch.node.thread_pool.tasks.finished show when a node cannot keep up with writes or queries.
  • JVM: jvm.memory.heap.used and GC time per node explain latency spikes that are not caused by the query itself.
  • Disk: elasticsearch.node.fs.disk.available warns before the watermarks stop shard allocation or make indices read-only.

Common Elasticsearch problems and how to detect them

Yellow or red cluster

A yellow cluster has unassigned replicas, a red one has unassigned primaries and missing data. Shard states together with the number of data nodes show whether a node left or allocation is blocked.

Disk watermarks

When a node crosses the high disk watermark, Elasticsearch moves shards away; at the flood stage it blocks writes. Alerting on free disk per node gives you time to add capacity or delete old indices.

Thread pool rejections

Bulk indexing bursts or expensive queries fill the write or search queue. Rejected tasks surface in the application as failed requests, often long before CPU looks critical.

Heap pressure and long GC pauses

Large aggregations, many shards per node or oversized field data push the heap up. Long collections pause the node and slow every query it serves.

Too many small shards

Daily indices with several shards each can create thousands of small shards. Each one costs heap and cluster state updates, which shows up as pending cluster tasks and slow master operations.

Best practices for Elasticsearch cluster monitoring

  1. Use a dedicated user with only the monitor privilege for the receiver.
  2. Collect metrics from one endpoint per cluster; the receiver reads node stats for all nodes it can reach.
  3. Alert on health not green, on thread pool rejections and on free disk per node.
  4. Watch heap usage and GC time together; one without the other is easy to misread.
  5. Instrument the applications that query Elasticsearch with OpenTelemetry, so slow searches appear as client spans in their traces.

How Obseria helps with Elasticsearch monitoring

Obseria receives Elasticsearch metrics over OTLP from the OpenTelemetry Collector or the Obseria Agent and shows them next to host metrics and application traces. TopoGraph connects the cluster to the services that query it. When search gets slow, Obseria Intelligence checks node health, rejections, heap and disk and presents the root cause with its chain of evidence. Dashboards, alerts and SLOs are included.

Because the receiver uses only the monitoring APIs, you can roll it out to production clusters without changing their configuration. Start with cluster health, thread pool rejections and free disk per node, then add search and indexing latency to your service dashboards so the teams that depend on Elasticsearch see the same picture as the team that runs it.

Learn more

Elasticsearch monitoring FAQ

A role with the monitor cluster privilege and the monitor index privilege is enough. The receiver only reads statistics and cannot change data or settings.

The elasticsearch receiver is built for Elasticsearch. OpenSearch shares many APIs, but responses differ in places, so test the receiver against your OpenSearch version before relying on it.

No. The receiver reads the REST API over HTTP or HTTPS. You only create a monitoring user; no plugin or agent runs inside Elasticsearch.

Yes. OpenTelemetry instrumentation for Java, Python, Node.js and other languages creates client spans for Elasticsearch calls. Obseria shows them in the trace next to the node metrics.

Yes. Logs from Fluentd, Fluent Bit or the OpenTelemetry Collector can be sent to Obseria over OTLP, where they are correlated with traces and metrics.

Start monitoring Elasticsearch today

Connect Elasticsearch in minutes with OpenTelemetry or the Obseria Agent. Free for 14 days.