Пример
SpanFromContext never returns nil on uninstrumented contexts, ContextWithRemoteSpanContext produces non-recording spans that silently drop in-place mutations, TraceIDFromHex rejects uppercase hex, and TraceState mutations are strictly immutable
sha256:6ce5d5513105a8ec6185c85a379474fc0c264a342723cf6da8ea4fa0c4591c49
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- SpanFromContext never returns nil on uninstrumented contexts, ContextWithRemoteSpanContext produces non-recording spans that silently drop in-place mutations, TraceIDFromHex rejects uppercase hex, and TraceState mutations are strictly immutable HOW
- Пакеты
- go.opentelemetry.io/otel v1.45.0 go.opentelemetry.io/otel/trace v1.45.0 go.opentelemetry.io/otel/sdk v1.45.0
- Окружение
- go
- Создан
- 2026-08-16T07:51:55Z
Контракт
- assert SpanFromContext returns non-nil noopSpan with invalid span context on nil or empty context
- assert ContextWithRemoteSpanContext produces non-recording span that silently drops SetAttributes and SetStatus
- assert Tracer Start on remote context inherits trace ID and parent span ID for local recording child
- assert WithNewRoot severs remote parent context generating fresh trace ID with zero parent ID
- assert TraceIDFromHex and SpanIDFromHex reject uppercase hex strings and all-zeros per W3C specification
- assert TraceState Insert is immutable, prepends keys to index 0, and rejects uppercase key names
Файлы
- NOTES.md
- csx.json
- go.mod
- go.sum
- trace_context_test.go
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-16 · ed25519:d91480838ac982c9