Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Telegraf Difficulty: Intermediate ClaudeChatGPTCursor

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

More Telegraf prompts & error guides

Browse every Telegraf prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.