Skip to content

Add read-only observability snapshots#385

Open
shipiyouniao wants to merge 1 commit into
ovg-project:mainfrom
shipiyouniao:feature/runtime-observability
Open

Add read-only observability snapshots#385
shipiyouniao wants to merge 1 commit into
ovg-project:mainfrom
shipiyouniao:feature/runtime-observability

Conversation

@shipiyouniao

Copy link
Copy Markdown

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.observability dataclasses for:
    • runtime integration state
    • KV cache pool state
    • capability discovery
  • KVCacheManager.observability_snapshot() and observability_snapshot_dict()
  • vLLM and SGLang integration runtime snapshot helpers
  • unit tests using a fake allocator, with no CUDA/GPU dependency

Notes

Validation

Ran on a Linux host without GPU workload:

pytest tests/test_observability.py -q
# 3 passed

GOPROXY=https://goproxy.cn,direct pre-commit run --all-files
# passed

pre-commit run --all-files --hook-stage manual mypy-3.9
pre-commit run --all-files --hook-stage manual mypy-3.10
pre-commit run --all-files --hook-stage manual mypy-3.11
pre-commit run --all-files --hook-stage manual mypy-3.12
pre-commit run --all-files --hook-stage manual mypy-3.13
# all passed

Copilot AI review requested due to automatic review settings July 9, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.observability module with RuntimeSnapshot / 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 thread tests/test_observability.py Outdated
Comment on lines +4 to +8
import json
import sys
import types

sys.modules.setdefault("torch", types.ModuleType("torch"))
@shipiyouniao shipiyouniao force-pushed the feature/runtime-observability branch from cc5e037 to 287bf60 Compare July 9, 2026 11:37
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