fix(instrumentation-grpc): instrument @grpc/grpc-js Client methods#3804
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3804 +/- ##
==========================================
+ Coverage 92.31% 92.35% +0.03%
==========================================
Files 321 321
Lines 9189 9249 +60
Branches 1953 1962 +9
==========================================
+ Hits 8483 8542 +59
- Misses 706 707 +1
|
7e1976f to
f0448f4
Compare
|
Anything blocking getting this merged? Ive run into this issue also |
Currently, this is just missing reviews from @open-telemetry/javascript-approvers - we'll need to get at least one green check to merge, though I'd like to have at least two as this is quite a significant change. I don't know if the original authors of this instrumentation are still around, which further complicates the process. |
Flarna
left a comment
There was a problem hiding this comment.
left a few comments but as I'm not an grpc expert may review doesn't cover all these inner grpc details.
1b468aa to
4b681f4
Compare
1bbe68d to
6e38f0f
Compare
|
Sorry for the force-push - I must've messed up my history somewhere and there were too many commits to figure out where it went wrong. 😞 |
pichlermarc
left a comment
There was a problem hiding this comment.
@Flarna, thank you for the review; it has been extremely helpful as I'm not as familiar with writing instrumentations as I'd like to be - I made some quite substantial changes since the last review based on your suggestions. 🙂
I added a few questions to your comments - mostly regarding modifying the pre-existing code that I moved to helper functions.
dyladan
left a comment
There was a problem hiding this comment.
Really large change and I'm also not a grpc expert but it looks ok to me
|
Hey @pichlermarc, would it be possible to merge this soon? |
Yes, sorry @beeme1mr, I was out for a while and did not notice we already have enough approvals now. Failing EOL tests are unrelated (see #4030) |
|
/easycla Edit: looks like easycla is broken right now. linuxfoundation/easycla#4071, we'll have to wait until it's back. |
|
I think this lead to #4053 (but not sure, just digging around a bit)! |
Which problem is this PR solving?
Traces when using the
@openfeature/flagd-providerare not connected as the@grpc/grpc-jsClientmethods used by@protobuf-ts/grpc-transportare not instrumented, (see instance creation, makeUnaryRequest, makeServerStreamRequest, makeClientStreamRequest, makeBidiStreamRequest) .This was presumably not added initially as the
Clientclass is only used via its prototype in clients generated bymakeGenericClientConstructor()/makeClientConstructor(), which means that patching the methods on theClientclass would not cause the patched method ever to be used.Because clients generated by
makeGenericClientConstructor()/makeClientConstructor()do not use the patched methods, it is possible to add instrumentation to those methods and not affect telemetry generated by the existing instrumentation code. This PR patches these un-instrumented client methods to provide context propagation and telemetry generation when theClientis used directly.Fixes #3775
Short description of the changes
Adds instrumentation for the client methods
makeUnaryRequestmakeClientStreamRequestmakeServerStreamRequestmakeBidiStreamRequestType of change
I'm unsure whether to categorize this as a bugfix or a new feature. The
Clientclass in@grpc/grpc-jsis public, therefore I think it is entirely possible that people would use the class directly, as is the case in@protobuf-ts/grpc-transportHow Has This Been Tested?
@grpc/grpc-js@openfeature/flagd-providerChecklist: