Skip to content

Commit 3a01a76

Browse files
committed
Add spec for AlwaysRecord sampler
1 parent 0b35888 commit 3a01a76

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ release.
1313

1414
- Deprecate Zipkin exporter document and make exporter implementation optional.
1515
([#4715](https://github.com/open-telemetry/opentelemetry-specification/pull/4715/))
16+
- Add spec for `AlwaysRecord` sampler
17+
([#4699](https://github.com/open-telemetry/opentelemetry-specification/pull/4699))
1618

1719
### Metrics
1820

spec-compliance-matrix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ formats is required. Implementing more than one format is optional.
9090
| [Support W3C Trace Context Level 2 randomness](specification/trace/sdk.md#traceid-randomness) | X | - | | | | | | | | | | |
9191
| [TraceIdRatioBased sampler implements OpenTelemetry tracestate `th` field](specification/trace/sdk.md#traceidratiobased) | X | - | | | | | | | | | | |
9292
| [CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler) | X | - | | | | | | | | | | |
93+
| [Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord) | X | | | | | | | | | | | |
9394

9495
## Baggage
9596

specification/trace/sdk.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ weight: 3
4141
- [Compatibility warnings for `ProbabilitySampler`](#compatibility-warnings-for-probabilitysampler)
4242
+ [ParentBased](#parentbased)
4343
+ [JaegerRemoteSampler](#jaegerremotesampler)
44+
+ [AlwaysRecord](#alwaysrecord)
4445
+ [CompositeSampler](#compositesampler)
4546
- [ComposableSampler](#composablesampler)
4647
* [GetSamplingIntent](#getsamplingintent)
@@ -603,6 +604,25 @@ The following configuration properties should be available when creating the sam
603604
[jaeger-remote-sampling-api]: https://www.jaegertracing.io/docs/1.41/architecture/apis/#remote-sampling-configuration-stable
604605
[jaeger-adaptive-sampling]: https://www.jaegertracing.io/docs/1.41/architecture/sampling/#adaptive-sampling
605606

607+
#### AlwaysRecord
608+
609+
**Status**: [Development](../document-status.md)
610+
611+
`AlwaysRecord` is a sampler decorator that ensures every span is passed to
612+
the `SpanProcessor`, even those that would normally be dropped. It does this
613+
by converting `DROP` decisions from the wrapped sampler into `RECORD_ONLY`,
614+
decisions, allowing processors to see all spans without sending them to
615+
exporters. This enables accurate span-to-metrics processing.
616+
617+
* Root sampler returns `DROP` -> AlwaysRecord returns `RECORD_ONLY`
618+
* Root sampler returns `RECORD_ONLY` -> AlwaysRecord returns `RECORD_ONLY`
619+
* Root sampler returns `RECORD_AND_SAMPLE` -> AlwaysRecord returns `RECORD_AND_SAMPLE`
620+
621+
Required parameters:
622+
623+
* `root(Sampler)` - The sampler being wrapped; it provides the original
624+
sample/drop decision that AlwaysRecord modifies.
625+
606626
#### CompositeSampler
607627

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

0 commit comments

Comments
 (0)