feat(metrics): preserve canonical engine load sections - #2226
Conversation
|
Warning Review limit reached
Next review available in: 20 minutes Limit 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. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
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 |
Signed-off-by: Zihua Wu <13583761+lucifer1004@users.noreply.github.com>
0b04046 to
aca2c31
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.