MCPcopy Index your code
hub / github.com/coder/coder / StartSpanWithName

Function StartSpanWithName

coderd/tracing/httpmw.go:125–131  ·  view source on GitHub ↗

StartSpanWithName starts a new span with the given name from the context. If a tracer name was set on the context (or one of its parents), it will be used as the tracer name instead of the default TracerName.

(ctx context.Context, name string, opts ...trace.SpanStartOption)

Source from the content-addressed store, hash-verified

123// a tracer name was set on the context (or one of its parents), it will be used
124// as the tracer name instead of the default TracerName.
125func StartSpanWithName(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
126 tracerName := GetTracerName(ctx)
127 return trace.SpanFromContext(ctx).
128 TracerProvider().
129 Tracer(tracerName).
130 Start(ctx, name, opts...)
131}

Callers 3

SetMethod · 0.92
StartSpanFunction · 0.85

Calls 3

GetTracerNameFunction · 0.85
TracerMethod · 0.80
StartMethod · 0.65

Tested by

no test coverage detected