Alerting
The Dynatrace data source supports Grafana Alerting, allowing you to create alert rules based on Dynatrace metrics, problems, and other data. You can monitor your Dynatrace environment and receive notifications when specific conditions are met.
Before you begin
- Ensure you have the appropriate permissions to create alert rules in Grafana.
- Verify your Dynatrace data source is configured and working correctly.
- Familiarize yourself with Grafana Alerting concepts.
Supported query types for alerting
The following Dynatrace query types work well with Grafana Alerting:
Note
Alert queries must return numeric data that Grafana can evaluate against a threshold. Queries that return only text or non-numeric data cannot be used directly for alerting.
Create an alert rule
To create an alert rule using Dynatrace data:
- Go to Alerting > Alert rules.
- Click New alert rule.
- Enter a name for your alert rule.
- In the Define query and alert condition section:
- Select your Dynatrace data source.
- Configure your query (for example, a Metrics query for CPU usage).
- Add a Reduce expression if your query returns multiple series.
- Add a Threshold expression to define the alert condition.
- Configure the Set evaluation behavior:
- Select or create a folder and evaluation group.
- Set the evaluation interval (how often the alert is checked).
- Set the pending period (how long the condition must be true before firing).
- Add labels and annotations to provide context for notifications.
- Click Save rule.
For detailed instructions, refer to Create a Grafana-managed alert rule.
Example: CPU usage alert
This example creates an alert that fires when CPU usage exceeds 80%:
- Create a new alert rule.
- Configure the query:
- Query type: Metrics
- Metric:
builtin:host.cpu.usage - Aggregation:
avg
- Add expressions:
- Reduce: Last value (to get the most recent data point)
- Threshold: Is above 80
- Set evaluation to run every 1 minute with a 5-minute pending period.
- Save the rule.
Example: Problem count alert
This example alerts when new problems are detected:
- Create a new alert rule.
- Configure the query:
- Query type: Problems or Problems V2
- Status: OPEN
- Add expressions:
- Reduce: Count (to get the number of open problems)
- Threshold: Is above 0
- Set evaluation to run every 5 minutes.
- Save the rule.
Best practices
Follow these recommendations to create reliable and efficient alerts with Dynatrace data.
Use appropriate query intervals
- Set the alert evaluation interval to be greater than or equal to the minimum data resolution from Dynatrace.
- Avoid very short intervals (less than 1 minute) as they may cause evaluation timeouts.
Reduce multiple series
When your Dynatrace query returns multiple time series (for example, CPU usage per host), use the Reduce expression to aggregate them:
- Last: Use the most recent value
- Mean: Average across all series
- Max/Min: Use the highest or lowest value
- Sum: Total across all series
Handle no data conditions
Configure what happens when no data is returned:
- In the alert rule, find Configure no data and error handling.
- Choose an appropriate action:
- No Data: Keep the alert in its current state
- Alerting: Treat no data as an alert condition
- OK: Treat no data as a healthy state
Test queries before alerting
Always verify your query returns expected data before creating an alert:
- Go to Explore.
- Select your Dynatrace data source.
- Run the query you plan to use for alerting.
- Confirm the data format and values are correct.
Troubleshooting
For common alerting issues with the Dynatrace data source, refer to Alerting issues in the troubleshooting guide.



