/betterstack:chart-alertsfrom Better Stack
Guides creating and managing Better Stack chart alerts for metrics and logs. Covers threshold, relative, and anomaly alert types with configuration parameters.
Ships in Better Stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Chart alerts monitor metrics and logs queries and trigger incidents when conditions are met. They are attached to charts on dashboards or explorations.
chart_alert_help has the server's current reference.
Two-tier thresholds: a chart alert holds a single
value. To reproduce a Datadog warning + critical monitor, create two alerts on the same chart (one per threshold).
| Type | Use Case | Key Parameters |
|---|---|---|
threshold | Known fixed limit exceeded (disk > 90%, error rate > 5%) | value, operator |
relative | Change in % vs. the past, when the user asks for one | value, operator, query_period |
anomaly_rrcf | Unusual patterns (ML-based), with a floor by default (below) | shown_interval, anomaly_sensitivity, anomaly_trigger |
Unless the user asks otherwise, every alert fires only on something both bad and unusual:
threshold, since it is bad at the same level every day.threshold; for a
drop, lower_than a value under the quietest normal hour. An anomaly or relative alert learns a
sustained change as the new normal and resolves within about an hour while the outage goes on.anomaly_rrcf with a floor.| Operator | Description | Alert Types |
|---|---|---|
higher_than | Value exceeds threshold | threshold, relative |
lower_than | Value below threshold | threshold, relative |
higher_than_or_equal | Value >= threshold | threshold, relative |
lower_than_or_equal | Value <= threshold | threshold, relative |
equal | Value equals threshold | threshold, relative |
not_equal | Value differs from threshold | threshold |
increases_by | Value increases by X% | relative only |
decreases_by | Value decreases by X% | relative only |
changes_by | Value changes by X% (either direction) | relative only |
Only certain chart types support alerts:
| Chart Type | Requirements |
|---|---|
line_chart | Must be timeseries, query must have {{time}} |
bar_chart | Must be timeseries, query must have {{time}} |
table_chart | No additional requirements |
tail_chart | No additional requirements |
A number_chart keeps the alerts it already has but takes no new one.
Prefer line charts on dashboards for alerts - they provide the best visibility into metric trends and make it easy to correlate alerts with visual data.
Critical: The value is compared with the raw numbers the chart query returns, not with what the chart displays.
| Chart | Example Query | Alert Value for "85%" |
|---|---|---|
unit: "percent" | sumIf(logs_count, label('level') = 'error') / sum(logs_count) | 0.85 |
Data already 0-100, without the percent unit | avg(cpu_percent) | 85 |
A percent chart holds 0-1 ratios and multiplies them by 100 for display, so it shows 0.85 as 85% while its alert value stays 0.85. The exception is a stack_to_100 bar chart: it sets percent itself but its query returns raw values, so its thresholds are raw values too. A relative alert's value stays a percentage change either way (50 means 50%).
Before creating an alert, check the chart's unit and actual values using dashboard_chart.
How long the condition must persist before triggering an alert, in seconds, from 0 to 86400.
How long the condition must be resolved before the incident is closed, in seconds, or null = no auto-recovery.
on_missing_data is what a threshold or relative alert does when its chart returns no data: dont_fire
(default), treat_as_zero, treat_as_previous, or start_incident. Use start_incident on throughput and
outcome charts (requests, orders completed): when that data stops, the service is down, and dont_fire
would resolve any open incident and stay quiet. On a sparse chart (a few orders an hour), empty buckets
in quiet hours open incidents too: widen aggregation_interval there, or keep dont_fire. Anomaly
alerts take it from the chart and refuse it.
How far back to look for comparison, in seconds.
| Parameter | Range | Description |
|---|---|---|
anomaly_sensitivity | 1-10 | Counter to its name: HIGHER = fewer alerts, LOWER = more sensitive (default: 5). Shown as Significance in the sidebar |
anomaly_trigger | any, higher, lower | Which anomalies to alert on |
shown_interval | seconds | Aggregation interval; the training window spans ~10× this (default: 10800 = 3h) |
Don't guess a significance or a threshold: query the chart's data over the past days first (dashboard_chart, then query) and say how often the condition would have been met.
additional_conditions ANDs up to 4 more conditions onto the alert's own: it fires only when every
condition breaches in the same time bucket, on any of the series it covers, not necessarily the same
one. On a grouped chart, an unscoped floor is met by whichever series crosses it. Each is {alert_type, operator, value, series_names, series_names_except}, threshold or relative only (anomaly detection can be the alert's own type,
not an extra condition), and each may scope its own series.
Give every anomaly alert a floor by default. On its own an anomaly alert fires on anything
unusual, including harmless shifts: after a node replacement, CPU moving to 21% or a p95 of 76 ms is
unusual but fine. A threshold condition such as "and CPU > 80" or "and p95 > 500 ms" keeps it to what
is both unusual and bad. Pick the floor from the chart's real values (dashboard_chart), the way you would a
threshold alert's value.
On update_alert the list replaces the alert's conditions as a whole: omit it to keep them,
pass [] to remove them. The alert tool returns them in additional_conditions.
Check a floor the way you would a threshold: query the chart's data over the past days (dashboard_chart, then query) and count how often it crosses the floor. The alert fires at most where the metric is both unusual and past the floor.
metadata tags the alert, e.g. {severity: "critical", owner: ["payments"]}: each value a string or
a list of strings. The incidents the alert opens carry them. On update_alert it replaces the
alert's metadata as a whole; {} removes it.
Monitor specific series or all:
[] = monitor all series["production", "staging"] = only these seriesescalation_target routes the incident. An alert that routes to an escalation policy doesn't use its own email, push, sms or call flags: the policy notifies.
| Value | Description |
|---|---|
current_team | Default on-call for the team |
{policy_id: "123"} | A specific escalation policy (from escalation_policies) |
{policy_name: "Infra"} | The same, by the policy's name |
{team_id: "t123"} | A specific team's default on-call |
To match a Datadog monitor's notification routing, call escalation_policies and pass the closest policy's ID as {policy_id: "<id>"}.
| Channel | Default | Use Case |
|---|---|---|
email | false | Pass email: true |
push | false | Mobile notifications |
sms | false | Urgent issues |
call | false | Critical outages |
Unless the user asks otherwise, call, SMS and a critical severity are for customer impact only. An
alert that the chart's history shows firing at the same time every day (a batch job, a backup, a deploy) is a
known event: raise its threshold or floor above it.
Find or create the chart (dashboard / create_dashboard_chart); an error or latency chart is grouped by endpoint or error type, and on a low-traffic service it counts errors → verify it supports alerts and check its value range (dashboard_chart, then query over a few days) → choose the alert type → create_alert → tell the user how often each alert's conditions were met over the past week (query).
dashboard_id: "456"
chart_id: "123"
name: "Disk almost full"
alert_type: "threshold"
operator: "higher_than"
value: 0.90 # On a `percent` chart (0-1 data shown as 90%); 90 only if the query returns 0-100
check_period: 60
confirmation_period: 60
dashboard_id: "456"
chart_id: "123"
name: "Orders stopped"
alert_type: "threshold"
operator: "lower_than"
value: 5 # Orders per minute, under the quietest normal hour
check_period: 60
confirmation_period: 600
dashboard_id: "456"
chart_id: "123"
name: "CPU unusually high"
alert_type: "anomaly_rrcf"
anomaly_sensitivity: 5
shown_interval: 10800
anomaly_trigger: "higher"
additional_conditions: [{ alert_type: "threshold", operator: "higher_than", value: 0.8 }] # 80 only if the query returns 0-100
metadata: { severity: "warning" }
For anomaly alerts the direction comes from anomaly_trigger (any = both directions), not from operator/value (threshold parameters).
| Mistake | Correct Approach |
|---|---|
| Using relative operators with threshold | increases_by only works with relative type |
value: 85 for 85% on a percent chart | Its data is 0-1: use 0.85 (the chart and alert show it as 85%) |
| Guessing at a significance or threshold | Query the chart's history first, then quote how often it would fire |
| No confirmation period for noisy metrics | Add 60-300s to prevent flapping |
| Alerting on all series when only some matter | Specify series_names array |
| Anomaly alert with no floor | Add a threshold in additional_conditions |
| Action | Tool |
|---|---|
| List all alerts | alerts |
| Get alert details | the alert tool |
| Create | create_alert |
| Edit configuration | update_alert |
| Pause | update_alert with paused: true |
| Unpause | update_alert with paused: false |
| Delete | remove_alert |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub betterstackhq/claude-plugin --plugin betterstack17 skills in this plugin
/chart-generationComplete reference for chart types, units, and settings on Better Stack dashboards. Load right before creating charts - after the queries are built with the query skills./chart-stylingBetter Stack chart styling and advanced settings reference - series colors and order, number chart coloring thresholds, heatmap color categories, gauge bounds, y-axis tuning, custom units, and the per-key settings table with cross-setting gotchas. Load when configuring how a chart looks beyond defaults, or when unsure which settings key applies to a chart type./collector-queriesProven metrics queries for Better Stack Collector sources (the source tool's Platform "Collector") - per-host node_* metrics, per-container and per-service container_resources_*, requests and errors by destination, TCP health, and the container-level saturation checks that host averages hide. Load after metrics-query when the source platform is Collector, for health checks, resource questions and service dashboards.Other plugins' skills for the same job