MCPcopy
hub / github.com/containerd/containerd / StartSpan

Function StartSpan

pkg/tracing/tracing.go:57–68  ·  view source on GitHub ↗

StartSpan starts child span in a context.

(ctx context.Context, opName string, opts ...SpanOpt)

Source from the content-addressed store, hash-verified

55
56// StartSpan starts child span in a context.
57func StartSpan(ctx context.Context, opName string, opts ...SpanOpt) (context.Context, *Span) {
58 config := StartConfig{}
59 for _, fn := range opts {
60 fn(&config)
61 }
62 tracer := otel.Tracer("")
63 if parent := trace.SpanFromContext(ctx); parent != nil && parent.SpanContext().IsValid() {
64 tracer = parent.TracerProvider().Tracer("")
65 }
66 ctx, span := tracer.Start(ctx, opName, config.spanOpts...)
67 return ctx, &Span{otelSpan: span}
68}
69
70// SpanFromContext returns the current Span from the context.
71func SpanFromContext(ctx context.Context) *Span {

Callers 15

PullMethod · 0.92
fetchMethod · 0.92
createNewImageMethod · 0.92
StartMethod · 0.92
KillMethod · 0.92
WaitMethod · 0.92
CloseIOMethod · 0.92
ResizeMethod · 0.92
DeleteMethod · 0.92
StartMethod · 0.92
KillMethod · 0.92
PauseMethod · 0.92

Calls 2

IsValidMethod · 0.80
StartMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…