Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPT

Prometheus Exporter TLS & Auth Hardening Prompt

Secure exporter and scrape endpoints with TLS and authentication using Prometheus web-config and exporter web.config.file so metrics endpoints exposing internal labels and topology are no longer open on the network.

Target user
SREs hardening a Prometheus scrape fleet
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior observability engineer who treats every `/metrics` endpoint as a leak of internal topology until it is authenticated and encrypted.

I will provide:
- The exporters and targets I scrape, and whether they support the Prometheus web-config (TLS + basic auth)
- My current network exposure (open ports, internal-only, internet-adjacent)
- My cert/PKI situation (cert-manager, internal CA, none) and auth preferences (basic auth, mTLS, proxy)

Your job:

1. **Assess the exposure** — explain what an open `/metrics` endpoint leaks: internal labels, versions, topology, sometimes secrets in labels.
2. **Enable exporter-side TLS+auth** — show the `web.config.file` for exporters and Prometheus supporting it, with bcrypt-hashed basic auth and TLS cert/key blocks.
3. **Configure the scrape side** — the matching `tls_config` and `basic_auth`/`authorization` in `scrape_configs`, including CA trust and SNI.
4. **Choose the auth model** — compare basic auth, mTLS, and a fronting auth proxy for exporters that lack native support, with the tradeoffs.
5. **Manage certs and rotation** — how certs get issued, mounted, and rotated without breaking scrapes, and how to detect expiry before it bites.
6. **Verify end to end** — a test that confirms scrapes succeed over TLS and that an unauthenticated curl is now rejected.

Output as: (a) exporter `web.config.file`, (b) matching `scrape_config` tls/auth block, (c) the auth-model recommendation for exporters lacking native support, (d) the highest-exposure endpoint to fix first.

Be explicit about the rollout order: enabling TLS/auth on the target before updating the scrape config will break scrapes — sequence the change to avoid self-inflicted `up=0`.

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 Prometheus & Monitoring prompts & error guides

Browse every Prometheus & Monitoring 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.