Skip to content

Commit a61374d

Browse files
committed
fix: add more logs to help troubleshooting propagation of OpenTelemetry context from clients
1 parent 00b01ef commit a61374d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hub/hub_base.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ func (h *hubBase) traceContextForScan(table string, columns []string, limit int6
383383
if parentCtx := h.parseTraceContext(traceContextStr); parentCtx != nil {
384384
baseCtx = parentCtx
385385
log.Printf("[TRACE] Using parent trace context for scan of table: %s", table)
386+
387+
// Verify the parent context has the expected trace ID
388+
parentSpanCtx := trace.SpanContextFromContext(parentCtx)
389+
if parentSpanCtx.IsValid() {
390+
log.Printf("[DEBUG] Parent context TraceID: %s, SpanID: %s",
391+
parentSpanCtx.TraceID().String(), parentSpanCtx.SpanID().String())
392+
}
386393
} else {
387394
log.Printf("[WARN] Failed to parse trace context for table: %s", table)
388395
}

0 commit comments

Comments
 (0)