Skip to content

How do you add an System.Diagnostics.ActivitySource as a source to a builder such that you can have Activites flows to the tracer #3377

Answered by dxk3355
dxk3355 asked this question in Q&A
Discussion options

You must be logged in to vote

So I finally figured out the issue, I was already doing like you said as far as the ActivitySources are concerned. Though I don't really understand the reason that there's no overload to provide the ActivitySource reference. The underlying problem I was having is I'm not using StartActivity in the simple way since I want to add the ActivityContext to the event with the trace id that I'm setting. The ActivityContext needs to have the ActivityTraceFlags set to ActivityTraceFlags.Recorded or the event does not flow out of the AddOtlpExporter. When you do StartActivity(string) it appears that this is not an issue.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dxk3355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants