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

Function RunWithoutSpan

coderd/tracing/util.go:42–45  ·  view source on GitHub ↗

RunWithoutSpan runs the given function with the span stripped from the context and replaced with a no-op span. This is useful for avoiding logs being added to span (to save money).

(ctx context.Context, fn func(ctx context.Context))

Source from the content-addressed store, hash-verified

40// context and replaced with a no-op span. This is useful for avoiding logs
41// being added to span (to save money).
42func RunWithoutSpan(ctx context.Context, fn func(ctx context.Context)) {
43 ctx = trace.ContextWithSpan(ctx, NoopSpan)
44 fn(ctx)
45}
46
47func MetadataFromContext(ctx context.Context) map[string]string {
48 metadata := make(map[string]string)

Callers 2

WriteLogMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected