diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ad8acd3c28..7639df94dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ release. - Deprecate Zipkin exporter document and make exporter implementation optional. ([#4715](https://github.com/open-telemetry/opentelemetry-specification/pull/4715/)) +- Add spec for `AlwaysRecord` sampler + ([#4699](https://github.com/open-telemetry/opentelemetry-specification/pull/4699)) ### Metrics diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 5c7431693bd..73009a2f39a 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -90,6 +90,7 @@ formats is required. Implementing more than one format is optional. | [Support W3C Trace Context Level 2 randomness](specification/trace/sdk.md#traceid-randomness) | X | - | | | | | | | | | | | | [TraceIdRatioBased sampler implements OpenTelemetry tracestate `th` field](specification/trace/sdk.md#traceidratiobased) | X | - | | | | | | | | | | | | [CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler) | X | - | | | | | | | | | | | +| [Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord) | | - | | | | | | | | | | | ## Baggage diff --git a/spec-compliance-matrix/cpp.yaml b/spec-compliance-matrix/cpp.yaml index 27f73fdc581..07b0d129d86 100644 --- a/spec-compliance-matrix/cpp.yaml +++ b/spec-compliance-matrix/cpp.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/dotnet.yaml b/spec-compliance-matrix/dotnet.yaml index be292770c18..6f28d756f0e 100644 --- a/spec-compliance-matrix/dotnet.yaml +++ b/spec-compliance-matrix/dotnet.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/erlang.yaml b/spec-compliance-matrix/erlang.yaml index a511671fe8c..ca46909a824 100644 --- a/spec-compliance-matrix/erlang.yaml +++ b/spec-compliance-matrix/erlang.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/go.yaml b/spec-compliance-matrix/go.yaml index 1686ed52fb7..e7c8da52c71 100644 --- a/spec-compliance-matrix/go.yaml +++ b/spec-compliance-matrix/go.yaml @@ -157,6 +157,8 @@ sections: status: '-' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '-' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '-' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/java.yaml b/spec-compliance-matrix/java.yaml index 9f0bbe5ed94..3c299b301bd 100644 --- a/spec-compliance-matrix/java.yaml +++ b/spec-compliance-matrix/java.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/js.yaml b/spec-compliance-matrix/js.yaml index 42c0e4f2b43..d0fc61bb023 100644 --- a/spec-compliance-matrix/js.yaml +++ b/spec-compliance-matrix/js.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/php.yaml b/spec-compliance-matrix/php.yaml index 6cfa96fdb52..a7c6ebdb12c 100644 --- a/spec-compliance-matrix/php.yaml +++ b/spec-compliance-matrix/php.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/python.yaml b/spec-compliance-matrix/python.yaml index d38947bf448..27001771e23 100644 --- a/spec-compliance-matrix/python.yaml +++ b/spec-compliance-matrix/python.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/ruby.yaml b/spec-compliance-matrix/ruby.yaml index d552ba7b83d..603d5138c43 100644 --- a/spec-compliance-matrix/ruby.yaml +++ b/spec-compliance-matrix/ruby.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/rust.yaml b/spec-compliance-matrix/rust.yaml index f9c42583095..e5af529a9ff 100644 --- a/spec-compliance-matrix/rust.yaml +++ b/spec-compliance-matrix/rust.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/swift.yaml b/spec-compliance-matrix/swift.yaml index 76d9ef90a39..46ae2ef7a27 100644 --- a/spec-compliance-matrix/swift.yaml +++ b/spec-compliance-matrix/swift.yaml @@ -157,6 +157,8 @@ sections: status: '?' - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' status: '?' + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' + status: '?' - name: Baggage features: - name: Basic support diff --git a/spec-compliance-matrix/template.yaml b/spec-compliance-matrix/template.yaml index 82078059256..45eb72468f4 100644 --- a/spec-compliance-matrix/template.yaml +++ b/spec-compliance-matrix/template.yaml @@ -117,6 +117,7 @@ sections: optional: true - name: '[CompositeSampler and built-in ComposableSamplers](specification/trace/sdk.md#compositesampler)' optional: true + - name: '[Sampler: AlwaysRecord](specification/trace/sdk.md#alwaysrecord)' - name: Baggage features: - name: Basic support diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 4542b9cfcee..0eea835c40e 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -41,6 +41,7 @@ weight: 3 - [Compatibility warnings for `ProbabilitySampler`](#compatibility-warnings-for-probabilitysampler) + [ParentBased](#parentbased) + [JaegerRemoteSampler](#jaegerremotesampler) + + [AlwaysRecord](#alwaysrecord) + [CompositeSampler](#compositesampler) - [ComposableSampler](#composablesampler) * [GetSamplingIntent](#getsamplingintent) @@ -603,6 +604,30 @@ The following configuration properties should be available when creating the sam [jaeger-remote-sampling-api]: https://www.jaegertracing.io/docs/1.41/architecture/apis/#remote-sampling-configuration-stable [jaeger-adaptive-sampling]: https://www.jaegertracing.io/docs/1.41/architecture/sampling/#adaptive-sampling +#### AlwaysRecord + +**Status**: [Development](../document-status.md) + +`AlwaysRecord` is a sampler decorator that ensures every span is passed to +the `SpanProcessor`, even those that would normally be dropped. It does this +by converting `DROP` decisions from the wrapped sampler into `RECORD_ONLY` +decisions, allowing processors to see all spans without sending them to +exporters. This is typically used to enable accurate span-to-metrics processing. + +Based on the decision from the wrapped root sampler, `AlwaysRecord` MUST behave +as follows: + +| Root sampler decision | AlwaysRecord decision | +|-----------------------|-----------------------| +| `DROP` | `RECORD_ONLY` | +| `RECORD_ONLY` | `RECORD_ONLY` | +| `RECORD_AND_SAMPLE` | `RECORD_AND_SAMPLE` | + +Required parameters: + +* `root(Sampler)` - The sampler being wrapped; it provides the original +sample/drop decision that AlwaysRecord modifies. + #### CompositeSampler **Status**: [Development](../document-status.md)