Skip to content

Add schema for ProbabilitySampler#339

Merged
jack-berg merged 8 commits intoopen-telemetry:mainfrom
anuraaga:probability-def
Oct 31, 2025
Merged

Add schema for ProbabilitySampler#339
jack-berg merged 8 commits intoopen-telemetry:mainfrom
anuraaga:probability-def

Conversation

@anuraaga
Copy link
Copy Markdown
Contributor

Fixes #315

The user interface for ProbabilitySampler is identical to the legacy TraceIdRatioBasedSampler so the schema is the same.

I didn't update any examples because the sampler is still Development level and isn't provided in most SDKs yet.

@anuraaga anuraaga requested a review from a team as a code owner October 24, 2025 02:21
Comment thread schema/tracer_provider.json Outdated
}
}
},
"ProbabilitySampler": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"ProbabilitySampler": {
"ExperimentalProbabilitySampler": {

We denote experimental types with Experimental prefix

Copy link
Copy Markdown
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its good to have an example in kitchen-sink.yaml even for experimental types. Samplers are a bit of an edge case right now because you can only assign one to .tracer_provider.

Also, we're trying to keep type_descriptions.yaml up to date with descriptions describing the semantics / defaults of all properties. Currently, those descriptions manifest as comments automatically added to the example files, but with no surface in the examples, it seems kind of silly.

I'm proposing a better way to maintaining extra schema meta data in #312, which amongst other things adds build tooling guaranteeing that every property for every type has a description.

Comment thread schema/tracer_provider.json Outdated
"parent_based": {
"$ref": "#/$defs/ParentBasedSampler"
},
"probability": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anuraaga
Copy link
Copy Markdown
Contributor Author

Thanks @jack-berg - sorry for missing the note on experimental types, fixed and also updated the schemas / kitchen sink

# If omitted or null, always_off is used.
remote_parent_not_sampled:
# Configure sampler to be always_off.
always_off:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repurposed this one since always_off is already present below

Comment thread schema/tracer_provider.json Outdated
@jack-berg jack-berg merged commit 516afc9 into open-telemetry:main Oct 31, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProbabilitySampler Configuration

2 participants