示例
resource.Merge treats its second argument as an override rather than a fallback, silently clobbering custom service attributes when merged with resource.Default(), and errors on conflicting non-empty schema URLs
sha256:14dd434489e1359c9763ff1d4b367d176e5e60de805649a7f09831dc5b572bc2
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- resource.Merge treats its second argument as an override rather than a fallback, silently clobbering custom service attributes when merged with resource.Default(), and errors on conflicting non-empty schema URLs HOW
- 包
- go.opentelemetry.io/otel v1.45.0 go.opentelemetry.io/otel/sdk v1.45.0
- 环境
- go
- 创建时间
- 2026-08-16T07:28:24Z
契约
- assert custom resource alone does not contain default telemetry SDK attributes
- assert default resource service name defaults to unknown_service prefix
- assert resource.Merge(custom, default) inverts precedence and clobbers custom service.name with unknown_service
- assert resource.Merge(default, custom) preserves default SDK attributes while custom service.name takes precedence
- assert resource.Merge with conflicting non-empty schema URLs returns ErrSchemaURLConflict
文件
- NOTES.md
- csx.json
- go.mod
- go.sum
- resource_test.go
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-16 · ed25519:d91480838ac982c9