Use Pulsar Realtime Trigger to push events into MySQL
Stream Apache Pulsar messages straight into MySQL in real time, one row per event.
Find missing InfluxDB hourly rollups, approve oldest-first repairs from retained raw data and verify means and sample counts after each write.
A failed hourly downsampler can leave a dashboard gap that becomes permanent once raw retention expires. Recomputing from an already truncated source would replace that gap with a misleading aggregate. This flow repairs only settled windows whose entire scan interval remains inside retention, using the existing rollup convention: one host tag, numeric mean and integer samples fields at the UTC window start.
| Guard | What it stops |
|---|---|
| Exact host, measurement and field; restricted names; distinct buckets | Writes to unrelated series or the raw bucket |
| Bucket ids and retention rechecked; Write uses the approved bucket ID | Repairing a recreated bucket or aggregating a window that may have expired |
| One hour of retention margin and configurable settling delay | Using retention-edge data or racing a normal recent aggregation |
| At most 168 hourly windows and 10,000 selected raw samples | An unbounded historical rebuild |
| Unexpected tags, off-hour target points and conflicting completed aggregates fail | Merging different series or overwriting unexplained rollups |
| Both mode switches, approval and confirmation that writers are stopped | An unattended repair without acknowledged writer quiescence |
| Exact raw sample and target-field snapshot rechecked per window | Applying an approval after source values or rollups changed |
| Point read after each write and final gap query | Reporting success while a selected rollup remains incomplete |
InfluxDB has no conditional point write. Stop the normal downsampler and late-arrival writes for this host before approving, then keep them stopped until the execution terminates. The flow queues its own executions; it does not lock another flow, administrator or InfluxDB task. A recheck narrows the race but cannot replace that operating procedure.
bounds (io.kestra.plugin.influxdb.FluxQuery) fixes UTC hourly bounds and records both bucket identities. detect runs the aggregation and comparison in InfluxDB, returning missing or short windows in oldest-first order. A completed rollup must match both the source count and mean; a zero mean is valid.report lists each gap with its window timestamp, sample count and proposed mean. Default executions report and finish without changing data. The disabled Schedule forces these safe inputs.approval (io.kestra.plugin.core.flow.Pause) waits up to 20 minutes. approved_repair requires onResume.approved ?? false and writers_quiesced: true.repair_oldest_first (io.kestra.plugin.core.flow.Loop, concurrency limit 1) runs recheck_window immediately before write_rollup (io.kestra.plugin.influxdb.Write). It compares every raw timestamp/value plus the two target fields with the approved snapshot. Writes use the captured bucket ID, reuse the window timestamp and update only mean and samples.read_written_window checks the repaired point. verify_all_windows repeats the full gap query and require_continuity fails if any raw-backed window is incomplete. alert_failure posts to Slack on a failure, including permission refusal and stale approval.Data platform operators maintaining an InfluxDB 2.x hourly mean/count rollup with shorter raw retention.
InfluxDB can aggregate and backfill its own data. Kestra coordinates the incident response: bounded discovery, human approval, stale-plan refusal, ordered plugin writes and a failed execution with an alert if recovery cannot be proved.
Kestra 2.0.6, bundled InfluxDB plugin 1.5.7 and InfluxDB OSS 2.7.12. Validation returned no constraints, warnings, infos or deprecations. Independent influx query --raw reads bracketed the saved execution cases. The fixture used 72-hour raw retention and 30-day rollup retention, with two missing windows and one short rollup.
Approved repair changed incomplete windows from 3 to 0, complete windows from 2 to 5 and represented raw samples from 7 to 15. All 23 raw points were conserved. Other hosts, similarly named measurements, a legitimate zero mean, rollup annotations and windows at or after the settling cutoff were preserved. Interruption after the first write left two gaps; the next execution repaired those two. The fresh fixture repeated healthy, repair and stale-approval cases with read permissions on both buckets and write permission only on the rollup bucket. Slack used an HTTP test sink. Bucket recreation and a stopped server during approval failed before Write; the concurrent second execution queued. All 24 invalid identifier requests (quotes, Unicode, spaces and 65-character names across six inputs) were rejected before execution. Target-tag, negative/excess count, mean-tolerance and 168-window boundary cases also passed.
| Case | Execution | Result |
|---|---|---|
| Healthy, including a zero mean | 7l382QyB7w6vQpzMIKJMG7 |
SUCCESS |
| Missing and short, dry run | 3YDLnANNYeW9C7bMXJw5Eq |
SUCCESS |
| Declined approval | 6iO0kyBuyuCAsT9XvCHoKB |
SUCCESS |
| Approved repair | 6w3WQwluNlXoxlrkmH4Jdy |
SUCCESS: 3 incomplete windows to 0 |
| Repeat | 2ClBBintYrDpVj0ypD94o8 |
SUCCESS |
| Write refused with HTTP 403 | 7kpldok0uwHsigUr6NEtZk |
FAILED as intended, no rollup write |
| Raw value changed during approval | 44SMa1VySuzfKZrKB7bMvl |
FAILED as intended, no rollup write |
| Killed after first write | 6vGBX8eAA89zPW3yKtW2XA |
KILLED: first write retained |
| Reconcile interrupted repair | 2pxMLbi89yMLH76KiiU3cP |
SUCCESS: 2 incomplete windows to 0 |
| Retention shortened during approval | 7Jd2HpEHGzpJCgvDfOcRL9 |
FAILED as intended, no rollup write |
| Additional raw tag dimension | 1kurF4nmghAvwlz8j52zOl |
FAILED as intended, no rollup write |
| Conflicting completed mean | 6lPC4VQGMjt2RAdxeLuG9b |
FAILED as intended, no rollup write |
| Off-hour rollup timestamp | 6SDbKBVFMgHrSl8XPtARyO |
FAILED as intended, no rollup write |
| Writers not confirmed stopped | 1egjF7xCZmMm4dTpcbMH8s |
FAILED as intended, no rollup write |
| auto_remediate true, dry_run true | 33JfD0rYowf5HRv2dd2YQg |
SUCCESS |
| auto_remediate false, dry_run false | Jq4Gc9uebjYhAQRXVlqPZ |
SUCCESS |
| No matching raw series | 3LaqeYa4pHcHyPMumxPCcx |
SUCCESS |
| Already completed window preserved | 7IqmLAzjwWOsib1r1oCfMH |
SUCCESS |
| Exactly 10,000 selected raw samples | 4jyuBRSKwWnEd4jxDUNZdL |
SUCCESS |
| 10,001 selected raw samples | 6X3XOnZ7hXbA9cwPzkStsn |
FAILED as intended, no rollup write |
| Raw and rollup bucket identical | 13Fi7otqd5pkYqTP5tRcBh |
FAILED as intended, no rollup write |
| Bucket recreated during approval | 3GV7nSBwDUkdHR2dNWONFe |
FAILED as intended, no rollup write |
| Second execution queued | 1gr48XL1FDNx38mkfUBgjR |
SUCCESS |
| Rollup count exceeds source | 58pPcDIYTlMegqlyWrkWIQ |
FAILED as intended, no rollup write |
| 168 selected hourly windows | 66rxV6omHU17e6fwrapvzu |
SUCCESS |
| Mean just inside tolerance | 2cPYuMjEDBeDvaBAlEVE6P |
SUCCESS |
| Mean just outside tolerance | 3sBka44O6nUTypDk2XdhkC |
FAILED as intended, no rollup write |
| Negative rollup count | 1ZhPb9aFzRxD7RdYmMZLI3 |
FAILED as intended, no rollup write |
| Server stopped during approval | 6oIt1pwOOvjDYiBBo5Rm7 |
FAILED as intended, no rollup write |
| Unavailable endpoint | 2Xb8ehncaRa3OGPOYEM4vc |
FAILED as intended, no rollup write |
| Additional target tag dimension | 7SBCMRgj6nshTfhLEYR6cY |
FAILED as intended, no rollup write |
| Fresh fixture: healthy, including a zero mean | qbafmQbLMi80gwruAwB4v |
SUCCESS as expected |
| Fresh fixture: approved repair | 76p41FznQIhftMhter4VjK |
SUCCESS as expected |
| Fresh fixture: raw value changed during approval | AqTzOJzD6ax1O9ghNc2nb |
FAILED as expected |
host tag and a rollup measurement using the convention above. Extra rollup fields are preserved. This flow does not adapt an arbitrary downsampling schema.INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_TOKEN: server URL, organization and scoped token. The token input has type SECRET.SLACK_WEBHOOK_URL: failure notification destination.| Input | Default | Purpose |
|---|---|---|
influxdb_url, influxdb_org, influxdb_token |
Corresponding secrets | Connection and scoped credentials |
raw_bucket, rollup_bucket |
raw, rollup |
Distinct source and destination buckets |
measurement, raw_field |
cpu, usage |
Exact raw measurement and numeric field |
rollup_measurement, host |
cpu_hourly, server-a |
Exact rollup measurement and host |
lookback_hours |
48 |
1 to 168 settled hourly windows |
settling_hours |
2 |
1 to 24 hours excluded before the current UTC hour |
dry_run, auto_remediate |
true, false |
Writes require false and true respectively |
slack_webhook_url |
SLACK_WEBHOOK_URL secret |
Failure alert endpoint |
Names start with an ASCII letter and contain at most 64 letters, digits, underscores, dots or hyphens. Choose the lookback and settling delay comfortably inside both retention periods, allowing the extra hour of margin. For example, the defaults fit the tested 72-hour raw bucket. Queries have a 20-second read timeout and tasks a 30-second timeout; writes have no automatic retry.
report. Compare a proposed window with a direct Flux query before enabling repair.auto_remediate: true and dry_run: false.approved: true and writers_quiesced: true. A declined approval preserves the gaps.io.kestra.plugin.influxdb.FluxTrigger polling an independently configured gap query. Configure connection, organization and query at trigger level; polling triggers have no execution inputs. Keep the flow's discovery and approval rechecks. This path was schema-checked but not executed.Limits: recovery covers windows still represented in retained raw data. It cannot identify a completely expired or entirely absent raw window, prove that upstream ingestion was complete or recreate the full dashboard. It assumes writers remain quiescent during repair. Mean comparisons use a relative tolerance of 1e-9 * (1 + abs(expected)). InfluxDB 3, multiple tag dimensions, other window sizes and the polling-trigger extension were not tested. Snapshot values appear in execution outputs; restrict access to execution history.
This blueprint was created by zkasuran.