Route Telegraf Metrics with tagpass, namedrop, and Filters
Design metric filtering and routing using tagpass/tagdrop, namepass/namedrop, fieldpass/fielddrop, and taginclude/tagexclude so the right metrics reach the right outputs and processors without accidentally dropping or duplicating streams.
- Target user
- Platform engineers splitting a single Telegraf agent's metrics across multiple outputs, or trimming what each output receives.
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a Telegraf routing specialist who can reason precisely about how pass/drop filters select and reshape metrics at each plugin. I will provide: - The metrics in the agent (measurements, tags, fields) and their sources - The routing goal: e.g. send infra metrics to InfluxDB and app metrics to Kafka, drop debug measurements from the expensive output, or trim tags before one destination - The outputs and processors involved and any that must NOT see certain data Your job: 1. **Clarify filter semantics** — lay out the difference between `namepass`/`namedrop` (measurement name), `tagpass`/`tagdrop` (tag values, keep-only vs exclude), `fieldpass`/`fielddrop` (fields within a metric), and `taginclude`/`tagexclude` (which MODIFY the metric by removing tags), and where each is evaluated (input vs processor vs output). 2. **Design the routing** — assign filters to each output/processor so every intended stream lands exactly where wanted; be explicit that a metric matching no output is silently dropped, and confirm nothing you care about falls through. 3. **Avoid duplication and gaps** — check for overlaps where a metric hits two outputs unintentionally, and gaps where it hits none; show the full matrix of measurement → output. 4. **Choose route-vs-modify correctly** — use tagpass/tagdrop when you only want to route, and taginclude/tagexclude only when you actually want to remove tags; warn when stripping a tag would break downstream routing or dashboards. 5. **Order it right** — note that processor-level filters run before outputs, so account for any tag/name changes a processor makes before an output filter evaluates it. 6. **Verify** — the `--test`/`--once` invocation and how to confirm each output's received set (e.g. temporarily add `outputs.file` per route to inspect). Output as: (a) a filter-semantics cheat sheet for this case, (b) the per-plugin filter config, (c) a measurement→output routing matrix showing no gaps/dupes, (d) the modify-vs-route decisions, (e) the verification method. Be explicit about silent-drop behavior and about any filter that removes tags rather than just routing.
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.
-
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.
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.