-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(grpc): allow custom error_handler for client interceptor #3095
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 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much, @rfwroo! 🙇
👋 @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
@@ 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 see 11 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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::Client
to pass theerror_handler
into theTracing.trace
callDatadogInterceptor::Base
to 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.client
spans 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!