feat(vanity-gateway): add per-model shadow drop metric#430
feat(vanity-gateway): add per-model shadow drop metric#430FamousDirector wants to merge 1 commit into
Conversation
Expose dropped shadow dispatches by target model and bounded reason, with zero-initialized series for configured targets. Refs: #428
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe vanity gateway now exposes an OpenTelemetry counter for dropped shadow dispatches, labeled by target model and drop reason. Metrics are initialized during model mapping, recorded during shadow dispatch summaries, documented, wired into Bazel, and covered by focused tests. ChangesShadow Drop Metrics
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant NVCFGateway
participant buildModelMapping
participant recordShadowDispatchSummary
participant shadowDroppedCounter
NVCFGateway->>NVCFGateway: setupShadowMetrics()
buildModelMapping->>shadowDroppedCounter: initializeShadowDropMetrics(target models)
recordShadowDispatchSummary->>shadowDroppedCounter: recordShadowDropMetrics(reasons, target models)
shadowDroppedCounter-->>recordShadowDispatchSummary: increment labeled counters
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
Why
Dropped shadow dispatches are currently visible only through trace attributes
and a debug log. Operators need a Prometheus counter to distinguish configured
sampling from dispatch loss and identify affected shadow targets.
What changed
nvcf_ai_api_gateway_shadow_requests_dropped_total.openai_model_nameand boundedreason.Customer Release Notes
Not customer visible.
Plan Summary
Not applicable.
Usage
Testing
go test ./gatewaybazel run //:gazellebazel mod tidybazel test //gateway:gateway_testbazel test //... --flaky_test_attempts=3All passed. No additional QA required.
Notes
openai_model_nameidentifies the configured shadow target. The label addsthree bounded reason series per configured target.
References
Closes #428
Related Merge Requests/Pull Requests
None.
Dependencies
No new or updated dependency versions.
go.opentelemetry.io/otel/metricv1.43.0 was already present indirectly and is now a direct dependency.
Summary by CodeRabbit
New Features
Documentation
Tests