Skip to content

feat(metrics)!: classify cache misses by reason - #146

Open
lan17 wants to merge 1 commit into
codex/issue-141-fenced-refillsfrom
codex/issue-145-miss-reasons
Open

feat(metrics)!: classify cache misses by reason#146
lan17 wants to merge 1 commit into
codex/issue-141-fenced-refillsfrom
codex/issue-145-miss-reasons

Conversation

@lan17

@lan17 lan17 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

Implements #145 and replaces the closed, stale attempt at #130.

  • Adds one required bounded reason to the existing miss event: value_absent, watermark_fenced, or unclassified.
  • Preserves read cause independently from a valid observed watermark, so an absent value may still fence a refill without being mislabeled as watermark_fenced.
  • Updates Node Redis, Valkey GLIDE, Prometheus, Datadog, custom-adapter guidance, and packed package consumers without adding Redis commands or a second miss metric.

Design

Bundled decoders return classified semantic misses. A genuine tracked frame-versus-watermark rejection is watermark_fenced; Redis nil is value_absent; malformed metadata, client-side future/invalid timestamps, serializer-load failure, and legacy custom null reads are unclassified. Core validates custom typed results so watermark_fenced requires a valid tracked observed watermark.

Prometheus keeps dialcache_miss_counter and adds its fifth reason label. Datadog keeps dialcache.miss.count and adds the same reason tag. Migration notes cover same-registry incompatibility, mixed-fleet PromQL aggregation, Datadog cardinality, and custom metric adapters.

Dependency

This is deliberately stacked on #143, which introduces the observed-refill-fence result model this change classifies. After that PR merges, retarget or rebase this PR onto main before merge.

Breaking change

BREAKING CHANGE: DialCacheMetricsAdapter.miss now receives MissMetricLabels, and first-party miss metrics require the reason label or tag. Under the pre-1.0 release policy, this is a minor release.

Validation

  • corepack pnpm check
  • corepack pnpm test:integration
  • Fresh semantic review of source/API boundaries and custom-adapter normalization

@lan17
lan17 force-pushed the codex/issue-141-fenced-refills branch 2 times, most recently from 86caf56 to a0150bd Compare August 30, 2026 03:57
Add a bounded reason to the existing miss event while preserving the independent observed-watermark refill fence for typed Redis reads.

BREAKING CHANGE: DialCacheMetricsAdapter.miss now receives MissMetricLabels and first-party miss metrics add a required reason label/tag.
@lan17
lan17 force-pushed the codex/issue-145-miss-reasons branch from df6b10f to 4cf8d28 Compare August 30, 2026 04:12
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.

1 participant