feat(metrics): preserve canonical engine load sections - #2226
Conversation
|
Warning Review limit reachedNext included review available in 55 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
Warning Your free Security trial is over. An organization admin can activate billing to continue. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note for reviewers: this PR and #2227 (TokenSpeed sampling seeds) both touch |
0b04046 to
aca2c31
Compare
|
can you please resolve conflict |
Signed-off-by: Zihua Wu <13583761+lucifer1004@users.noreply.github.com>
aca2c31 to
bdf5604
Compare
Motivation
Engine
GetLoadsresponses carry canonical load sections (memory, queues, aggregate) that were dropped at the gRPC boundary, and engine load gauges were only polled when a load-aware routing policy was active — coupling engine observability to routing configuration.What this changes
SchedulerLoadSnapshotgainsmemory/queuessnapshots andWorkerLoadResponsegainsversion+ an optionalaggregatesection, with mappings for SGLang, vLLM (aggregateNone), and TokenSpeed engines.smg_engine_*Prometheus gauges;--engine-metricsis narrowed to only force polling when no load-aware policy is active. No additional engine RPC is introduced.smg_engine_*series whenever a load was ever published, not only under the flag.Usage::with_cached_tokens(0)records an explicit zero (cold miss) instead of omitting cache accounting.Tests
New conversion test (
conversion_preserves_version_sections_and_aggregate), explicit-zero builder test, and the metrics-endpoint integration test;openai-protocol93/0,smgmetrics/policies/monitor lib suites 285/0,engine_metrics_test1/1.