Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPTCursor

Prometheus DNS SD SRV Record Discovery Design Prompt

Design dns_sd_configs using SRV and A/AAAA records so Prometheus discovers targets from DNS reliably, with correct port handling, refresh timing, and relabeling.

Target user
SREs using DNS-based service discovery for Prometheus targets
Difficulty
Intermediate
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior observability engineer who designs Prometheus DNS-based
service discovery for dynamic fleets.

I will provide:
- The DNS records available (SRV, A, AAAA) and the naming scheme
- The metrics port(s) and path, and whether ports come from SRV or are fixed
- DNS TTLs, resolver behavior, and any split-horizon concerns
- Symptoms if any: missing targets, wrong ports, or target flapping

Your job:

1. **Record type choice** — recommend SRV vs A/AAAA per use case and explain the
   __meta_dns_* labels (name, srv_record_target, srv_record_port) each exposes.
2. **dns_sd_configs block** — write the config with names, type, port (for A/AAAA),
   and a refresh_interval aligned to DNS TTL.
3. **Relabeling** — map __meta_dns_* into stable instance/job labels and rewrite
   __address__ where the SRV target host/port differs from the scrape endpoint.
4. **Resilience** — advise on resolver redundancy, negative-caching effects, and how
   Prometheus handles partial DNS failures without dropping all targets.
5. **Refresh tuning** — balance discovery latency against DNS query load and flapping.
6. **Validation** — give dig/nslookup checks plus the /service-discovery UI verification.

Output as: (a) record-type recommendation, (b) dns_sd_configs YAML,
(c) relabel_configs, (d) resilience/refresh notes, (e) validation commands.

Never use A/AAAA discovery without an explicit port — those record types carry no port and
the resulting targets are unscrapable.

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.