Amazon Aurora alerting
You can use the Amazon Aurora data source to create Grafana alert rules that evaluate SQL queries and trigger notifications when conditions are met. This lets you monitor your Aurora data for anomalies, thresholds, or specific conditions without manually watching dashboards.
For general information about Grafana alerting, refer to Grafana Alerting.
Before you begin
- Configure the Amazon Aurora data source.
- Verify that your database user has read access to the tables referenced in alert queries.
- Familiarize yourself with Grafana alert rules.
Create an alert rule
To create an alert rule using an Aurora query:
- Click Alerting in the left-side menu. In Grafana Cloud, it’s under Alerts & IRM.
- Click Alert rules.
- Click New alert rule.
- Enter a name for the alert rule.
- Select your Amazon Aurora data source.
- Write an SQL query that returns numeric data.
- Define the alert condition using expressions. For example, reduce the query result to a single value and set a threshold.
- Configure labels, notifications, and other alert settings.
- Click Save rule and exit.
Alert query requirements
Alert queries must meet the following requirements:
- The query must return at least one numeric column. Grafana evaluates numeric values against the alert condition.
- Use the
$__timeFiltermacro to restrict results to the evaluation time window. - Keep queries efficient. Alert rules evaluate at regular intervals, and slow queries can delay alert evaluation.
- Don’t use template variables in alert queries. Grafana Alerting doesn’t support template variable interpolation. Use hard-coded values instead.
Example threshold alert
The following query returns the average temperature over the evaluation window:
select avg(temperature) as avg_temperature
from weather_readings
where $__timeFilter(recorded_at)Apply a threshold condition in the expression builder, for example to fire when avg_temperature exceeds 35.
Example alert per group
To receive a separate alert instance per category, include a grouping column and set Format data frames as to Table. Grafana treats string columns as labels, so each city becomes its own alert instance:
select city, avg(temperature) as avg_temperature
from weather_readings
where $__timeFilter(recorded_at)
group by cityExample data freshness alert
To alert when a table stops receiving data, count recent rows and fire when the count drops to zero:
select count(*) as reading_count
from weather_readings
where $__timeFilter(recorded_at)Set the condition to fire when reading_count is below 1.
Considerations
Keep the following in mind when using Aurora queries in alert rules:
- Database load: Each alert evaluation runs a query directly against your cluster. Set evaluation intervals that balance responsiveness with database load, and consider pointing the data source at the reader endpoint so evaluations don’t affect your writer instance.
- Authentication token refresh: RDS authentication tokens expire after 15 minutes. When a token expires, the plugin generates a new one and retries the query once, which can occasionally add latency to an evaluation.
- Permissions: The database user configured in the data source must have read access to all tables and schemas referenced in alert queries.


