Loading

Troubleshoot rule behavior with the rule query inspector

The rule query inspector gives you direct visibility into the Elasticsearch queries that your rules run. When a rule fires unexpectedly, stays silent, or runs slowly, use the inspector to see exactly what query ran and what data it returned.

The inspector is available from two places: the rule details page and the alert details page. From the rule details page, you can find out how the rule is configured now. From the alert details page, you can find out how the rule was configured when a specific alert was generated. If you've modified a rule, the two views may show different queries.

Currently, the rule query inspector is only available for custom threshold rules.

  • Rule details page: Open Stack Management > Rules, find your rule, and click its name to open its details page. Click Rule query inspector. The inspector builds the query from the rule's current parameters. Use this view to verify that the rule is configured correctly and would match the data you expect.

  • Alert details page: Go to the Alerts page, then open an individual alert. Click Rule query inspector. The inspector uses the rule parameters as they existed when that specific alert was generated, including the exact evaluation time range. Use this view to understand why a particular alert was triggered.

The inspector displays the Elasticsearch query made by the rule, the most recent raw response the rule received, and how long the query took to run.

Element Description
Criterion dropdown Appears when a rule has multiple criteria. Each entry is labeled with its criterion number and metric (for example, Criterion 1: avg(system.cpu.total.norm.pct)). Selecting a criterion updates both the Request and Response tabs to show the query and results for that specific condition.
Request Shows the full Elasticsearch query that the rule sends when it evaluates your data. Use it to verify the index pattern, time range, query filter, and aggregations match what you configured in the rule.
Response Shows the raw Elasticsearch response. Use it to confirm whether data was found, whether the groups you expect are present, and what values the rule was working with when it made its alerting decision.
Request time Shows how long Elasticsearch took to execute the query. This measures the query portion of rule execution only. It doesn't include time spent waiting in the task queue or processing actions after the query returns. Use it to identify whether the query itself is the bottleneck when a rule is slow.

Expand the following to learn how the inspector can help.