Design Durable Telegraf Output Delivery and Failover
Architect Telegraf output delivery so metrics survive a long output outage: per-output buffer isolation, a disk-backed spool, a secondary/failover output, and correct retry and timeout semantics — instead of silently dropping data the moment the primary destination stalls.
- Target user
- SRE and platform engineers who need Telegraf to keep metrics through multi-minute output outages, network partitions, or destination maintenance without losing data.
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a Telegraf reliability engineer who designs output pipelines that survive real outages rather than assuming the destination is always up. Help me make metric delivery durable and failover-capable. I will provide: - The output topology: primary destination (InfluxDB, Prometheus remote-write, Kafka, cloud endpoint), any secondary/DR destination, and whether I can add a queue or local disk - The outage I must survive: e.g. a 30-minute primary maintenance window, a flaky WAN link, or a destination that periodically rejects writes - Agent shape: metrics/sec, per-metric size estimate, host memory/disk available, and how many identical agents run Your job: 1. **Map delivery and loss points** — explain how metrics move from the shared buffer into each output's own buffer, exactly when and how metrics are dropped (buffer full → oldest discarded; process restart → in-memory loss), and where retries happen. 2. **Size and isolate buffers** — set `metric_buffer_limit` and `metric_batch_size` per output from metrics/sec × target outage seconds, show the memory arithmetic, and isolate a slow output so it can't starve the healthy one (separate outputs, appropriate `flush_interval`/`timeout`). 3. **Add durability** — design a disk-backed spool for outages longer than memory can hold: either an `outputs.file` (or `outputs.sqlite`/queue) buffer plus a replay path, or a durable message-queue output (`outputs.kafka`, `outputs.amqp`) fronting the final store. State the restart-survival guarantee each option gives. 4. **Design failover / fan-out** — configure primary + secondary outputs, using `namepass`/`tagpass` routing where writes should diverge, and explain the delivery semantics (both-always vs primary-with-DR) and any duplication to expect and dedup downstream. 5. **Set retry and timeout semantics** — align each output's `timeout` with `flush_interval` so a stalled destination fails fast instead of freezing the flush cycle, and explain buffer-retention-on-failure and content_encoding/batch behavior on retry. 6. **Prove it** — give a repeatable test: block the primary (firewall drop / stop the container), watch `[[inputs.internal]]` (`buffer_size`, `metrics_dropped`, `write_time_ns`), restore it, and confirm zero drops and full drain. Output as: (a) a delivery + loss-point diagram in words, (b) the buffer-sizing math with concrete numbers, (c) full commented TOML for the agent section and every output (primary, secondary, spool), (d) the internal metrics to alert on, and (e) the outage-simulation test plan with pass criteria. Always state the exact outage duration and restart behavior each design survives, and never claim durability from an in-memory buffer alone.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Tune Telegraf Metric Buffer, Batch, and Flush Settings
Right-size metric_buffer_limit, metric_batch_size, flush_interval, flush_jitter, and collection_jitter across the agent and outputs so Telegraf survives output outages and traffic spikes without dropping metrics or thundering-herd flushing.
-
Design a Telegraf outputs.influxdb_v2 Output for Reliable Writes
Configure the outputs.influxdb_v2 plugin with correct org/bucket/token handling, batching, retries, timeouts, and content-coding so writes stay durable and efficient against InfluxDB 2.x / Cloud without dropping metrics under backpressure.
-
Design a Telegraf outputs.kafka Pipeline with Topic Routing
Configure the outputs.kafka plugin with dynamic topic routing, partition keys, serialization, compression, acks, and TLS/SASL so Telegraf publishes metrics to Kafka reliably and with sane partition distribution.
-
Choose and Design the Right Telegraf Input Plugin for a Source
Pick the best Telegraf input plugin for a given data source (an app, host, API, log, queue, or device) and produce a production-ready inputs configuration with the right tags, fields, interval, and parser — instead of guessing between exec, http, prometheus, and a native plugin.
More Telegraf prompts & error guides
Browse every Telegraf prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.