feat: add ip_version, stale, and uncached metrics to cfetchdns#41
Open
shreekarshetty wants to merge 8 commits into
Open
feat: add ip_version, stale, and uncached metrics to cfetchdns#41shreekarshetty wants to merge 8 commits into
shreekarshetty wants to merge 8 commits into
Conversation
Extends dnsAnalyticsAdaptiveGroups query with ipVersion dimension and
sum { countStale countNotCachedAndNotStale } fields.
- cloudflare_zone_dns_queries_total gains ip_version label (~2x series to ~600)
- cloudflare_zone_dns_stale_total{zone} — zone-level counter, spikes when CF
serves stale records due to NS reachability issues (INC-482 class)
- cloudflare_zone_dns_uncached_total{zone} — zone-level counter, baseline ~98%
of queries; useful for cache hit rate tracking
Stale and uncached are aggregated per (zone, bucket) in flattenDNSGroups so
each emits one observation per minute-bucket regardless of (responseCode,
queryType, ipVersion) fan-out.
NET-363
bd7aa91 to
8f4b64e
Compare
mraerino
reviewed
Jun 26, 2026
mraerino
reviewed
Jun 26, 2026
…c name strings Moves all metric name string literals out of cfetch, cfetchdns and prometheus into a shared metricnames package. prometheus.go MetricName constants now reference the package for the 18 metrics that cfetch also emits via converge, and for the 3 DNS metrics that exist in both cfetchdns and converge.go. Eliminates the duplication Marcus flagged in PR review.
mraerino
reviewed
Jun 26, 2026
Member
There was a problem hiding this comment.
I wouldn't use the constants here, because this means introducing a breaking change in metric names wouldn't make the integration test fail. Putting the raw string into tests is a best practice imho
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three new DNS metrics via
dnsAnalyticsAdaptiveGroups:cloudflare_zone_dns_queries_totalgainsip_versionlabel (v4/v6)cloudflare_zone_dns_stale_total{zone}— stale response counter (INC-482 class signal)cloudflare_zone_dns_uncached_total{zone}— uncached response counterMoves all metric name strings into a shared
metricnamespackage (single source of truth across cfetch, cfetchdns and prometheus).Also adds CODEOWNERS and integration test docs to README.
NET-363