Skip to content

Conversation

@majanjua-amzn
Copy link

NOTE: PR created to be discussed in next relevant SIG meeting

Fixes #4698

Changes

Adds the spec for a new AlwaysRecord sampler being proposed in #4698

Notes

Solutions to this problem in multiple supported languages can already be found below:

Checklist

Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

Looks good to me. As we discussed in Sampling SIG, it will help readers to be reminded somewhere in this text that Exporters are already expected to drop these spans, all we're doing is making it easy to setup non-sampling recorded spans by default.

@majanjua-amzn majanjua-amzn marked this pull request as ready for review October 28, 2025 17:04
@majanjua-amzn majanjua-amzn requested review from a team as code owners October 28, 2025 17:04
- Other root spans are sampled at 10%
- Child spans follow their parent's sampling decision

#### AlwaysRecord
Copy link
Member

Choose a reason for hiding this comment

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

#nit: I think we should put this above the CompositeSampler to avoid it being confused as a Built-In ComposableSampler.

Sampling SIG: does it make sense to add a Built-In ComposableSampler variation of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ping @majanjua-amzn

(also we need a CHANGELOG entry)

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to the suggested ordering from @jack-berg

**Status**: [Development](../document-status.md)

This is a sampler decorator. `AlwaysRecord` helps to have spans between always be processed by `SpanProcessor`s. It returns the following given a sampled flag from the root sampler:
* Root sampler returns `DROP` -> AlwaysRecord returns `RECORD_ONLY`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Root sampler returns `DROP` -> AlwaysRecord returns `RECORD_ONLY`
* Root sampler returns `DROP` -> AlwaysRecord returns `RECORD_ONLY`


**Status**: [Development](../document-status.md)

This is a sampler decorator. `AlwaysRecord` helps to have spans between always be processed by `SpanProcessor`s. It returns the following given a sampled flag from the root sampler:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make the line length wrapping consistent with the reset of the document and the rest of the changes here.

* Root sampler returns `RECORD_ONLY` -> AlwaysRecord returns `RECORD_ONLY`
* Root sampler returns `RECORD_AND_SAMPLE` -> AlwaysRecord returns `RECORD_AND_SAMPLE`

**Required parameters:**
Copy link
Contributor

Choose a reason for hiding this comment

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

Following formatting from the rest of this document.

Suggested change
**Required parameters:**
Required parameters:

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.

Always process spans / AlwaysRecord Sampler

6 participants