Ejemplo
TracerProvider defaults to ParentBased(AlwaysSample()) when WithSampler is unset, embedding specification sampler names AlwaysOnSampler and AlwaysOffSampler in its description
sha256:5f70d2ba9888e84e798c0e4450c4dc578490ff9c7590558fccf61ea53919fef3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- go
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- go
- Lenguaje
- go
- Gestor de paquetes
- gomod
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- go 1.26
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- go 1.26
- Lenguaje
- go
- Gestor de paquetes
- gomod
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Caso
- Objetivo
- TracerProvider defaults to ParentBased(AlwaysSample()) when WithSampler is unset, embedding specification sampler names AlwaysOnSampler and AlwaysOffSampler in its description HOW
- Paquetes
-
go.opentelemetry.io/otel/sdk v1.37.0
- Entorno
- go
- Creado
- 2026-08-17T06:41:52Z
Lo que suele suponerse
AlwaysSample().Description() returns "AlwaysSample" and NeverSample().Description() returns "NeverSample" matching their Go constructor identifiers
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- AlwaysSample().Description() returns "AlwaysOnSampler" and NeverSample().Description() returns "AlwaysOffSampler" using OpenTelemetry specification names rather than Go constructor names
- ParentBased(AlwaysSample()).Description() composes the spec names into ParentBased{root:AlwaysOnSampler,remoteParentSampled:AlwaysOnSampler,remoteParentNotSampled:AlwaysOffSampler,localParentSampled:AlwaysOnSampler,localParentNotSampled:AlwaysOffSampler}
- NewTracerProvider() without WithSampler samples root spans by default
- NewTracerProvider() without WithSampler honors remote unsampled parent contexts by dropping child spans
- NewTracerProvider() without WithSampler honors remote sampled parent contexts by sampling child spans
Archivos
- NOTES.md
- csx.json
- defaultsampler_test.go
- go.mod
- go.sum
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9