opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Add AlwaysRecordSampler

Open majanjua-amzn opened this issue 1 month ago • 2 comments

Description

Adds a new AlwaysRecordSampler as per:

  • Spec issue: https://github.com/open-telemetry/opentelemetry-specification/issues/4698
  • Spec PR: https://github.com/open-telemetry/opentelemetry-specification/pull/4699

This sampler behaves the same as it's root sampler, with the exception that it will replace any DROP decisions with an equivalent RECORD one, while maintaining the attributes and trace state from the decision created by the root sampler.

Also renamed the folder holding the tests for experimental sampling features from composite_sampler to sampling_experimental, as more than just the composite sampler is being tested in this folder, respecting the organization of the files in the src folder.

Type of change

  • [x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Unit tests

Does This PR Require a Contrib Repo Change?

  • [ ] Yes. - Link to PR:
  • [x] No.

Checklist:

  • [x] Followed the style guidelines of this project
  • [ ] Changelogs have been updated
  • [x] Unit tests have been added
  • [ ] Documentation has been updated

majanjua-amzn avatar Nov 28 '25 00:11 majanjua-amzn

We need to wait for the specs to be approved and released before merging this

xrmx avatar Nov 28 '25 10:11 xrmx

@xrmx spec is merged, ready for review!

majanjua-amzn avatar Dec 02 '25 18:12 majanjua-amzn