| name | greptimedb-trigger |
| description | [Enterprise only] Guide for creating GreptimeDB Triggers — periodic evaluation rules (SQL or TQL/PromQL via TQL EVAL) that fire Alertmanager-compatible webhooks when conditions are met. Use as an alternative to Prometheus alerting rules, or to host existing PromQL alerts on GreptimeDB. Triggers on phrases like "create trigger", "alerting rule", "告警规则", "trigger webhook", "alertmanager 对接", "migrate prometheus alerts", "promql alert". |
GreptimeDB Trigger Guide
Enterprise only. Triggers are available only in GreptimeDB Enterprise.
For open-source deployments, fall back to Prometheus Alertmanager or an
external scheduler.
Create GreptimeDB trigger definition as an alternative to Prometheus alerting
rules. A trigger periodically runs a query — a SQL SELECT or a TQL EVAL
block wrapping a PromQL expression — and turns each result row into an alert
instance. Most concepts from Prometheus alerting rules map directly onto
trigger DDL, and existing PromQL rules can be hosted as-is through TQL EVAL.
The workflow
To create a GreptimeDB trigger, we should follow these phases:
Phase 1. Understanding GreptimeDB Trigger
First, we should read the trigger reference from the documentation.
There are pages available, use WebFetch to load and understand them:
- High-level overview and a worked example
https://docs.greptime.com/enterprise/trigger/
- Full trigger syntax reference
https://docs.greptime.com/reference/sql/trigger-syntax/
Phase 2. Syntax essentials
The ON clause accepts either:
- a plain SQL
SELECT (typical for GreptimeDB-native queries), or
- a
TQL EVAL expression that embeds a PromQL-style query — this is
the migration path for users porting Prometheus alerting rules.