Is there a way to globally set some Activity as a parent in case an Activity is ever created without a parent? #6499
Unanswered
thecristidima
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say we have a library that among other things exposes an
ActivitySourceand users use it to create Activities. We're trying to find a way to be able to always have a parent for activities created without a parent.A very basic example:
What we tried is creating an
ActivityListenerand on theSamplemethod we setActivity.Current = defaultParentwhich seems to work until we actually use OpenTelemetry (unclear why, but it feels hacky anyway).Is there a way to actually make this happen? My gut feeling is no or at least not without a seriously hacky way, but the idea of having a default parent sounds like something that should work.
Beta Was this translation helpful? Give feedback.
All reactions