-
Notifications
You must be signed in to change notification settings - Fork 362
[Instrumentation.Hangfire] Fix 'FailedToInjectActivityContext' when no ActivityContext exists #2990
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
[Instrumentation.Hangfire] Fix 'FailedToInjectActivityContext' when no ActivityContext exists #2990
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2990 +/- ##
==========================================
- Coverage 69.79% 69.70% -0.09%
==========================================
Files 386 388 +2
Lines 15917 15850 -67
==========================================
- Hits 11109 11048 -61
+ Misses 4808 4802 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
...lemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs
Outdated
Show resolved
Hide resolved
...lemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs
Outdated
Show resolved
Hide resolved
test/OpenTelemetry.Instrumentation.Hangfire.Tests/OpenTelemetryEventListener.cs
Outdated
Show resolved
Hide resolved
| using var tel = Sdk.CreateTracerProviderBuilder() | ||
| .AddHangfireInstrumentation() | ||
| .AddInMemoryExporter(exportedItems) | ||
| .SetSampler<AlwaysOnSampler>() |
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.
For some reason, this test started to fail intermittently when I added a new test. I guess it's related to the static configuration in the HangfireFixture. Adding AlwaysOnSampler seems to fix/workaround it.
…fireInstrumentationJobFilterAttribute.cs Co-authored-by: Martin Costello <[email protected]>
…fireInstrumentationJobFilterAttribute.cs Co-authored-by: Martin Costello <[email protected]>
|
@fred2u, FYI |
Fixes #
Design discussion issue #
Changes
The
HangfireInstrumentationJobFilterAttributewas trying to inject a defaultActivityContextwhen there was no activity. This is not supported by the TraceContextPropagator and was leading to EventSource messageMerge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes