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

Default Listening model for ActivitySource #736

Closed
cijothomas opened this issue Jun 17, 2020 · 7 comments
Closed

Default Listening model for ActivitySource #736

cijothomas opened this issue Jun 17, 2020 · 7 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@cijothomas
Copy link
Member

cijothomas commented Jun 17, 2020

The current SDK behavior is to listen to only those ActivitySources which are explicitly configured by the user.

https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Configuration/OpenTelemetrySdk.cs#L89

Adding a ActivitySource is done using builder.AddActivitySource()
https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Configuration/OpenTelemetryBuilder.cs#L74

Opening this issue here to gather feedback on this approach. Alternate approach is to listen to every ActivitySource in the process, except those explicitly disabled. This may be too much noise, but can be controlled by selectively disabling.

(We can also explore if we want to do filtering similar to Ilogger (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.2#log-filtering). Something like "collect all activities from sources starting with "System.Data.Sql" etc.)

The immediate goal is to seek opinion on the current model - nothing is listened by default. Users must add ActivitySources they are interested in.

@cijothomas cijothomas added the question Further information is requested label Jun 17, 2020
@CodeBlanch
Copy link
Member

I like the idea of using filtering akin to ILogger. A simple Filter<string, bool> callback we invoke during ShouldListenTo would probably go a long way too; easy to pass when building up the SDK, and users can make it config-driven if they want.

@cijothomas
Copy link
Member Author

Added this as required-for-ga. This is a critical portion of OTel enablement experience, so need to ensure this is correctly handled before GA.

@cijothomas
Copy link
Member Author

The general consensus from several SIG meeting was that, its best to opt-in to each ActivitySources of interest, rather than subscribing to all by default. This will be made clear in the instrumentation doc as well.
Additionally, the AddSource() api supports wildcard () now, so it must be easy to subscribe to multiple source. For eg: AddSource("CompanyName.Product.") will listen to all ActivitySources starting with "CompanyName.Product."

@christopher-taormina-zocdoc
Copy link
Contributor

@cijothomas sorry to comment on this issue, but does the AddSource() call support wildcards? I tried adding a source as "Zocdoc." but that didn't seem to capture a source of "Zocdoc.Http".

@cijothomas
Copy link
Member Author

"Zocdoc.*" should cover it

@christopher-taormina-zocdoc
Copy link
Contributor

Oh sorry I missed the example entirely. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants