package tracing

Import Path
	github.com/mark3labs/mcp-go/tracing (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files Package tracing defines the tracing interfaces used by the mcp-go client and server. Concrete implementations live in adapter modules; an OpenTelemetry adapter ships at github.com/mark3labs/mcp-go/otel.
Package-Level Type Names (total 7)
/* sort by: | */
Attribute is a string key/value pair attached to a span. Key string Value string func String(key, value string) Attribute func Span.SetAttributes(attrs ...Attribute) func Tracer.Start(ctx context.Context, name string, kind SpanKind, attrs ...Attribute) (context.Context, Span)
MetaPropagator carries tracing context through the MCP _meta property bag (per SEP-414). Unlike Propagator it operates on mcp.Meta rather than HTTP headers, so it works on every MCP transport including stdio. InjectMeta writes the active span context into meta.AdditionalFields. It allocates a new mcp.Meta when meta is nil and the propagator has something to write. It returns nil when meta would remain empty. ExtractMeta reads traceparent/tracestate/baggage from meta.AdditionalFields and returns a context that carries the extracted span context. It returns ctx unchanged when meta is nil. ( MetaPropagator) ExtractMeta(ctx context.Context, meta *mcp.Meta) context.Context ( MetaPropagator) InjectMeta(ctx context.Context, meta *mcp.Meta) *mcp.Meta func NoopMetaPropagator() MetaPropagator func github.com/mark3labs/mcp-go/server.WithMetaPropagator(p MetaPropagator) server.ServerOption
Propagator carries tracing context across HTTP requests. ( Propagator) Extract(ctx context.Context, headers http.Header) context.Context ( Propagator) Inject(ctx context.Context, headers http.Header) func NoopPropagator() Propagator func github.com/mark3labs/mcp-go/server.WithPropagator(p Propagator) server.ServerOption
Span is an in-flight tracing span. End must be called exactly once. ( Span) End() ( Span) RecordError(err error) ( Span) SetAttributes(attrs ...Attribute) ( Span) SetStatus(code StatusCode, description string) func SpanFromContext(ctx context.Context) Span func Tracer.Start(ctx context.Context, name string, kind SpanKind, attrs ...Attribute) (context.Context, Span) func ContextWithSpan(ctx context.Context, span Span) context.Context
SpanKind identifies the role of a span in a trace. func Tracer.Start(ctx context.Context, name string, kind SpanKind, attrs ...Attribute) (context.Context, Span) const SpanKindClient const SpanKindInternal const SpanKindServer const SpanKindUnspecified
StatusCode describes the final outcome status of a span. func Span.SetStatus(code StatusCode, description string) const StatusError const StatusOK const StatusUnset
Tracer starts spans. Start returns a context carrying the new span and the span itself. ( Tracer) Start(ctx context.Context, name string, kind SpanKind, attrs ...Attribute) (context.Context, Span) func NoopTracer() Tracer func github.com/mark3labs/mcp-go/server.WithTracer(tracer Tracer) server.ServerOption
Package-Level Functions (total 6)
ContextWithSpan returns ctx annotated with span so SpanFromContext can later retrieve it.
NoopMetaPropagator returns a MetaPropagator whose methods are no-ops.
NoopPropagator returns a Propagator whose methods are no-ops.
NoopTracer returns a Tracer that records nothing.
SpanFromContext returns the active Span, or a non-recording noop if none is present.
String returns an Attribute with the given key and value.
Package-Level Constants (total 7)
const StatusOK StatusCode = 1