MCPcopy
hub / github.com/cubefs/cubefs / SpanFromContext

Function SpanFromContext

blobstore/common/trace/tracer.go:257–264  ·  view source on GitHub ↗

SpanFromContext returns the `Span` previously associated with `ctx`, or `nil` if no such `Span` could be found.

(ctx context.Context)

Source from the content-addressed store, hash-verified

255// SpanFromContext returns the `Span` previously associated with `ctx`, or
256// `nil` if no such `Span` could be found.
257func SpanFromContext(ctx context.Context) Span {
258 span := opentracing.SpanFromContext(ctx)
259 s, ok := span.(Span)
260 if !ok {
261 return nil
262 }
263 return s
264}
265
266// SpanFromContextSafe returns the `Span` previously associated with `ctx`, or
267// creates a root Span with name default.

Callers 15

TestCmdCommonContextFunction · 0.92
droppingDiskMethod · 0.92
ValidateNodeSetIDMethod · 0.92
withReqidContextFunction · 0.92
HandlerMethod · 0.92
StatChunkMethod · 0.92
StatShardMethod · 0.92
ListShardsMethod · 0.92
PutShardMethod · 0.92
AddTrackTagFunction · 0.92
TestExplicitReferencesFunction · 0.85
TestStartSpanFromContextFunction · 0.85

Calls

no outgoing calls

Tested by 8

TestCmdCommonContextFunction · 0.74
TestExplicitReferencesFunction · 0.68
TestStartSpanFromContextFunction · 0.68
TestSpanFromContextFunction · 0.68
TestNewContextFromFunction · 0.68
TestSpan_WithOperationFunction · 0.68
TestSpan_BaseLoggerFunction · 0.68