Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no method to remove the Source #4371

Closed
harshchaurasia2020 opened this issue Apr 6, 2023 · 4 comments
Closed

There is no method to remove the Source #4371

harshchaurasia2020 opened this issue Apr 6, 2023 · 4 comments
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@harshchaurasia2020
Copy link

harshchaurasia2020 commented Apr 6, 2023

Bug Report

We have AddSource feature in TraceProviderBuilder which is used for adding source.
But there is no feature available to Remove the source.

For example, if I need to enable/disable tracing for a particular source, there is no way to do it.

Also, I using HasListener property to determine if Source is added/removed.

@harshchaurasia2020 harshchaurasia2020 added the bug Something isn't working label Apr 6, 2023
@cijothomas cijothomas added enhancement New feature or request and removed bug Something isn't working labels Apr 7, 2023
@cijothomas
Copy link
Member

if I need to enable/disable tracing for a particular source, there is no way to do it.

All sources are opt-in. If a particular source is not desired, then simply not add it !

Or are you asking about how do I AddSource(), and then change mind, and RemoveSource()? Can you give a example scenario, so we can understand better what is the end goal.

@lmolkova
Copy link

Adding context with specific scenario:

E.g. I do AddSource("Azure.*") and then I get all the sources emitted by Azure SDK.
Then I find that Azure.Http.Request is noisy and not helpful and want to exclude it. Then my alternative is to find out what are all the sources I listen to from Azure SDK and enable them with AddSource("Azure.Storage.*) AddSource("Azure.ServiceBus.*").
Now also every time I add something I need to explicitly list new sources.

Another similar case: distro enables a bunch or sources for me but I want to exclude some.

I'd like to have AddSource(Predicate<string> filter) API in addition to (undocumented?) wildcards which could resolve at least some of those cases.

Removing a source would be more controversial and could better be done via extra filter:
e.g. distro calls into AddSource("Azure.*")
user can override it with something like ConfigureTracingProvider(tp -> tp.FilterSources(Predicate<string> filter))

Copy link
Contributor

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Nov 13, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this issue is still a concern.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants