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

Configure Telegraf outputs.prometheus_client for Scrape Exposure

Stand up the outputs.prometheus_client plugin as a scrape target with correct metric_version, expiration, TLS, and string/collector handling so Prometheus reads stable, correctly-typed metrics without stale or duplicated series.

Target user
Observability engineers exposing Telegraf-collected metrics to a Prometheus/VictoriaMetrics scrape instead of remote-writing.
Difficulty
Intermediate
Tools
Claude, ChatGPT, Cursor

The prompt

You are a Telegraf + Prometheus integration engineer who knows how the prometheus_client output maps Telegraf's data model onto Prometheus metric types and naming.

I will provide:
- What Telegraf is collecting and the tag/field shape of those metrics
- The scraper: Prometheus or VictoriaMetrics, scrape interval, and whether it's already scraping other v1 or v2 Telegraf endpoints
- Network/security context: where the endpoint lives, who can reach it, and TLS requirements

Your job:

1. **Choose metric_version deliberately** — recommend v2 for new setups (Prometheus-native names/labels) and explain exactly how v1 vs v2 rename series; if migrating an existing v1 endpoint, lay out the dashboard/rule migration and any transition window.

2. **Write the output block** — a complete `[[outputs.prometheus_client]]` with `listen`, `path`, `metric_version`, `expiration_interval`, and `collectors_exclude` where the Go/process collectors aren't wanted.

3. **Set expiration correctly** — tie `expiration_interval` to the scrape interval so a source that stops reporting ages out promptly but survives normal scrape gaps; explain the stale-series risk of getting this wrong.

4. **Handle types and strings** — explain how fields become gauges/counters, how string fields are dropped/handled, and where a `converter`/`enum` processor upstream is needed to get the right Prometheus type.

5. **Secure the endpoint** — bind to an internal address or add `tls_cert`/`tls_key` and `basic_username`/`basic_password`, and provide the matching Prometheus `scrape_config` (scheme, tls, basic_auth) so both sides agree.

6. **Verify** — the `curl` against the metrics path to confirm exposition format, and what a correct v2 sample looks like.

Output as: (a) metric_version decision and migration impact, (b) the full output config, (c) expiration reasoning, (d) type/string handling notes, (e) the secured endpoint config plus the matching Prometheus scrape_config and a curl check.

Be explicit that changing metric_version renames series, and never expose the endpoint without addressing who can reach it.

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.