Add operation label to GRPC server metrics#555
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: openshift-online/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Adds new operation-level GRPC server metrics alongside existing metrics to provide detailed observability without breaking existing dashboards. **Non-Breaking Change**: Creates NEW metrics with '_by_operation' suffix instead of modifying existing metrics. New Metrics (with operation label): - grpc_server_called_total_by_operation - grpc_server_processed_total_by_operation - grpc_server_processed_duration_seconds_by_operation - grpc_server_message_received_total_by_operation - grpc_server_message_sent_total_by_operation Existing Metrics (unchanged, backwards compatible): - grpc_server_called_total - grpc_server_processed_total - grpc_server_processed_duration_seconds - grpc_server_message_received_total - grpc_server_message_sent_total Operation values: create, update, delete, resync, subscribe Implementation: - Both old and new metrics are populated in interceptors - extractOperation() helper parses CloudEvent type - Zero additional latency (metrics populated in parallel) Related: ARO-26754 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4b4cf32 to
cea1748
Compare
Add operation-level GRPC server metrics (non-breaking)
Summary
Adds new operation-level GRPC server metrics alongside existing metrics to provide detailed observability into Maestro server operations. This addresses the need for operation-level monitoring identified in ARO-26754.
✅ NON-BREAKING CHANGE: Creates NEW metrics with
_by_operationsuffix instead of modifying existing metrics.Changes
Modified Files
cmd/maestro/server/metrics_interceptor.go:
_by_operationsuffixextractOperation()helper to parse CloudEvent typeNew Metrics Added (Non-Breaking)
All new metrics include
operationlabel and use_by_operationsuffix:grpc_server_called_total_by_operation - Counter
type,source,operationgrpc_server_processed_total_by_operation - Counter
type,source,operation,codegrpc_server_processed_duration_seconds_by_operation - Histogram
type,source,operationgrpc_server_message_received_total_by_operation - Counter
type,source,operationgrpc_server_message_sent_total_by_operation - Counter
type,source,operationExisting Metrics (Unchanged, Backwards Compatible)
These metrics continue to work exactly as before:
type,sourcetype,source,codetype,sourcetype,sourcetype,sourceOperation Values
Publish method (extracted from CloudEvent type):
create- Create resource requestupdate- Update resource requestdelete- Delete resource requestresync- Resync status requestunknown- Parse error fallbackSubscribe method:
subscribe- Subscribe to resource status updatesImplementation Details
Dual Metrics Population
Both old and new metrics are populated in the same code path:
Performance Impact
Testing
Build Verification
make binary- Successfully compiled (140MB binary)Expected Metrics Output
Existing metrics (continue working):
New metrics (added):
Backwards Compatibility
✅ 100% Backwards Compatible
Migration Path (Optional)
Consumers can gradually migrate to the new operation-level metrics:
Phase 1 (after this PR merges):
Phase 2 (gradual migration):
_by_operationmetricsPhase 3 (future, optional):
Benefits
Example Use Cases
Which operation is slowest?
Which consumer creates the most resources?
Are deletes failing more than creates?
Compare old vs new metrics (validation):
Deployment
✅ No coordination required - can deploy independently
Related
Reviewers
Please review:
_by_operationsuffix)Checklist
_by_operationsuffix