Skip to content

clarify whether OTEL_TRACE_SAMPLER can contain a list #3830

Open
@brettmc

Description

What are you trying to achieve?

I'm trying to implement a new sampler, register it with an SDK, then enable & configure it via environment variables.

Additional context.

The OTEL_TRACES_SAMPLER section of the spec says the value holds "Sampler to be used for traces", and lists some known values which are either individual samplers or a combination (always_off, parentbased_always_on etc). In the PHP SDK, we've implemented it as an enumeration of known values since that's what all the examples look like.
However, the spec doesn't say that the field couldn't contain a list of samplers (parentbased,my_custom_sampler,always_on), which enables a couple of capabilities:

  • custom/3rd-party samplers can be added to a registry and enabled
  • samplers can be chained together in different ways without needing to enumerate all of them in the spec

So, I'd like to propose that the spec be adjusted:

  • OTEL_TRACES_SAMPLER description to include "or list of samplers as a comma-separated list"
  • list of known values to include "custom sampler name" and "or a comma-separated list of the above samplers"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

sig-issueA specific SIG should look into this before discussing at the specspec:traceRelated to the specification/trace directory

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions