Build an alert with the Code mode
You just built an alert in Builder mode. Code mode follows the same rule flow. The difference is how you write the query: you type PromQL instead of picking the metric and operations from menus in the UI.
Start in Builder when you’re learning. Switch to Code when you need more control than Builder can express clearly.
Path
This Path walks you through writing the alert query in PromQL, then creating a silence to suppress notifications during maintenance.
First alert rule with query language
Build a Grafana alert rule in Code mode — write a PromQL error-rate query, set a condition, add labels, configure evaluation and notifications, and save.
Open in Grafana Cloud
Complete this learning path directly in your Grafana Cloud stack with an interactive learning experience.