Skip to main content
Bob’s team opens Kibana each morning and inspects application logs in Discover. One weekend the stack behaves subtly wrong — nothing becomes red, no pod crashes — but the logs stop appearing. Example log timeline:
Late on Saturday, Elasticsearch begins to run short of memory. Fluentd continues shipping log lines from every node, and Elasticsearch takes progressively longer to accept them. By Sunday it is barely ingesting anything. The cluster still looks healthy in the UI. On Monday, a teammate asks Bob: why does Discover show nothing since Saturday? Because all log messages and errors must travel through Fluentd into the same Elasticsearch instance that is failing. That’s like a smoke alarm wired to the same fuse as the fire. Bob needs a separate, independent signal that watches the stack from the outside.
Relying solely on logs that flow into the same system that can fail is risky. Always use an independent telemetry path so you can detect and alert on failures that prevent logs from being ingested.
The solution is metrics: single numeric measurements taken repeatedly over time.
  • Each measurement answers a single question: How much memory is Elasticsearch using right now? How much memory does it have?
  • Ask those questions every N seconds; each answer is a timestamped number.
  • Plot those numbers over time to see trends and detect problems early.
A dark-themed dashboard slide titled "One Number, Over and Over" featuring the Elasticsearch logo. To the right are a vertical memory usage bar labeled "Used" and "Total" and a small line chart titled "Memory used" showing a slight upward trend.
What asks Elasticsearch those questions? Elasticsearch knows its own memory use but does not publish it in the plain-text format most monitoring systems expect. We run a small helper next to it called an exporter.
  • An exporter queries the application and exposes metrics as a plain-text HTTP page (one metric per line).
  • Common exporter ports are in the 9000s (for example, :9114).
Example exporter output:
Fluentd, Kibana, and many other components can be instrumented or have exporters available. We’ll start with Elasticsearch because it is the component that can bring the whole stack down. Now there is a page of numbers. Who collects them? Prometheus. Prometheus periodically visits configured pages, copies every numeric metric it finds, and stores the time series. Visiting a page and copying its numbers is called scraping; each page is a target. Different targets can be scraped at different intervals depending on how often you need fresh data.
A diagram titled "Scraping Targets" showing Prometheus in the center scraping two target endpoints labeled localhost:9114 and localhost:9090. The collected metrics are sent to a History storage cylinder on the right.
Prometheus collects thousands of numeric measurements. Humans can’t read thousands of numbers at a glance — they need a visual shape.
A dark-themed slide titled "Too Many Numbers" with a large circular badge in the center reading "5,000 numbers." Small icons labeled "Prometheus" (left) and "Bob" (right) sit on either side.
Grafana reads metrics from Prometheus and renders each metric as a line on a panel. Elasticsearch memory becomes a line that climbs during the day and drops at night. Multiple panels arranged together form a dashboard. A dashboard helps, but only when someone is watching it.
A dark-themed dashboard titled "Nobody Was Looking" with three small charts — "Elasticsearch memory" (bell curve), "Active shards" (flat line), and "Lines in" (rising zigzag) — and a circular user avatar labeled "Bob" on the right.
Prometheus supports alerting rules so the system can tap Bob on the shoulder automatically. An alert rule is a condition that Prometheus evaluates on its rule-evaluation schedule. Example condition:
  • If Elasticsearch heap usage (used ÷ max) remains above 90% for more than five minutes, raise an alert.
Why wait five minutes? Short spikes are often normal; the for window avoids flapping and prevents alerts for transient bumps. While the expression is true but the for period hasn’t elapsed, the alert is in a pending state; once the time completes, it becomes firing.
A monitoring dashboard showing a "Pending, Then Firing" Prometheus alert for heap usage (used ÷ total) exceeding 90% for 5 minutes. The line chart shows memory usage crossing the 90% threshold with a shaded area marking the firing period.
A typical Prometheus alerting rule in YAML:
Prometheus evaluates rules on its configured evaluation interval (commonly the same as the scrape interval). When the expression has been true for the configured for period, the alert transitions from pending to firing. Prometheus itself does not send notifications to people. Alert delivery is handled by a separate program: Alertmanager.
  • Alertmanager receives firing alerts from Prometheus.
  • It groups and deduplicates alerts, applies routing and silences, and forwards them to receivers (Slack, email, PagerDuty, webhooks, etc.).
Picture the end-to-end path:
  1. Exporter queries Elasticsearch and exposes metrics on an HTTP endpoint.
  2. Prometheus scrapes that endpoint and stores the time series.
  3. Grafana visualizes metrics from Prometheus as dashboards.
  4. Prometheus evaluates alerting rules against metrics.
  5. Alertmanager routes firing alerts to the configured receivers and notifies Bob.
Summary table — components and responsibilities:
Design alerts to be simple and actionable: focus on one symptom per rule, use sensible thresholds and for durations to reduce noise, and route alerts to the right team or escalation path.
Two questions remain to complete the picture for Bob:
  • Where do these programs (exporters, Prometheus, Grafana, Alertmanager) run in the cluster?
  • What does it look like the first time an alert fires and lands in front of a human?
The answers depend on your environment and operational model, but the architecture described here — exporters → Prometheus → Grafana (visualization) and Alertmanager (delivery) — gives you an independent, observable path to detect and notify on failures that would otherwise be invisible in the logs. For implementation details and configuration examples, see:

Watch Video