MCPcopy Index your code
hub / github.com/github/copilot-sdk / getTraceContext

Function getTraceContext

go/telemetry.go:12–16  ·  view source on GitHub ↗

getTraceContext extracts the current W3C Trace Context (traceparent/tracestate) from the Go context using the global OTel propagator.

(ctx context.Context)

Source from the content-addressed store, hash-verified

10// getTraceContext extracts the current W3C Trace Context (traceparent/tracestate)
11// from the Go context using the global OTel propagator.
12func getTraceContext(ctx context.Context) (traceparent, tracestate string) {
13 carrier := propagation.MapCarrier{}
14 otel.GetTextMapPropagator().Inject(ctx, carrier)
15 return carrier.Get("traceparent"), carrier.Get("tracestate")
16}
17
18// contextWithTraceParent returns a new context with trace context extracted from
19// the provided W3C traceparent and tracestate headers.

Callers 5

TestGetTraceContextEmptyFunction · 0.70
SendMethod · 0.70
CreateSessionMethod · 0.70

Calls 1

GetMethod · 0.45

Tested by 2

TestGetTraceContextEmptyFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…