Skip to content

Alert expression variables

An alert rule’s expression is expr-lang evaluated against one service’s rollup for the current window. These are the values it can read — the names below are exactly what the evaluator binds, because both this page and the evaluator come from the same struct.

VariableTypeMeans
error_ratenumberErrors as a proportion of requests over the evaluation window, from 0 to 1.
error_rate_deltanumberChange in error rate against the baseline, as a proportion.
health_scorenumberA composite 0-100 score combining errors, latency and traffic. Convenient for a single catch-all rule; too coarse to explain why it moved.
log_countnumberLog records recorded for the service over the window.
p50numberMedian request latency in milliseconds.
p95number95th-percentile request latency in milliseconds. The usual latency signal: it moves when a meaningful share of requests slow down, where the median does not.
p95_deltanumberChange in p95 latency against the baseline, in milliseconds.
servicestringThe service name being evaluated, as a string. Compare it when one rule needs to behave differently for one service.
throughputnumberRequests per second. Worth pairing with any rate threshold — a service handling two requests a minute reaches a 50% error rate on one failure.
throughput_deltanumberChange in throughput against the baseline, in requests per second. Negative when traffic drops, which is how a rule catches a service that has stopped receiving requests rather than started failing them.
z_scorenumberHow far the service’s current behaviour sits from its own recent baseline, in standard deviations. Use it to catch a service that has changed without committing to an absolute threshold that fits every service.

See Set up alerts for the rule model these sit in, including the pending/firing/resolved lifecycle and webhook delivery.