Logs, metrics and errors
Alert rules
Checks alert you when an endpoint fails. Alert rules do the same for your own telemetry: a metric crossing a line, a burst of log lines, or a new error. They send to the same alert channels your checks use.
Each kind of rule needs its feature preview on: Metrics, Logs or Errors.
Kinds of rule
Metric rules
A MetricsQL query, evaluated as it is now, compared with a threshold. Each series the query returns is watched on its own, so sum by (service_name) (…) alerts per service.
sum by (service_name) (rate(http_server_request_duration_seconds_count{http_response_status_code=~"5.."}[5m])) > 1$__interval, $__rate_interval and $__range work here; dashboard variables don't.
Log rules
A count of log lines matching a LogsQL filter over a window, from 1 minute to 24 hours, compared with a threshold. Group by up to three fields to alert per service or per host. Filters only: no pipes, Pingwright adds the count.
For example: more than 50 lines matching level:error in 5 minutes, grouped by service.name.
Issue rules
Watch your error issues for one of three things:
- New issue: an issue was seen for the first time.
- Regressed: a resolved issue happened again.
- Event rate: an issue had at least a number of events within a window.
Narrow them by source (your SDKs or your checks), project, environment, level, or check.
Conditions
| Setting | What it does |
|---|---|
| Comparison | >, ≥, <, ≤, = or ≠ the threshold. |
| For | How long the condition must hold before the rule fires, up to 24 h. Until then it's pending. |
| No data | When the query returns nothing: resolve (the default), keep the current state, or alert. |
| Evaluate every | 1 minute (the default) to 1 hour. |
| Remind | Repeat while firing, every 15 minutes to once a day, or never. |
| Severity | Critical (the default), warning or info. Sent to PagerDuty as its severity. |
| Notify on resolve | Tell the channels when it's over. On by default. |
| Channels | 1 to 10 of your alert channels. |
A metric or log rule moves from OK to pending to firing and back. New-issue and regressed rules fire once per issue and never resolve; event-rate rules fire and resolve like metric rules.
Try it before saving
Preview a rule against current data to see which groups would fire, before it can wake anyone. Your agent can do the same with preview_alert_rule over MCP.
Limits
Up to 100 rules per organization, and up to 100 groups per rule.