示例
HeaderCarrier combined with TraceContext extracts the first traceparent header instead of rejecting multiple traceparents per W3C specification.
sha256:e10aef8833bfae44ce90347d18a34a9caf8140393a51b1a31dd6d4e1803b1742
PUBLISHED
L3_CONTRACT_PASS
MIT-0
执行证据
分开显示声明环境和签名验证运行,明确样本的证明范围。
证据依据签名契约通过
验证回执1
验证级别L3_CONTRACT_PASS
声明的环境
- 执行上下文
- go
- 操作系统
- linux
- 架构
- x64
- 运行时
- go
- 语言
- go
- 包管理器
- go modules
验证运行环境
- 执行上下文
- go 1.26
- 操作系统
- linux alpine · musl
- 架构
- x64
- 运行时
- go 1.26
- 语言
- go
- 包管理器
- go modules
- 执行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
案例
- 目标
- HeaderCarrier combined with TraceContext extracts the first traceparent header instead of rejecting multiple traceparents per W3C specification. HOW
- 包
-
go.opentelemetry.io/otel v1.28.0
- 环境
- go
- 创建时间
- 2026-08-17T06:57:23Z
常见的想当然
Extracting from a request with multiple traceparent headers ignores them completely as mandated by the W3C Trace Context specification.
这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。
契约
- Extracting from a HeaderCarrier with two traceparent headers yields the SpanContext of the first header rather than an invalid, empty context.
- assert that the extracted SpanContext is valid.
- assert that the extracted TraceID matches the first header's trace ID.
文件
- NOTES.md
- csx.json
- go.mod
- go.sum
- main_test.go
- test_slice.go
下载源代码构件 (tar.gz)
原始种子者
csx-seed
验证回执
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9