fix(grpc): allow custom error_handler for client interceptor#3095
Conversation
74b8a59 to
22d20fb
Compare
|
👋 @rfwroo , this looks promising. Let me take some time to play with and give feedback about this 😄 |
|
👋 @rfwroo , do you think it make sense to add a new configuration settings for the client's error handler instead of sharing the same error handler? |
|
Hey @TonyCTHsu,
Assuming that you mean the global error handler (i.e. Allowing a global error handler for each span kind sounds neat 👍 I could follow up with a separate PR if you're happy to merge this as-is? |
|
👋 @rfwroo, Sorry for my late reply. Currently, there is only one In order to have a smoother upgrade to other users, could you implement a new configuration option |
|
@TonyCTHsu that sounds good.
Would it make sense to also add a new |
We want to avoid changes for the existing user, so deprecating without removing it makes sense to me. 😄 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3095 +/- ##
==========================================
- Coverage 98.15% 98.15% -0.01%
==========================================
Files 1323 1324 +1
Lines 75048 75103 +55
Branches 3422 3427 +5
==========================================
+ Hits 73665 73718 +53
- Misses 1383 1385 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What does this PR do?
In #1583, the option of passing a custom error_handler to gRPC interceptors was added. This is useful for e.g. selectively marking certain gRPC status codes as an APM error.
However, the change was implemented only for gRPC server interceptors. This patch:
DatadogInterceptor::Clientto pass theerror_handlerinto theTracing.tracecallDatadogInterceptor::Baseto read the error_handler from the interceptor itself (i.e. what's passed here) instead of the default/global configuration. It's not clear why this wasn't needed for the Server interceptor.Motivation:
To allow
grpc.clientspans to be selectively marked as errors based on gRPC status codes.Additional Notes:
N/A
How to test the change?
Example:
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!