Kibana: Best Practices

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Checked on 2026-11-09 against Kibana 9.5.x.

The earlier Kibana pages explain each feature. This page is the opinionated summary of how to use them so that the Bookshelf alerts stay quiet unless something is wrong, the dashboards open in a couple of seconds, and the cluster that hosts both keeps up. It has three parts: rule design, dashboard performance and a table of advice that old books and blog posts still give. The tool-neutral version of the alerting advice (symptoms over causes, every alert actionable, runbooks) is on Designing Actionable Alerts; the Grafana counterpart of this page is Grafana: Best Practices.

Rule design

Check interval against time window

Every Classic rule has a check interval, how often Kibana evaluates it, and most rule types also have a time window (also called look-back), how much data each evaluation reads. Checks are queued and run "as close to the defined value as capacity allows", so the interval is a target, not a guarantee. The two numbers answer different questions: the interval bounds how quickly you notice, the window bounds how much evidence one evaluation sees.

Let be the interval and the window. If , part of the time axis is never read, and a short incident that falls between two evaluations goes unseen. If is much larger than , consecutive evaluations overlap almost entirely, a brief spike keeps a ratio high long after it ended, and each run reads more data. A workable default is between one and five times . The worst-case time to notice a sustained breach is then roughly

where is the number of consecutive breaches you require (the alert delay) and covers task queueing and the connector call. For the lab’s 5xx ratio rule, with minute, minutes and , the answer is about two minutes plus dispatch, which fits a page you want within five minutes. Do not push below the cluster’s minimum: xpack.alerting.rules.minimumScheduleInterval.value defaults to, and is recommended at, one minute, and minimumScheduleInterval.enforce set to true blocks rules that go lower.

Group-by cardinality

A rule that groups its data produces one alert per group, and every alert can produce an action. Each action is its own Task Manager task, so the number of tasks grows with the number of alerts times the number of actions. The production page gives the extreme: 100,000 alerts with one e-mail action each schedule 100,000 actions in a single run.

  • Group by a bounded dimension: service.name, an environment, a route template. Never group by a raw URL path, a user id or a trace id.

  • Keep the total number of alert groups small enough that a bad hour does not page a hundred times; summary actions (next section) turn many groups into one message.

  • Bound the damage with xpack.alerting.rules.run.actions.max (actions per rule run, with connectorTypeOverrides per connector type, for example .email).

Summary actions and frequency

An action either runs per alert or sends a summary of alerts. Per-alert actions run on each check, only when the status changes, or at a custom interval, and need an action group. Summary actions report new, ongoing and recovered alerts, on each check interval or a custom one. A custom interval cannot be shorter than the rule’s check interval. The documentation’s own example is a CPU rule that e-mails every check interval; a five-minute custom interval reduces that, and On status changes limits notifications to once per threshold crossing.

For Bookshelf: use a per-alert action with On status changes for the five lab alerts so a recovery notification is sent as well; use a summary action on any rule grouped by a dimension with more than a handful of values. The webhook connector posts to http://webhook-receiver:8080/kibana in both cases. Action frequency and variables are on Actions, Frequency & Action Variables.

Alert delay, flapping and maintenance windows

Three mechanisms keep a noisy signal from paging. Alert delay requires consecutive runs in breach before an alert becomes active (alert_delay.active in the Classic rules API and in the Terraform resource; Universal Alerting has its own alert and recovery delays). Flapping detection is on by default: you set a look-back window and a threshold of status changes, such as six changes in the last ten runs, and an alert that changes status that often is treated as flapping. It can be configured per rule (9.3 and later) or globally under Rules then Settings; in 9.0 to 9.2 only the global setting exists. Maintenance windows, generally available since 9.2, suppress notifications while alerts are still created, for example during a Bookshelf deployment.

Capacity: how many rules can you afford

Rules and actions run as Task Manager tasks. By default each Kibana instance polls every 500 ms and runs up to 10 tasks at once. A rule is one recurring task; an action is one non-recurring task. The load of the recurring part, in tasks per minute, is

with in minutes. Forty rules at one minute cost 40 tasks per minute; the same forty at five minutes cost 8. The hard cap is xpack.alerting.rules.maxScheduledPerMinute, default 32000 (the page’s examples are 400 rules at one minute or 2,000 at five); a rule that would exceed it cannot be created or edited. A run is also bounded by xpack.alerting.rules.run.timeout (default five minutes, with per rule type overrides), and with xpack.alerting.cancelAlertsOnRuleTimeout at its default of true the alerts and actions of a cancelled run are discarded, so a slow query that times out produces silence, not a partial alert. Long runs also block the Kibana event loop.

Practical rules that follow: disable rules nobody reads (the documentation says this reduces cluster load, and snoozing does not, since snoozed rules keep running); give expensive rules longer intervals; scale Kibana instances for throughput; and watch Task Manager health, as described in Stack Monitoring & AutoOps. The alert and action history sits in the event log (.kibana-event-log-* data streams, 90 days by default; technical preview), so shortening retention shortens the history that the alerting pages can show.

Ownership, spaces and tags

A rule runs with an API key that captures the privileges of whoever last saved it. If a person who leaves the company owns the Bookshelf rules, the rules stop working when that user is disabled or loses access. Create rules as a service user with the role of the bookshelf-sre team, in the bookshelf space, tag them bookshelf and the service, and keep them in version control as code (Alerting APIs & Terraform). Self-managed Kibana also needs xpack.encryptedSavedObjects.encryptionKey of at least 32 characters and server.publicBaseUrl for links in notifications; the setup is in Alerting Setup, Security & Scaling.

Triage of a rule that misbehaves

flowchart TD S["Rule did not fire, or fired late"] --> Q1{"Did the rule run? Rule details, event log"} Q1 -->|"no, or late"| TM["Task Manager health: status, runAt, retryAt"] Q1 -->|"yes"| Q2{"Did the query return rows? Rule query inspector, Discover"} Q2 -->|"no"| DATA["Data view, field names, permissions, time window"] Q2 -->|"yes"| Q3{"Was the notification sent? Action frequency, snooze, maintenance window"} Q3 -->|"no"| ACT["Connector test, connector task, event log errors"] Q3 -->|"yes"| RCV["Webhook receiver log"]

The relevant documented tools are the rule details page (active alerts and how long each has been active), the Test connector UI and the _execute API, the rule query inspector (9.5 and later), the Kibana log entries tagged [alerting] and [actions], and, for a rule that does not run, its scheduled_task_id and the .kibana_task_manager index (status, runAt, retryAt). As a last resort on a degraded cluster, xpack.task_manager.capacity and xpack.task_manager.poll_interval can lower the load, but that throttles all background tasks and should follow snoozing or disabling slow rules.

Dashboard performance

A dashboard issues one or more Elasticsearch requests per panel, each time the dashboard loads or refreshes. The levers are fewer and cheaper panels, less data per panel, and not loading panels nobody has opened.

Fewer panels, loaded later

  • Sections: collapsible sections defer loading: only the content from expanded sections loads. Put the golden-signal row of "Bookshelf service health" first and expanded, and the dependencies and detail tables in collapsed sections.

  • Above the fold: aim for 8 to 12 panels in the first screen, so the key information shows first.

  • Limits: a dashboard can hold up to 1,000 top-level items (panels, unpinned controls and sections), up to 1,000 panels per section and up to 100 pinned controls; through the Dashboards API panels, sections and pinned controls together cannot exceed 1,000. A dashboard that nears these numbers is a report, not a dashboard.

Cheaper panels in Lens

  • Sampling (Preview on the Stack): in a layer’s settings, lower the sampling percentage to load faster at the cost of accuracy; use it on large data sets, never on a panel that feeds a threshold decision.

  • Time series: Normalize by unit loads faster by averaging each interval; Customize time interval keeps finer buckets and loads slower.

  • Formulas are computationally intensive; prefer a simple aggregation, or compute the ratio once in an ES|QL panel.

  • Runtime fields suit small computations; for hot paths, map the value at ingest.

  • Colour mapping on a field with many distinct terms costs performance.

  • Use the Inspector to see the requests a visualization sends.

Source: Lens.

ES|QL fast mode

For ES|QL panels and Discover, Fast mode is the Kibana control for ES|QL approximation: STATS queries run on a sample and the results are extrapolated. It is Preview on the Stack since 9.5 (and on Serverless), and on self-managed, Cloud Hosted, ECE and ECK it requires an Enterprise subscription. SET approximation=true; enables it for one query, takes precedence over the toggle, and SET approximation=false; forces exact results. Elasticsearch approximates only when it speeds the query up; functions such as COUNT_DISTINCT, MIN, MAX and LAST always run exactly; results can vary between runs and low-frequency groups can disappear; approximate columns come with a confidence interval and a certified flag. In Discover it applies only to queries with exactly one STATS command. Use it for exploratory, wide time ranges; do not use it to compute the numbers behind an SLO or an alert threshold.

Data and time range

The cheapest panel reads less data. Keep the default time range short (the last 15 minutes or hour for an operations dashboard), read downsampled or rolled-up data for long ranges (see Data Streams, TSDS & Lifecycle), and do not refresh faster than data arrives. A dashboard that takes ten seconds to load is also a signal about the data model, not only about the panels.

Outdated advice from older material

Books, blog posts and Stack Overflow answers from the Kibana 4 to 8 era are still the top search results. The table lists the advice that has changed, with the current replacement and where this section covers it.

Older material says Current guidance Details

Create an index pattern

They are data views. Saved searches are now Discover sessions, which can be dashboard panels since 9.4. Scripted fields can no longer be created since 9.0; use runtime fields or ES|QL.

Data Views & Discover

Build charts with the aggregation-based editors or TSVB

Lens is the default editor. The aggregation-based and TSVB editors are legacy, listed under "Legacy" and unavailable on Serverless; they appear in the Add menu only if already used on the dashboard.

Lens, Legacy Editors, Canvas & Graph

Use Timelion for time series

Timelion is not among the editors offered on the Visualize page. Use Lens, or an ES|QL query with BUCKET or the TS command.

ES|QL Visualizations & Variable Controls

Alert with Watcher

Use Kibana rules (Classic, or Universal where available). Watcher stays for scripted, chained-input logic on the Stack and is unavailable on Serverless.

Universal Alerting & Watcher

Install a Beat on every host, with Logstash in the middle

Elastic Agent largely replaces the individual Beats, OpenTelemetry (EDOT) is the default host and application path, and the EDOT Collector is part of Elastic Agent since 9.5. Logstash is for complex pipelines.

Ingesting Monitoring Data

Use the Uptime app

Uptime is deprecated since 8.15 and unavailable on Serverless; use Synthetics monitoring.

APM & Synthetics

Use the metric threshold rule and Metrics Explorer

For new rules prefer the custom threshold rule: it adds KQL filters on aggregations (since 9.4), a warning threshold (since 9.5), and is available on Serverless, which the metric threshold rule is not. The 9.5 deprecation list has no entry for the metric threshold rule, so check the Observability release notes of your version before treating it as removed. Metrics Explorer is deprecated from 9.4; use the metrics grid of Discover (TS metrics-*).

Observability Rules

Open Logs Explorer or the Logs Stream app

Both were removed in 9.0; use Discover.

Data Views & Discover

Call /api/alerts/* or use removed xpack.actions and xpack.alerting settings

The /api/alerts endpoints were removed in 9.0; use /api/alerting/rule and /api/alerting/rules. Deprecated alerting settings were removed too, and ephemeral tasks no longer exist. The API and settings still say "actions" for what the UI calls connectors.

Alerting APIs & Terraform

Use the OpenAI, Bedrock, Gemini or Inference connectors for AI features

Those connector types are deprecated in 9.5; they keep working with deprecation badges. Use Elasticsearch inference endpoints for new integrations.

Connectors

Install X-Pack, Shield or Marvel

Security and monitoring are built in: use the built-in security features, roles and spaces, and Stack Monitoring or AutoOps.

Spaces, Roles & Privileges, Stack Monitoring & AutoOps

Run Curator to delete old indices

Use index lifecycle management or, on Serverless, data stream lifecycle, with data streams.

Data Streams, TSDS & Lifecycle

Pre-flight checklist for the Bookshelf lab

  • The space is bookshelf, the rules are owned by a service user with the bookshelf-sre role and tagged bookshelf.

  • The five alerts exist with a webhook connector to http://webhook-receiver:8080/kibana: 5xx ratio above 0.05 over five minutes, p95 latency above 0.5 s, no data, error-log spike, SLO burn rate; each has a runbook link and the dashboard link in its message.

  • Intervals are at least the cluster minimum, windows are one to five intervals, groups are bounded, and an On status changes action or a summary action is used.

  • The dashboard has its golden-signal row first and expanded, the dependencies row collapsed, and no panel uses sampling or fast mode for a threshold.

  • Task Manager health and Stack Monitoring are in place (see the Stack Monitoring page), and the missing-data rule goes to a channel other than the cluster rules.

  • server.publicBaseUrl and the encryption keys are set, and no page of the section relies on a feature labelled Planned for the Stack.

Verify it in the lab

  1. List the rules of the space with the API and check owner and tags: GET /s/bookshelf/api/alerting/rules/_find?per_page=50 (for example with curl -u as the lab user). Every Bookshelf rule must carry the bookshelf tag, and created_by must be the service user.

  2. Open the rule details of the 5xx ratio rule and confirm interval 1 minute, window 5 minutes and the On status changes frequency. Open the rule query inspector (9.5 and later) and check that the query returns rows when the load generator runs in failing-request mode.

  3. Create a rule grouped by url.path on purpose and note the number of alerts it produces under load; replace the group with service.name and compare. Delete the experiment afterwards.

  4. Query GET /api/task_manager/_health before and after the experiment and compare the runtime status.

  5. Add a sixth, collapsed section with the heaviest panel to "Bookshelf service health", reload with the browser network tab open, and check that the panel’s request starts only after the section is expanded.

In the books

Chhajed, Learning ELK Stack, chapter 9, covers running the stack in production (data-loss prevention, security with Shield, Curator for index management, monitoring with Marvel) and Shah, Kibana 8.x, covers dashboards and Watcher; the practices are sound for their time but the products they name have been replaced, which is what the outdated advice table records. Neither book covers rule capacity, Task Manager, alert delay, summary actions or Lens sampling and ES|QL fast mode. Publisher pages are listed in the bibliography of the section index.