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

SamplingParameters does not include the activity source #4752

Closed
WeihanLi opened this issue Aug 8, 2023 · 3 comments
Closed

SamplingParameters does not include the activity source #4752

WeihanLi opened this issue Aug 8, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@WeihanLi
Copy link
Contributor

WeihanLi commented Aug 8, 2023

Feature Request

Include the activity source into the SamplingParameters,

Is your feature request related to a problem?

We want to implement a TraceIdRatioBasedSampler based sampler, we want to use a different ratio for different activity sources, currently, the SamplingParameters does not have an ActivitySource, while there's ActivitySource in the ActivityCreationOptions which be used to determine the ActivitySamplingResult

https://github.com/dotnet/runtime/blob/v6.0.0/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityCreationOptions.cs

https://github.com/dotnet/runtime/blob/v6.0.0/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySamplingResult.cs

Describe the solution you'd like:

Maybe we could add the ActivitySource to the SamplingParameters, so that we could use different sampler for different activity source

@WeihanLi WeihanLi added the enhancement New feature or request label Aug 8, 2023
@vishweshbankwar
Copy link
Member

@WeihanLi This is by design as per specification

@WeihanLi
Copy link
Contributor Author

WeihanLi commented Aug 9, 2023

@vishweshbankwar thanks very much, is there any workaround solution to implement different sampling logic according to the activity source?

@cijothomas
Copy link
Member

@vishweshbankwar thanks very much, is there any workaround solution to implement different sampling logic according to the activity source?

https://github.com/open-telemetry/opentelemetry-specification/pull/1942/files

I think its best asked in spec, as this was added then reverted in spec itself.

You may multiple TracerProviders with diff. sampler, and have them enble diff. ActivitySources as a hacky workaround.

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

No branches or pull requests

3 participants