Skip to content

Document Prometheus metrics for cache outcomes and shared flights - #11

Open
Tejaa11 wants to merge 2 commits into
mayankcodes-dev:mainfrom
Tejaa11:fix/issue-10
Open

Tejaa11 wants to merge 2 commits into
mayankcodes-dev:mainfrom
Tejaa11:fix/issue-10

Conversation

@Tejaa11

@Tejaa11 Tejaa11 commented Dec 4, 2026

Copy link
Copy Markdown

Summary

The metadata methods expose cache outcomes and caller counts, but the README lacked a working example that turns both results into Prometheus metrics. The new recipe records each caller’s flight size and distinguishes fresh-cache XFetch refreshes from stale revalidation. Running the snippet against the built package and prom-client verified ten exported metric values, including fallback and shared-call cases.

Related issue

Closes #10

Type of change

  • Documentation / examples

Verification checklist

  • Exercised cache hits, misses, background refreshes, shared flights, and a cache read error.
  • Kept zero runtime dependencies.
  • npx tsc --noEmit and npm run build passed.
  • npm test passed all 82 tests.
  • npm run check:exports and npm run check:types passed.

@greptile-apps

greptile-apps Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] The documentation change appears safe to merge.

Summary

Adds a Prometheus recipe for cache outcomes, background refreshes, and shared calls.

  • The README shows how applications can export cache and shared-flight results as Prometheus metrics.

Reviews (2) · Last reviewed commit: "docs: enable cache fallback in the Prome..." · Reviewed by Greptile

Comment thread README.md Resolved
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.

[Docs]: Add Prometheus / OpenTelemetry observability snippet for doWithMeta and getOrSetWithMeta

1 participant