MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Start

Method Start

api/pkg/telemetry/otel_tracer.go:45–54  ·  view source on GitHub ↗
(c context.Context, name ...string)

Source from the content-addressed store, hash-verified

43}
44
45func (tracer *otelTracer) Start(c context.Context, name ...string) (context.Context, trace.Span) {
46 parentSpan := trace.SpanFromContext(c)
47 ctx, span := parentSpan.TracerProvider().Tracer("").Start(c, getName(name...))
48
49 span.SetAttributes(attribute.Key("traceID").String(parentSpan.SpanContext().TraceID().String()))
50 span.SetAttributes(attribute.Key("spanID").String(span.SpanContext().SpanID().String()))
51 span.SetAttributes(attribute.Key("traceFlags").String(parentSpan.SpanContext().TraceFlags().String()))
52
53 return ctx, span
54}
55
56// Span returns the trace.Span from context.Context
57func (tracer *otelTracer) Span(ctx context.Context) trace.Span {

Callers 2

StartFromFiberCtxMethod · 0.95
StartWithLoggerMethod · 0.95

Calls 4

getNameFunction · 0.85
TracerMethod · 0.80
StartMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected