Elasticsearch doesn't speak Prometheus. It exposes its internals over its own REST API — GET /_nodes/stats, /_cluster/health, /_cat/indices — as JSON, in Elastic's own shape. Prometheus can't scrape that.
The elasticsearch-exporter is a small sidecar-or-Deployment-shaped translator that sits between the two:
- it polls those ES REST endpoints on an interval,
- flattens the JSON into Prometheus text-format metrics,
- and serves them on /metrics (conventionally :9114) for Prometheus to scrape.
The canonical implementation is prometheus-community/elasticsearch_exporter (formerly justwatchcom/elasticsearch_exporter), packaged as the prometheus-elasticsearch-exporter Helm chart. Elastic also ships a first-party alternative path — Metricbeat's elasticsearch module, or the newer Elastic Agent integration — but those ship into Elasticsearch/Kibana's own monitoring cluster, not into Prometheus, so they don't help a Grafana-alerting-on-Prometheus setup.
The metrics it produces are for example:
- metric
- what it gives you
- search_jvm_memory_used_bytes{area="heap"}
- actual JVM heap in use — the thing that actually predicts an ES OOM
- elasticsearch_jvm_memory_max_bytes{area="heap"}
- configured heap ceiling (-Xmx), so you can take a real ratio
- elasticsearch_jvm_gc_collection_seconds_*
- GC pressure; sustained old-gen GC is the pre-OOM tell
- elasticsearch_breakers_tripped
- circuit breakers firing — ES rejecting work to avoid OOM
- elasticsearch_cluster_health_status
- green/yellow/red, unassigned shards │
The exporter is a separate deployable — ECK does not install it.

No comments:
Post a Comment