-
Notifications
You must be signed in to change notification settings - Fork 837
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
feat: allow to add attributes from grpc metadata in the patched server #3589
feat: allow to add attributes from grpc metadata in the patched server #3589
Conversation
…adataToSpanAttributes Signed-off-by: Xavier Serrano <[email protected]>
|
Signed-off-by: Xavier Serrano <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3589 +/- ##
==========================================
+ Coverage 90.56% 93.64% +3.08%
==========================================
Files 84 275 +191
Lines 1802 8090 +6288
Branches 362 1679 +1317
==========================================
+ Hits 1632 7576 +5944
- Misses 170 514 +344
|
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 for working on this! Just left a few comments.
…ntation Signed-off-by: Xavier Serrano <[email protected]>
Which problem is this PR solving?
It's not possible to add span attributes using the metadata in the gRPC server side.
The metadataToSpanAttributes config option from
opentelemetry-instrumentation-grpc
is not working for server calls according to the issue #3534Short description of the changes
The change allows to configure the metadata keys that have to be added to the span attributes following the same way as client side. The request metadata capturing is done before handle the server and the response metadata capturing is done patching the "sendMetadata" method from the server call.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
In the current
opentelemetry-instrumentation-grpc
tests, adding the server part in metadataToSpanAttributes config and contemplating the result in the span attributes validation.Checklist: