Skip to content

Is there a GlobalTracerProvider() method which will give me a singleton tracerprovider instance? #5877

Answered by cijothomas
varkey98 asked this question in Q&A
Discussion options

You must be logged in to vote

The global is required usually to obtain Tracer (ActivitySource), Meter instances. OTel .NET allows you to do create them directly using ctors, and use AddSource, AddMeter to "connect" them to the overall sdk.

In short, you don't need it in OTel .NET. Check the examples in this repo and you'll see that they don't use/need global apis.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@varkey98
Comment options

@cijothomas
Comment options

@varkey98
Comment options

Answer selected by varkey98
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