Skip to content

Support for OTEL_TRACES_SAMPLER #37301

Open
@CaerusKaru

Description

@CaerusKaru

Is your feature request related to a problem? Please describe.

The OpenTelemetry Python library has support for many default sampling schemes. Some of these allow for configuring sampling not based on a probabilistic rate, but instead on the context of the parent span. In an instance where most tracing should be ignored, except parent spans, this is incredibly useful to reduce noise. Our explicit example is an application instrumented for long polling, where we only want to capture data for inbound requests, where the trace context is retrieved from the queue. We don't want 99.99% of all traffic sampled, but we do want the inbound requests to be captured, assuming the context is properly set on those spans.

Describe the solution you'd like

Right now, this library assumes a probabilistic sampling, with explicit support for OTEL_TRACES_SAMPLER_ARG. This should be extended to also support OTEL_TRACES_SAMPLER, where the underlying logic can be shared in terms of setting up the context on the samples, but the decision on when/how to sample should be abstracted to the underlying library, allowing support of multiple sampler types.

Describe alternatives you've considered

The only other way to achieve this is to literally rip out and replace the trace sampler from the library, pretty much doing what I said above, just without explicit support.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Monitor - DistroMonitor OpenTelemetry DistroService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions