Recommended pattern to override activity sources at startup #6424
Unanswered
ilya-chumakov
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Could you please consider Collector to manipulate your data? I think that it is most powerfully way to do this. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
What is the question?
For a configuration like this, is there a way to exclude some sources from the output after all calls to
.Add__Instrumentation()
have been made? For example: temporarily mute a source without having to rebuild the app.The ultimate goal is to have fine-grained control over sources per environment, without having to wrap each
Add__Instrumentation()
call in a conditional block (which even may not work, since multiple sources could be added to the list per such call). The source list is essentially aList<string>
, but due to the multiple implementations ofTracerProviderBuilder
, the access to that property is not that straightforward even via reflection or type cast (which alone is a very bad practice, of course).Additional context
.NET 9
Beta Was this translation helpful? Give feedback.
All reactions