Skip to content

Add AlwaysRecordSampler#5354

Open
carlosalberto wants to merge 10 commits into
open-telemetry:mainfrom
carlosalberto:always-record-sampler
Open

Add AlwaysRecordSampler#5354
carlosalberto wants to merge 10 commits into
open-telemetry:mainfrom
carlosalberto:always-record-sampler

Conversation

@carlosalberto

Copy link
Copy Markdown
Contributor

Took the initial effort of #4823 and updated it to:

  • Put it in the main sampling files, as it's now stable.
  • Simplified it wherever possible, plus applying the feedback from the original PR review.

@carlosalberto
carlosalberto requested a review from a team as a code owner June 25, 2026 16:06
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/trace/sampling.py
Comment thread opentelemetry-sdk/tests/trace/test_sampling.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/trace/sampling.py
Comment thread opentelemetry-sdk/tests/trace/test_sampling.py Outdated
@github-project-automation github-project-automation Bot moved this to Reviewed PRs that need fixes in Python PR digest Jun 26, 2026
@herin049 herin049 added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Jul 3, 2026
@xrmx xrmx mentioned this pull request Jul 8, 2026
7 tasks
@xrmx xrmx moved this from Reviewed PRs that need fixes to Ready for review in Python PR digest Jul 10, 2026

@xrmx xrmx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you also need to update _KNOWN_SAMPLERS in this file and add a new entry in pyproject.toml project.entry-points.opentelemetry_traces_sampler group.

@github-project-automation github-project-automation Bot moved this from Ready for review to Reviewed PRs that need fixes in Python PR digest Jul 13, 2026
@xrmx

xrmx commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

I think you also need to update _KNOWN_SAMPLERS in this file and add a new entry in pyproject.toml project.entry-points.opentelemetry_traces_sampler group.

Uhm that would require also some update to _get_from_env_or_default for getting the root sampler

@ocelotl

ocelotl commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I think you also need to update _KNOWN_SAMPLERS in this file and add a new entry in pyproject.toml project.entry-points.opentelemetry_traces_sampler group.

@carlosalberto already replied.

@carlosalberto

Copy link
Copy Markdown
Contributor Author

@xrmx Also it hasn't been added to the env vars: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration

Known values for OTEL_TRACES_SAMPLER are:

"always_on": AlwaysOnSampler
"always_off": AlwaysOffSampler
"traceidratio": TraceIdRatioBased
"parentbased_always_on": ParentBased(root=AlwaysOnSampler)
"parentbased_always_off": ParentBased(root=AlwaysOffSampler)
"parentbased_traceidratio": ParentBased(root=TraceIdRatioBased)
"parentbased_jaeger_remote": ParentBased(root=JaegerRemoteSampler)
"jaeger_remote": JaegerRemoteSampler
"xray": [AWS X-Ray Centralized Sampling](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html) (third party)

Adding always_record to env vars may not happen at all, but it MUST be (eventually) added to declarative config.

@github-project-automation github-project-automation Bot moved this from Reviewed PRs that need fixes to Approved PRs in Python PR digest Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

5 participants