docs/sources/datasources/opentsdb/alerting/index.md
You can use Grafana Alerting with OpenTSDB to create alerts based on your time series data. This allows you to monitor metrics, detect anomalies, and receive notifications when specific conditions are met.
For general information about Grafana Alerting, refer to Grafana Alerting.
Before creating alerts with OpenTSDB, ensure you have:
OpenTSDB alerting works with standard metric queries that return time series data. The following table summarizes alerting compatibility:
| Query type | Alerting support | Notes |
|---|---|---|
| Metrics with aggregation | Yes | Recommended for alerting |
| Metrics with downsampling | Yes | Use appropriate intervals |
| Metrics with rate calculation | Yes | Useful for counter metrics |
| Metrics with filters/tags | Yes | Filter to specific hosts or services |
To create an alert rule using OpenTSDB:
avg, sum, max).For detailed instructions, refer to Create a Grafana-managed alert rule.
The following examples show common alerting scenarios with OpenTSDB.
Monitor CPU usage and alert when it exceeds 90%:
| Field | Value |
|---|---|
| Metric | sys.cpu.user |
| Aggregator | avg |
| Tags | host=* |
| Downsample Interval | 1m |
| Downsample Aggregator | avg |
Condition: When average is above 90
Monitor available disk space and alert when it drops below a threshold:
| Field | Value |
|---|---|
| Metric | sys.disk.free |
| Aggregator | min |
| Tags | host=*, mount=/ |
| Downsample Interval | 5m |
| Downsample Aggregator | min |
Condition: When minimum is below 10737418240 (10 GB in bytes)
Monitor network bytes received and alert on high traffic:
| Field | Value |
|---|---|
| Metric | net.bytes.received |
| Aggregator | sum |
| Tags | host=webserver01 |
| Rate | enabled |
| Counter | enabled |
| Downsample Interval | 1m |
| Downsample Aggregator | avg |
Condition: When sum is above 104857600 (100 MB/s in bytes)
Monitor application error counts:
| Field | Value |
|---|---|
| Metric | app.errors.count |
| Aggregator | sum |
| Tags | service=api, env=production |
| Downsample Interval | 5m |
| Downsample Aggregator | sum |
Condition: When sum is above 100
When using OpenTSDB with Grafana Alerting, be aware of the following limitations.
Alert queries can't contain template variables. Grafana evaluates alert rules on the backend without dashboard context, so variables like $hostname or $environment aren't resolved.
If your dashboard query uses template variables, create a separate query for alerting with hard-coded values.
Complex queries with many tags or long time ranges may timeout or fail to evaluate. Simplify queries for alerting by:
When using OpenTSDB 2.4 with alerting, Grafana executes queries with the parameter arrays=true. This causes OpenTSDB to return data points as an array of arrays instead of a map of key-value pairs. Grafana automatically converts this data to the appropriate format.
Follow these best practices when creating OpenTSDB alerts: