feat(metrics): enhance the monitoring metrics of rpc call failure under Triple protocol#3189
feat(metrics): enhance the monitoring metrics of rpc call failure under Triple protocol#3189Saramanda9988 wants to merge 10 commits intoapache:developfrom
Conversation
|
Currently, It seems that the Dubbo protocol in dubbo-go only propagates plain errors without structured error codes and there is no unified abstraction to align error semantics across protocols. Any further handling would have to rely on comparing error text, which is not a good approach. Therefore, this part is not implemented in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3189 +/- ##
===========================================
+ Coverage 46.76% 48.41% +1.64%
===========================================
Files 295 462 +167
Lines 17172 33498 +16326
===========================================
+ Hits 8031 16217 +8186
- Misses 8287 15973 +7686
- Partials 854 1308 +454 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enhances RPC metrics under the Triple protocol by introducing fine‑grained error classification and associated counters for both providers and consumers, and slightly relaxes some registry metrics time assertions to be less brittle.
Changes:
- Extend
rpcCommonMetricsandproviderMetrics/consumerMetricsto include per‑error‑type counters (timeout, limit, service unavailable, business failure, unknown) and their aggregate variants. - Introduce
error_classifier.goto map Triple/gRPC error codes into internalErrorTypevalues, and updaterpcCollector.afterInvokeHandlerto classify failures and increment the corresponding granular counters per side. - Adjust
metrics/registry/event_test.gotime assertions to acceptEnd == Startby checking!End.Before(start)instead of requiringEnd.After(start).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
metrics/rpc/metric_set.go |
Adds new counter and aggregate counter vectors for each granular error type on both provider and consumer metric sets. |
metrics/rpc/error_classifier.go |
Introduces ErrorType enum and classifyError helper to translate Triple error codes into high‑level categories used by metrics. |
metrics/rpc/collector.go |
Wires error classification into the after‑invoke path and updates per‑type failure counters for provider/consumer roles. |
metrics/registry/event_test.go |
Relaxes event timing expectations to avoid flakiness by only asserting that End is not before Start. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Alanxtl Done |
|
|
@AlexStocks Done |



Description
according to https://cn.dubbo.apache.org/en/overview/reference/metrics/standard_metrics/
Implementing a more fine-grained error classification mechanism for the triple protocol to classify and count RPC request failures for both provider and consumer.
Support classification: timeout, flow restriction, service unavailability, business failure and unknown error, and their aggregate version which aline with dubbo-java.
preview:


Checklist
develop