Add read-only observability snapshots#385
Open
shipiyouniao wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a small, read-only observability surface for kvcached integrations and KV cache pools, exposing structured “snapshot” dataclasses and helper methods so external monitoring/control-plane systems can introspect state without relying on private patch details.
Changes:
- Added
kvcached.observabilitymodule withRuntimeSnapshot/KVCachePoolSnapshot, plus capability discovery and snapshot builders. - Added
KVCacheManager.observability_snapshot()/observability_snapshot_dict()for pool-level snapshot export. - Added vLLM/SGLang integration runtime snapshot helpers and a new unit test covering JSON-serializability and snapshot field values.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_observability.py | Adds unit tests for capability discovery and snapshot serialization/field correctness. |
| kvcached/observability.py | Introduces stable schema/versioned snapshot dataclasses and snapshot builder helpers. |
| kvcached/kv_cache_manager.py | Exposes synchronized pool snapshot helper methods on KVCacheManager. |
| kvcached/integration/vllm/interfaces.py | Adds vLLM runtime integration snapshot + dict helper. |
| kvcached/integration/sglang/interfaces.py | Adds SGLang runtime integration snapshot + dict helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+4
to
+8
| import json | ||
| import sys | ||
| import types | ||
|
|
||
| sys.modules.setdefault("torch", types.ModuleType("torch")) |
cc5e037 to
287bf60
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.
Summary
Adds a small read-only observability surface for kvcached runtime integrations and KV cache pools.
This PR intentionally keeps the surface policy-free: it exposes structured snapshots that external monitoring systems or control-plane layers can consume without depending on private patch details.
What is included
kvcached.observabilitydataclasses for:KVCacheManager.observability_snapshot()andobservability_snapshot_dict()Notes
Validation
Ran on a Linux host without GPU workload: