-
Notifications
You must be signed in to change notification settings - Fork 815
OpenTelemetry instrumentation for xUnit tests #18230
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
Conversation
✅ No release notes required |
Locally I don't see any significant performance penalty for enabling 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.
That's cool, thank you!
@@ -139,9 +146,24 @@ type FSharpXunitFramework(sink: IMessageSink) = | |||
log "FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection" | |||
TestConsole.install() | |||
|
|||
// TODO: Currently does not work with Desktop .NET Framework. Upcoming OpenTelemetry 1.11.0 may change it. |
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.
out of curiosity, what makes you think 1.11 will enable .NET Framework support for OTel? I don't see anything in the release notes or changelog to suggest that.
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.
Is it this new builder pattern?
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.
They say they're dropping the quasi-deprecated gRpc.Core. When I tried it here, grpc just fails silently (exception can be observed in debug mode) during runtime on desktop target.
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.
May be wishful thinking on my part, though!
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 just did a quick test with console app. Otel 1.9.0 does work in general with net472, just not here in this repo, for some reason.
Some tests were already instrumented ad-hoc.
This applies the instrumentation to the whole test assembly instead, so no additional work is needed to capture any test case.
Also replace deprecated Jaeger package.
It seems to work locally, at least with the net9.0 target.
Traces can be inspected in Jager all-in-one. If nothing interesting is produced, at least the test case name and duration is captured.