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
-
Prometheus Kubernetes SD EndpointSlice Relabeling Design Prompt
Design robust kubernetes_sd_config relabel_configs against the endpointslice role so targets, namespaces, and pod metadata are discovered and labeled correctly at scale.
-
Prometheus Consul Service Discovery & Relabeling Prompt
Design and debug a consul_sd_configs scrape setup so services register cleanly, targets carry the right labels, and dead nodes drop out without stale series.
-
Prometheus Scrape Config Relabel Target Pruning Design Prompt
Design relabel_configs in a scrape job to keep/drop the right targets from service discovery, rewrite the instance/job labels, and prune noisy discovered endpoints before they ever scrape.
-
Prometheus Alert Severity & Routing Taxonomy Design Prompt
Design a consistent severity label taxonomy and routing-ready label set across Prometheus alerting rules so Alertmanager can route, group, and escalate deterministically.
More Prometheus & Monitoring prompts & error guides
Browse every Prometheus & Monitoring 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.