From 50a85daa445f828ce50078e3c4448c8c5b8cc639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sat, 7 Feb 2026 17:09:46 +0100 Subject: [PATCH] docs: update plan with hostname label documentation Co-Authored-By: Claude Opus 4.5 --- docs/plans/prometheus-scrape-target-labels.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/plans/prometheus-scrape-target-labels.md b/docs/plans/prometheus-scrape-target-labels.md index d1b2508..d756ebf 100644 --- a/docs/plans/prometheus-scrape-target-labels.md +++ b/docs/plans/prometheus-scrape-target-labels.md @@ -10,6 +10,7 @@ | 4. Set metadata on hosts | ✅ Complete | All relevant hosts configured | | 5. Update alert rules | ✅ Complete | Role-based filtering implemented | | 6. Labels for service targets | ✅ Complete | Host labels propagated to all services | +| 7. Add hostname label | ✅ Complete | All targets have `hostname` label for easy filtering | **Hosts with metadata configured:** - `ns1`, `ns2`: `role = "dns"`, `labels.dns_role = "primary"/"secondary"` @@ -19,6 +20,12 @@ **Implementation complete.** Branch: `prometheus-scrape-target-labels` +**Query examples:** +- `{hostname="ns1"}` - all metrics from ns1 (any job/port) +- `node_cpu_seconds_total{hostname="monitoring01"}` - specific metric by hostname +- `up{role="dns"}` - all DNS servers +- `up{tier="test"}` - all test-tier hosts + --- ## Goal