-
Notifications
You must be signed in to change notification settings - Fork 765
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
Http Instrumentation: Fix gRPC causing issues retrieving request & response objects #2698
Http Instrumentation: Fix gRPC causing issues retrieving request & response objects #2698
Conversation
…ation being sent different payloads.
Codecov Report
@@ Coverage Diff @@
## main #2698 +/- ##
==========================================
+ Coverage 83.80% 83.81% +0.01%
==========================================
Files 250 250
Lines 8828 8830 +2
==========================================
+ Hits 7398 7401 +3
+ Misses 1430 1429 -1
|
Assert.True(fetch.TryFetch(new PayloadTypeB(), out propertyValue)); | ||
Assert.Equal("B", propertyValue); |
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.
Interesting, so if most of the fetches are against PayloadTypeB
but the first invocation for a process is against PayloadTypeA
there'll always be a fetch first assuming A
and then another for B
. Probably not a huge deal overhead-wise, but just explicitly calling it out.
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.
Ya if you look at the issue it looks like some kind of Azure Functions thing where it always does a gRPC call first. So for native HttpClient invocations in that environment, it is going to pay the penalty of a failed is
check and then an extra virtual dispatch on each call. Very minor hit, but a hit nonetheless. Not much we can do about it. If we instead did a dictionary lookup, we would have to pay for a hash + lookup for all invocations even in cases where only one payload is ever used. So this seemed like the lesser evil. Kind of lame this gRPC path uses the same diagnostic source but with different payload types.
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.
LGTM
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Fixed an issue with `Filter` and `Enrich` callbacks not firing under certain | |||
conditions when gRPC is used | |||
([#2698](https://github.com/open-telemetry/opentelemetry-dotnet/issues/2698)) |
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.
I think you meant to link the PR not the issue
(#2698)
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.
Fixes #2652
Changes
PropertyFetcher
is given a different payload type than what was used during construction, it will now build an inner instance and defer to that. We could have also looked up the correctPropertyFetcher
from some kind of dictionary (by payload type), but I went with this design to keep the common path (where only a single payload type is used) fast/lock-free.TODOs
CHANGELOG.md
updated for non-trivial changes