Skip to content

Conversation

@sallyom
Copy link

@sallyom sallyom commented Jul 9, 2025

Initial distributed tracing instrumentation
Also, fix nil pointer dereference in KV Cache scorer initialization.

@sallyom sallyom force-pushed the tracing branch 2 times, most recently from 3342ece to 74dac2d Compare July 30, 2025 00:53
@sallyom sallyom force-pushed the tracing branch 11 times, most recently from 41fd565 to 216b818 Compare August 27, 2025 17:49
@sallyom sallyom force-pushed the tracing branch 2 times, most recently from 8259996 to 19df391 Compare October 28, 2025 14:15
@sallyom sallyom force-pushed the tracing branch 2 times, most recently from 0bb2784 to df31e7d Compare December 3, 2025 16:11
sallyom and others added 2 commits December 4, 2025 19:27
Implement custom tracing spans for observability into cache operations

Changes:
- Add OpenTelemetry SDK dependencies to go.mod
- Create pkg/telemetry package with InitTracing() for setup
- Add three custom spans to pkg/kvcache/indexer.go:
  * kvcache.manager.get_scores (SERVER): Main GetPodScores operation
  * kvcache.storage.lookup (INTERNAL): KV block index lookup
  * kvcache.scorer.compute (INTERNAL): Scoring algorithm execution
- Instrument with attributes:
  * Model identifier, pod counts, block counts
  * Cache hit ratios and score distributions
  * Timing via automatic span duration tracking

Key metrics captured:
- kvcache.hit_ratio: Cache effectiveness (0.0-1.0)
- kvcache.total_blocks_available: Available blocks across pods
- kvcache.score.max/avg: Score distribution insights
- kvcache.lookup.cache_hit: Whether blocks were found

Security: Metadata-only tracing (no prompts, tokens, or sensitive data)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: sallyom <[email protected]>
Signed-off-by: sallyom <[email protected]>
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