You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently make use of auto-instrumentation via the activity compatibility (our code all uses ActivitySource everywhere) and we have a situation where we'd like to create a new root span (we start a subscription to some service and want each item to be a root).
From the dotnet/runtime github this should be possible by setting Activity.Current = null before starting the activity (see dotnet/runtime#65528 (comment)), however in reality this seems to be having little effect and the spans are still being associated to the original parent.
From browsing PRs I stumbled across the following comment:
One part of the design that I think is worth mentioning in the PR description is how we handle a new "root" Activity object when there iss already an active Datadog Span: In this case, activity.Parent == null (there's no in-process parent Activity object) but we set the ParentId property to the parent Span's SpanId
Could this automatic setting of the parent id to the implicitly created DataDog parent span be the reason setting Activity.Current to null is having no effect?
If so, how are we meant to create new root spans via ActivitySource?
Many thanks!
The text was updated successfully, but these errors were encountered:
For now I have worked around this by capturing ExecutionContext on application start and restoring it before starting the child activity I want detached which appears to be working but isn't too desirable.
Uh oh!
There was an error while loading. Please reload this page.
We currently make use of auto-instrumentation via the activity compatibility (our code all uses ActivitySource everywhere) and we have a situation where we'd like to create a new root span (we start a subscription to some service and want each item to be a root).
From the dotnet/runtime github this should be possible by setting
Activity.Current = null
before starting the activity (see dotnet/runtime#65528 (comment)), however in reality this seems to be having little effect and the spans are still being associated to the original parent.Here is an example:
From browsing PRs I stumbled across the following comment:
Could this automatic setting of the parent id to the implicitly created DataDog parent span be the reason setting Activity.Current to null is having no effect?
If so, how are we meant to create new root spans via ActivitySource?
Many thanks!
The text was updated successfully, but these errors were encountered: