theme | background | title | info | class | drawings | transition | mdc | overviewSnapshots | |
---|---|---|---|---|---|---|---|---|---|
seriph |
Introduction to Grafana alerting |
## Slidev Starter Template
Presentation slides for developers.
Learn more at [Sli.dev](https://sli.dev)
|
text-center |
|
slide-left |
true |
true |
A Short Introduction
Press Space for next page
- Automatically run queries on an interval
- Define rule to determine whether alerts should be generated
- Use policies to route alerts to appropriate contact point
- Use templates to format the alert message
- Can be created from existing Panel
Edit -> Alert -> New alert rule - Have a time range and min interval
- Adjust these based on how you want your alert to behave
- Set range only as big as needed
- Click
Preview
to show query results
Each time series generated by queries becomes an alert instance
- One alert rule can monitor conditions for multiple time series independently!
- Choose appropriate
GROUP BY
s to make alert more or less selective
- Apply some processing to time series/previous expression result
- Reduce: Apply function to time series, e.g. max, mean, last
- Might need to choose different
Mode
- Might need to choose different
- Threshold: Compare result to value/range
- Math: Perform arbitrary calculation on expression(s)
$B > 70
$A - $B
- again: applied to each time series
- extremely powerful!
- not super well documented
- Folder (for tidiness)
- Evaluation group
- Decides evaluation interval
- Pending period
- Delays firing of alert rule
- Only makes sense if larger than evaluation interval
- No Data handling
- If query returns no data at all, what should happen?
- Summary and Description
- Can use templating:
- Evaluated per alert instance
- Access labels:
{{ index $labels "labelName" }}
- Determined by query groupBy
- Access values:
{{ index $values "A" }}
- Can generate more understandable and actionable message
CPU usage for {{ index $labels "instance" }} has exceeded 80% ({{ index $values "A" }}) for the last 5 minutes.
- Manually add labels
- Severity of alert, (sub)team, …
- Used to route alerts
- Match on labels
- Specify contact point
- Configure mute timings
- Other timing options
- e.g. Slack channel
- Also configure which message and title templates should be used!
- Different teams can use different message template
-
Use go template syntax
-
Generate message based on list of alerts
-
Can access labels, annotations and values
- Including the summary definitely makes sense
-
Can include links to the linked panel, dashboard, alert rule or for generating a silence
-
Slack flavoured markup is really annoying…