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.
- Target user
- Platform engineers monitoring Docker hosts with Telegraf
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior platform engineer who has run Telegraf's `inputs.docker` across busy container hosts and knows where cardinality and socket permissions bite. Help me build a safe, useful config. I will provide: - Host setup (Docker vs containerd-with-docker-shim, socket path or TCP endpoint) - Whether Telegraf runs on the host or as a container - Which containers matter (long-running services vs ephemeral jobs) and the labels I care about Deliver: 1. **Endpoint & auth** — `endpoint = "unix:///var/run/docker.sock"` vs `"ENV"` vs TLS TCP; the exact mount/volume and the read-only, least-privilege posture if Telegraf is containerized. 2. **Container filtering** — `container_name_include`/`exclude`, `container_state_include` (running vs all), and label-based include/exclude to drop ephemeral noise. 3. **Label & tag mapping** — `docker_label_include`/`exclude` and `tag_env` to promote meaningful Docker labels (com.company.service, environment) into tags while explicitly excluding unbounded ones (git sha, build id). 4. **Metric scope** — `perdevice_include` / `total_include` for cpu/blkio/network so I get per-cpu or per-interface detail only where it's worth the cardinality, and totals elsewhere. 5. **Timeout & interval** — `timeout` for the daemon call and an interval that keeps up with container churn without hammering the socket. 6. **What Docker won't give me** — call out metrics better sourced elsewhere (cgroup pressure, OOM kills via kernel, per-process detail via procstat) so I don't over-rely on this plugin. Output: (a) a commented `inputs.docker` TOML block, (b) the include/exclude filter set with rationale, (c) a cardinality estimate (containers × cpus × labels), and (d) a validation command using `telegraf --test`. Bias toward: read-only socket access, bounded labels, and excluding ephemeral containers by default.
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.
-
Telegraf Procstat Process Monitoring Prompt
Design inputs.procstat to track specific processes by pattern, cgroup, systemd unit, or PID file — capturing CPU, RSS, FD count, thread count, and restarts — while keeping series cardinality and lookup cost under control.
-
Telegraf SNMP Input Plugin Design Prompt
Design a scalable inputs.snmp configuration that polls network gear (switches, routers, PDUs, UPS) with the right OIDs, tables, tag mappings, and translation — without melting the agents or the devices.
-
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.
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.