Context
PR #22 added coldbrew.trace_id as an OTEL span attribute in SetTraceId() (notifier/notifier.go). This links the ColdBrew correlation ID to distributed traces for cross-system debugging.
The attribute is set in two paths:
- Early return — when trace ID already exists, sets attribute before returning
- Normal path — after resolving trace ID from metadata/OTEL/UUID, sets attribute on the span
What's needed
Add a unit test using the OTEL SDK test tracer (go.opentelemetry.io/otel/sdk/trace/tracetest) to verify:
coldbrew.trace_id attribute is set on the span when SetTraceId is called with an active OTEL span
- Metadata-supplied trace ID takes priority over OTEL-generated trace ID
- When trace ID already exists (early return path), the attribute is still set
- When no span is in context, no panic occurs
Files
errors/notifier/notifier.go — SetTraceId() function (lines 536-573)
errors/notifier/notifier_test.go — add tests here
Context
PR #22 added
coldbrew.trace_idas an OTEL span attribute inSetTraceId()(notifier/notifier.go). This links the ColdBrew correlation ID to distributed traces for cross-system debugging.The attribute is set in two paths:
What's needed
Add a unit test using the OTEL SDK test tracer (
go.opentelemetry.io/otel/sdk/trace/tracetest) to verify:coldbrew.trace_idattribute is set on the span whenSetTraceIdis called with an active OTEL spanFiles
errors/notifier/notifier.go—SetTraceId()function (lines 536-573)errors/notifier/notifier_test.go— add tests here