feat: add snapshot serve metrics by source and repository#252
Merged
Conversation
joshfriend
approved these changes
Apr 13, 2026
edc412b to
8e69145
Compare
Add two new OTel metrics to the git strategy: - cachew.git.snapshot_serves_total: counter of snapshot serves tagged by source (cache, cold_cache, spool, generated) and repository - cachew.git.snapshot_serve_bytes: histogram of snapshot sizes served These metrics enable tracking cache hit rates and per-repo snapshot serving patterns to inform cache priming decisions. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d8cfb-c84e-72db-9756-c0cedcd5540e
8e69145 to
1b27adb
Compare
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.
Add two new OTel metrics to the git strategy to track snapshot serving patterns:
cachew.git.snapshot_serves_total— counter tagged bysource(cache,cold_cache,spool,generated) andrepository, enabling cache hit rate analysiscachew.git.snapshot_serve_bytes— histogram of snapshot sizes served, tagged bysourceandrepositoryThese metrics instrument all four snapshot serving paths:
cache— served from warm local cachecold_cache— served from S3 cache during pod cold startspool— served via spool from a concurrent requestgenerated— fresh snapshot generated on cache missThis data will help inform cache priming strategies by showing which repositories benefit most from cached snapshots and how often snapshots are generated on-demand vs served from cache.