MCPcopy
hub / github.com/cloudflare/cloudflared / NewTracedContext

Function NewTracedContext

tracing/tracing.go:98–104  ·  view source on GitHub ↗

NewTracedContext creates a new tracer for the current context.

(ctx context.Context, traceContext string, log *zerolog.Logger)

Source from the content-addressed store, hash-verified

96
97// NewTracedContext creates a new tracer for the current context.
98func NewTracedContext(ctx context.Context, traceContext string, log *zerolog.Logger) *TracedContext {
99 ctx, exists := extractTraceFromString(ctx, traceContext)
100 if !exists {
101 return &TracedContext{ctx, &cfdTracer{trace.NewNoopTracerProvider(), &NoopOtlpClient{}, log}}
102 }
103 return &TracedContext{ctx, newCfdTracer(ctx, log)}
104}
105
106type cfdTracer struct {
107 trace.TracerProvider

Callers 4

RegisterUdpSessionMethod · 0.92
nextPacketMethod · 0.92
TestTraceICMPRouterEchoFunction · 0.92
ProxyTCPMethod · 0.92

Calls 2

extractTraceFromStringFunction · 0.85
newCfdTracerFunction · 0.85

Tested by 1

TestTraceICMPRouterEchoFunction · 0.74