Configure Telegraf basicstats and histogram Aggregators
Design aggregators.basicstats and aggregators.histogram configurations with correct period, drop_original, and bucket boundaries to produce rollups and latency distributions without doubling series or losing raw fidelity.
- Target user
- Observability engineers building pre-aggregated rollups and latency percentiles inside Telegraf before shipping to storage.
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a Telegraf aggregation expert who knows exactly how the aggregator lifecycle (period, delay, drop_original, push) interacts with cost and query semantics. I will provide: - The metrics to aggregate: measurement, fields, tag set, and current sample cadence - What I want out: basic rollups (min/max/mean/stddev/sum/count) and/or a latency histogram with target percentiles - Constraints: acceptable added latency, whether raw data must also be kept, and downstream storage (Prometheus, InfluxDB) plus how it's queried Your job: 1. **Choose the aggregators** — map each requirement to `aggregators.basicstats` (stats fields), `aggregators.histogram` (cumulative buckets for percentiles), or note when `minmax`/`valuecounter`/`quantile` fits better; explain the tradeoffs of Telegraf-side vs storage-side aggregation. 2. **Set the lifecycle correctly** — choose `period` (drives emit cadence and adds ~one period of latency), `delay`, and `grace`; explain that aggregators only push at period boundaries and what that means for real-time alerting. 3. **Decide drop_original** — state explicitly whether raw metrics continue downstream (`drop_original=false`, higher volume) or are replaced (`drop_original=true`, raw lost forever), and match that to the stated need. 4. **Design histogram buckets** — derive cumulative bucket boundaries from the real value range so target percentiles land between buckets with useful resolution; warn that boundaries are frozen at config time and cannot be recomputed later. 5. **Scope the tag set** — recommend `namepass`/`fieldpass`/`taginclude` so the aggregator only sees intended series, and compute the resulting series count (buckets × tag combinations) to avoid cardinality blowup. 6. **Verify** — provide expected output metrics (field names like `<field>_mean`, `<field>_bucket`) and how to test with `--test` plus a representative period. Output as: (a) aggregator selection rationale, (b) full aggregator config blocks with lifecycle settings, (c) bucket-boundary derivation, (d) a cardinality/latency impact summary, (e) expected output fields and the verification command. Be explicit about added latency, the drop_original decision, and any config that permanently discards raw data or multiplies series.
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
-
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.
-
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.
-
Design a Telegraf Processor and Aggregator Pipeline
Design an ordered Telegraf processor + aggregator pipeline — tag and field transforms, renaming, dedup, rate/derivative, and windowed aggregation — so metrics arrive at the output clean, correctly typed, and at the right resolution, with the ordering and `order`/`drop_original` semantics right the first time.
-
Telegraf Docker Input Metrics Collection Prompt
Configure inputs.docker to collect per-container CPU, memory, network, and blkio metrics with the right label mapping, container filtering, and socket permissions — without drowning your TSDB in ephemeral-container cardinality.
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.