Skip to content

[🤖] feat(k8s-system-coredns): add cache hit rate and forward request latency panels - #180

Open
raman1236 wants to merge 1 commit into
dotdc:masterfrom
raman1236:feat/coredns-cache-hit-rate
Open

[🤖] feat(k8s-system-coredns): add cache hit rate and forward request latency panels#180
raman1236 wants to merge 1 commit into
dotdc:masterfrom
raman1236:feat/coredns-cache-hit-rate

Conversation

@raman1236

Copy link
Copy Markdown

Summary

Add two new panels to the CoreDNS dashboard that surface derived metrics currently not visible, placed directly below the existing cache section.

New Panels

1. CoreDNS - Cache Hit Rate %

Shows the percentage of DNS queries served from cache:

sum(rate(coredns_cache_hits_total{...}[$__rate_interval]))
/
(
  sum(rate(coredns_cache_hits_total{...}[$__rate_interval]))
  +
  sum(rate(coredns_cache_misses_total{...}[$__rate_interval]))
) * 100

Why: The existing "Cache Hits / Misses" panel shows raw hit/miss rates, but operators need the derived ratio to evaluate cache effectiveness and tune cache-size and TTL settings. A drop in cache hit rate is a key signal for DNS performance degradation.

2. CoreDNS - Forward Request Latency

Shows p99 and p50 upstream DNS resolution latency:

histogram_quantile(0.99, sum by (le) (
  rate(coredns_proxy_request_duration_seconds_bucket{proxy_name="forward", ...}[$__rate_interval])
))

Why: The existing dashboard shows forward request count but not latency. When CoreDNS forwards queries to upstream resolvers, latency directly impacts DNS resolution time for pods. This panel helps diagnose slow upstream resolvers, network issues, or resolver overload.

Changes

  • Added 2 new timeseries panels at y=43, below the cache hits/misses and cache size panels
  • Shifted heatmap panels (DNS request duration, request size, response size) down by 8
  • Dashboard version bumped from 22 to 23

Checklist

  • Dashboard version bumped
  • Conventional commit format used
  • AI-assisted contribution clearly identified with 🤖 scope

…hboard

Add two new panels to the CoreDNS dashboard that surface derived metrics
not currently visible:

1. Cache Hit Rate %: Shows the percentage of DNS queries served from
   cache (hits / (hits + misses) * 100). The existing Cache Hits/Misses
   panel shows raw rates but operators need the derived ratio to evaluate
   cache effectiveness and tune TTL/cache-size settings.

2. Forward Request Latency: Shows p99 and p50 upstream DNS resolution
   latency using histogram_quantile on
   coredns_proxy_request_duration_seconds_bucket. The existing panel only
   shows forward request count, but latency to upstream resolvers is
   critical for diagnosing slow DNS resolution.

Both panels are placed directly below the existing cache section for
logical grouping. Dashboard version bumped from 22 to 23.
@raman1236
raman1236 requested a review from dotdc as a code owner April 6, 2026 18:10
@raman1236

Copy link
Copy Markdown
Author

Friendly ping — this PR adds cache hit rate and forward request latency panels to the CoreDNS dashboard. Would appreciate a review when convenient. Thanks!

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