Skip to content

fix(kubernetes): look up headless_with_selector metric by label in e2e test#174

Merged
yongtang merged 1 commit into
coredns:masterfrom
syedazeez337:fix/dns-programming-metric-test-service-kind
Mar 24, 2026
Merged

fix(kubernetes): look up headless_with_selector metric by label in e2e test#174
yongtang merged 1 commit into
coredns:masterfrom
syedazeez337:fix/dns-programming-metric-test-service-kind

Conversation

@syedazeez337
Copy link
Copy Markdown
Contributor

Companion fix for coredns/coredns#7951, which extends coredns_kubernetes_dns_programming_duration_seconds to record cluster_ip services in addition to headless_with_selector.

Problem: TestDNSProgrammingLatencyEndpoints selected the histogram to check via Metric[0]. Before #7951, only headless_with_selector was ever emitted, so Metric[0] was always that series. After #7951, cluster_ip is also emitted and sorts alphabetically before headless_with_selector, so Metric[0] changed, causing the expected delta check to fail.

Fix: Extract a metricByServiceKind helper that finds the correct *dto.Metric by its service_kind label value, and use it to select headless_with_selector explicitly in both the base and final scrape comparisons.

…e test

cluster_ip is now also recorded by the dns_programming_duration metric
(coredns/coredns#7951), so Metric[0] is no longer reliably the
headless_with_selector series. Use a label-based lookup instead.

Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
@yongtang yongtang merged commit 326aa94 into coredns:master Mar 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants