5.02L Create alert rule - MartinWong06/grafana GitHub Wiki

  1. Navigate to the dashboard where you want to create an alert rule.

  2. Click on the bell icon on the top-right corner of the screen.

  3. Select "Notification channels" to create a notification channel (e.g., email, Slack, PagerDuty, etc.) to receive alerts.

  4. After creating the notification channel, click on "Create rule".

  5. In the "Rule" tab, give a name to your rule and select the data source from which you want to generate alerts.

  6. Define the condition for the alert, e.g., "If the CPU usage is above 90% for the last 5 minutes".

  7. Select the evaluation time and the frequency at which you want to check for the condition.

  8. In the "Notifications" tab, select the notification channel you created earlier to receive alerts.

  9. Click on "Save rule" to save the alert rule.

    Here is a sample alert rule query:

    sum(rate(http_requests_total{status="500"}[5m])) by (job) > 10

    This alert rule will trigger an alert if the rate of HTTP requests with a status code of 500 is greater than 10 per second, grouped by job, over the last 5 minutes.

⚠️ **GitHub.com Fallback** ⚠️