sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

opentelemetry: log TraceID/SpanID as hex strings (fixes #2103)

Open billrich2001 opened this issue 2 months ago • 3 comments

Fix cosmetic logging bug: ensure OpenTelemetry TraceID/SpanID are logged as hex strings instead of byte slices. Minimal change: call .String() on both.\n\nValidation: ran go test ./... successfully.\n\nAffected file: contrib/opentelemetry/tracing_interceptor.go

closes #2103

billrich2001 avatar Nov 07 '25 20:11 billrich2001

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 07 '25 20:11 CLAassistant

Added note.

Was able to recreate using slog and otel traceid on Go 1.21

billrich2001 avatar Nov 19 '25 22:11 billrich2001

For loggin SpanID and TraceID with slog you should be setting up https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/bridges/otelslog or an alternative

Quinn-With-Two-Ns avatar Nov 19 '25 23:11 Quinn-With-Two-Ns