This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.

Grafana Cloud Enterprise Open source

OpenTSDB alerting

You can use Grafana Cloud to avoid installing, maintaining, and scaling your own instance of Grafana. Create a free account to get started, which includes free forever access to 10k metrics, 50GB logs, 50GB traces, 500VUh k6 testing & more.

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 you begin

Before creating alerts with OpenTSDB, ensure you have:

  • An OpenTSDB data source configured in Grafana. Refer to Configure the OpenTSDB data source.
  • Appropriate permissions to create alert rules.
  • Understanding of the metrics you want to monitor.

Supported features

OpenTSDB alerting works with standard metric queries that return time series data. The following table summarizes alerting compatibility:

Query typeAlerting supportNotes
Metrics with aggregationYesRecommended for alerting
Metrics with downsamplingYesUse appropriate intervals
Metrics with rate calculationYesUseful for counter metrics
Metrics with filters/tagsYesFilter to specific hosts or services

Create an alert rule

To create an alert rule using OpenTSDB:

  1. Navigate to Alerting > Alert rules.
  2. Click New alert rule.
  3. Enter a name for the alert rule.
  4. Select your OpenTSDB data source.
  5. Build your query:
    • Select the metric to monitor.
    • Choose an appropriate aggregator (for example, avg, sum, max).
    • Add tag filters to target specific resources.
    • Enable downsampling with an interval matching your evaluation frequency.
  6. Configure the alert condition (for example, when the value is above a threshold).
  7. Set the evaluation interval and pending period.
  8. Configure notifications and labels.
  9. Click Save rule.

For detailed instructions, refer to Create a Grafana-managed alert rule.

Example alert queries

The following examples show common alerting scenarios with OpenTSDB.

Alert on high CPU usage

Monitor CPU usage and alert when it exceeds 90%:

FieldValue
Metricsys.cpu.user
Aggregatoravg
Tagshost=*
Downsample Interval1m
Downsample Aggregatoravg

Condition: When average is above 90

Alert on low disk space

Monitor available disk space and alert when it drops below a threshold:

FieldValue
Metricsys.disk.free
Aggregatormin
Tagshost=*, mount=/
Downsample Interval5m
Downsample Aggregatormin

Condition: When minimum is below 10737418240 (10 GB in bytes)

Alert on high network traffic rate

Monitor network bytes received and alert on high traffic:

FieldValue
Metricnet.bytes.received
Aggregatorsum
Tagshost=webserver01
Rateenabled
Counterenabled
Downsample Interval1m
Downsample Aggregatoravg

Condition: When sum is above 104857600 (100 MB/s in bytes)

Alert on error count spike

Monitor application error counts:

FieldValue
Metricapp.errors.count
Aggregatorsum
Tagsservice=api, env=production
Downsample Interval5m
Downsample Aggregatorsum

Condition: When sum is above 100

Limitations

When using OpenTSDB with Grafana Alerting, be aware of the following limitations.

Template variables not supported

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.

Query complexity

Complex queries with many tags or long time ranges may timeout or fail to evaluate. Simplify queries for alerting by:

  • Using specific tag filters instead of wildcards where possible.
  • Enabling downsampling with appropriate intervals.
  • Reducing the evaluation time range.

OpenTSDB 2.4 behavior

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.

Best practices

Follow these best practices when creating OpenTSDB alerts:

  • Use specific tag filters: Add tag filters to focus on relevant resources and improve query performance.
  • Match downsample interval to evaluation: Set the downsample interval to match or be slightly smaller than your alert evaluation interval.
  • Test queries first: Verify your query returns expected results in Explore before creating an alert.
  • Set realistic thresholds: Base alert thresholds on historical data patterns to avoid false positives.
  • Use meaningful names: Give alert rules descriptive names that indicate what they monitor.
  • Enable downsampling: Always enable downsampling for alerting queries to reduce data volume and improve reliability.
  • Consider counter resets: For counter metrics, enable the Counter option and set appropriate max values to handle resets correctly.

Next steps