Schedule icon
Query icon
Return icon
Switch icon
SlackIncomingWebhook icon
If icon
Loop icon
Log icon

GreptimeDB Continuous Aggregation Flow & Pipeline Sentinel

Audit GreptimeDB continuous aggregation flow tasks, alert Slack on unassigned flownodes, and safely trigger table flushes for streaming time-series.

Categories
Data

GreptimeDB is an open-source, cloud-native distributed time-series database designed for metrics, logs, and events. Its native Flow engine powers continuous aggregation pipelines, computing real-time downsampling, rolling averages, and windowed analytics as data streams into the cluster. In production deployments, node migrations, network partitions, or compute node failures can leave continuous aggregation flows in an orphan state with no active flownode IDs assigned. When a flow loses its compute workers, real-time downsampling halts, sink tables stop receiving fresh aggregates, and operational dashboards present stale metrics without throwing query-level errors. This blueprint provides an automated sentinel that continuously audits information_schema.flows, verifies flownode allocations, routes incident alerts to Slack, and triggers guarded table flushes when enabled.

How it works

  1. Scheduled trigger (every_fifteen_minutes) initiates diagnostic flow verification every 15 minutes, with manual execution supported via flow inputs.
  2. Diagnostic probe (probe_flows) connects to the GreptimeDB MySQL wire protocol interface (port 4002) via io.kestra.plugin.jdbc.mysql.Query and queries information_schema.flows.
  3. Classification step (classify_flow_health) parses the flow metadata using Pebble conditionals, grouping the cluster status into HEALTHY, WARNING, CRITICAL, or PROBE_FAILED.
  4. Flow router (route_by_flow_status) switches downstream execution paths according to the classified health state.
  5. On CRITICAL state, alert_critical_slack dispatches an incident notification to the configured Slack channel with affected flow names and sink tables.
  6. Guarded remediation (check_remediation) checks whether auto_flush is enabled and dry_run is disabled. If confirmed, flush_sink_tables iterates over affected destination tables and executes ADMIN flush_table('sink_table') to write buffered memtables to physical SST storage.
  7. On PROBE_FAILED or network errors, dedicated alerts notify administrators of database interface reachability failure or invalid credentials.
  8. Audit log task (log_audit_summary) outputs a structured record documenting evaluated flow counts, status, and execution lineage.

What you get

  • Automated continuous surveillance of streaming continuous aggregation flows across all GreptimeDB catalogs.
  • Rapid detection of orphan flows lacking compute flownode assignments before metric freshness SLAs breach.
  • Actionable incident notifications dispatched to Slack detailing affected flow names and destination sink tables.
  • Guarded administrative table flush capability that forces persistence of buffered time-series states during degradation.
  • Zero-credential-leak architecture keeping database usernames and passwords masked in execution logs and UI traces.

Who it's for

  • Platform Engineers and SREs operating production GreptimeDB clusters for metrics and observability.
  • Real-Time Analytics Teams managing continuous aggregation, downsampling, and rolling window computations.
  • Database Administrators overseeing time-series storage health and LSM-tree persistence.

Why orchestrate this with Kestra

  • Declarative YAML definition unifies streaming pipeline monitoring, conditional health routing, and remediation into version-controlled GitOps workflows.
  • Native MySQL JDBC plugin connectivity eliminates custom Python worker container dependencies and credentials leakage.
  • Built-in conditional routing and looping isolate discovery, dry-run safety gates, and administrative maintenance calls without external monitoring agents.
  • Immutable execution timelines in Kestra provide historical verification evidence for pipeline reliability audits.
  • Cloud-native scheduling and flow-level error-trapping ensure continuous sentinel operation independent of external cron infrastructure.

Prerequisites

  • GreptimeDB instance (v0.8+) running with MySQL wire compatibility enabled (default port 4002).
  • Database user with read permissions on information_schema.flows and administrative privileges for ADMIN flush_table.
  • Slack incoming webhook URL for operational notification delivery.

Secrets

  • GREPTIMEDB_USERNAME: Username for authenticating to the GreptimeDB MySQL wire protocol port.
  • GREPTIMEDB_PASSWORD: Password for the GreptimeDB database user.
  • SLACK_WEBHOOK_URL: HTTPS incoming webhook URL for the target Slack channel.

Quick start

  1. Configure GREPTIMEDB_USERNAME, GREPTIMEDB_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  2. Deploy this flow to your Kestra instance and execute an initial manual run with dry_run: true to confirm connectivity against your GreptimeDB server.
  3. Review the execution logs in the Kestra UI to verify flow metadata from information_schema.flows is parsed successfully.
  4. Enable the every_fifteen_minutes schedule trigger to establish automated continuous surveillance.

How to extend

  • Add Prometheus exporter checks via io.kestra.plugin.prometheus to correlate flow stalls with Datanode write latency and disk I/O.
  • Integrate PagerDuty alerting via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert for high-priority production metric pipeline halts.
  • Attach downstream compaction checks using ADMIN compact_table for high-throughput time-series tables with deep LSM levels.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.