-
Notifications
You must be signed in to change notification settings - Fork 292
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
[wcf] Add AspNet parent span correction #1342
[wcf] Add AspNet parent span correction #1342
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1342 +/- ##
==========================================
+ Coverage 73.91% 79.78% +5.87%
==========================================
Files 267 174 -93
Lines 9615 4967 -4648
==========================================
- Hits 7107 3963 -3144
+ Misses 2508 1004 -1504
Flags with carried forward coverage won't be shown. Click here to find out more.
|
18eb6d1
to
5491519
Compare
examples/wcf/server-aspnetframework/Examples.Wcf.Server.AspNetFramework.csproj
Show resolved
Hide resolved
private const string TelemetryHttpModuleTypeName = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, PublicKeyToken=7bd6737fe5b67e3c"; | ||
private const string TelemetryHttpModuleOptionsTypeName = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModuleOptions, OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, PublicKeyToken=7bd6737fe5b67e3c"; |
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.
As I remember usually we handle two cases (at least for internal tests visiblity) - with and withoud public key. Depending on library has this key or no.
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 couldn't actually find anywhere referencing other assemblies using their strong name, so I've updated this one to be consistent with the others and just not include the PublicKeyToken at all.
src/OpenTelemetry.Instrumentation.Wcf/Implementation/WcfInstrumentationEventSource.cs
Outdated
Show resolved
Hide resolved
582e5d5
to
c28fa63
Compare
c28fa63
to
c02a8d0
Compare
@Kielek I have updated the new example to the new csproj format, and have addressed all other review comments. 👍 |
@CodeBlanch. could you pleas also review? |
@repl-chris, question not related to this PR. You are havilly working on WCF instrumentation, it is great, any chance that you help with enabling nullable feature? See #894 Separate PR. |
yeah, I can probably do the WCF-related projects 👍 |
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.
@CodeBlanch, @lachmatt, LGTM, could you please check it also?
LGTM |
examples/wcf/server-aspnetframework/Examples.Wcf.Server.AspNetFramework.csproj
Outdated
Show resolved
Hide resolved
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
@repl-chris I don't see a CHANGELOG update would you mind adding a note in there and then I think we are good to merge. |
@CodeBlanch Added CHANGELOG, good to go 👍 |
Fixes #1243
Changes
Execution context does not flow from ASP.NET to WCF, so when ASP.NET instrumentation is enabled the WCF span ends up being a sibling of the ASP.NET span, rather than a child of it. This PR hooks into the ASP.NET instrumentation and overrides the incoming request headers with the ASP.NET span, which forces it to propagate into WCF so we get the correct parent. Unfortunately, in order to do this it required reflection of a non-public property (NameValueCollection.IsReadOnly)...it's not ideal but it's the only way I could get it to work, and it will degrade gracefully back to the current behavior if it ever changes (but really, this is only for netframework so it won't ever change)
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes