Beispiel
ParentBased sampler delegates sampled remote parents to AlwaysSample and unsampled parents to NeverSample by default, overriding the root sampler configuration for any context containing a valid parent span
sha256:53b6e958b9713543736332d7b7f87d665da9d8c7c6468e96529ad968c51148fc
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- go
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- go
- Sprache
- go
- Paketmanager
- go
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- go 1.26
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- go 1.26
- Sprache
- go
- Paketmanager
- go
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Fall
- Ziel
- ParentBased sampler delegates sampled remote parents to AlwaysSample and unsampled parents to NeverSample by default, overriding the root sampler configuration for any context containing a valid parent span HOW
- Pakete
-
go.opentelemetry.io/otel/sdk v1.24.0
- Umgebung
- go
- Erstellt
- 2026-08-17T06:42:33Z
Häufige Annahme
ParentBased(NeverSample()) disables span sampling across all spans created by the TracerProvider
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- ParentBased(NeverSample()) samples and exports child spans when the context contains a sampled remote parent, because ParentBased delegates sampled remote parents to AlwaysSample() by default rather than the configured root sampler.
- ParentBased(AlwaysSample()) drops and suppresses child spans when the context contains an unsampled remote or local parent, because ParentBased delegates unsampled parents to NeverSample() by default.
- Only root spans without a valid parent context evaluate the root sampler passed to ParentBased.
- ParentBased.Description() returns a composite string reflecting the root sampler and all four default sub-samplers.
Dateien
- NOTES.md
- csx.json
- go.mod
- go.sum
- tracer_test.go
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9