Middle
How to implement in Grafana an alert that sends an email notification if responses take more than one second?
sobes.tech AI
Answer from AI
To set up an alert in Grafana for response delays over 1 second and send notifications via email, you need to:
- Create a panel with a metric measuring response time (for example, using Prometheus and the metric
http_request_duration_seconds). - In the Alerting section, create a new alert rule with a condition such as:
WHEN avg() OF query(A, 5m, now) > 1
where query(A) is a query returning the response time.
- Configure a notification channel with the Email type and specify recipient addresses.
- Link this channel to the alert rule.
After that, if the average response time over the last 5 minutes exceeds 1 second, Grafana will send an email to the specified address.