Skip to content

feat: add snapshot serve metrics by source and repository#252

Merged
worstell merged 1 commit intomainfrom
worstell/snapshot-serve-metrics
Apr 14, 2026
Merged

feat: add snapshot serve metrics by source and repository#252
worstell merged 1 commit intomainfrom
worstell/snapshot-serve-metrics

Conversation

@worstell
Copy link
Copy Markdown
Contributor

Add two new OTel metrics to the git strategy to track snapshot serving patterns:

  • cachew.git.snapshot_serves_total — counter tagged by source (cache, cold_cache, spool, generated) and repository, enabling cache hit rate analysis
  • cachew.git.snapshot_serve_bytes — histogram of snapshot sizes served, tagged by source and repository

These metrics instrument all four snapshot serving paths:

  • cache — served from warm local cache
  • cold_cache — served from S3 cache during pod cold start
  • spool — served via spool from a concurrent request
  • generated — fresh snapshot generated on cache miss

This 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.

@worstell worstell requested a review from a team as a code owner April 13, 2026 20:33
@worstell worstell requested review from inez and removed request for a team April 13, 2026 20:33
@worstell worstell force-pushed the worstell/snapshot-serve-metrics branch from edc412b to 8e69145 Compare April 13, 2026 20:44
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
@worstell worstell force-pushed the worstell/snapshot-serve-metrics branch from 8e69145 to 1b27adb Compare April 14, 2026 17:38
@worstell worstell merged commit 890a605 into main Apr 14, 2026
8 checks passed
@worstell worstell deleted the worstell/snapshot-serve-metrics branch April 14, 2026 17:41
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