Documentation
¶
Overview ¶
Package trace provides OpenTracing integration for HTTP handlers. It implements middleware for extracting tracing information from request headers and propagating span context through the request lifecycle. The package offers utility functions for storing and retrieving OpenTracing span contexts in Go's context.Context objects, enabling distributed tracing across service boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpanContext ¶
func ContextWithSpanContext(ctx context.Context, sc opentracing.SpanContext) context.Context
ContextWithSpanContext creates a new context with the opentracing.SpanContext set
func Middleware ¶
Middleware wraps an http.Handler to extract opentracing span information from the request headers. The opentracing.SpanContext is added to the request context, and can be retrieved by SpanContextFromContext.
func SpanContextFromContext ¶
func SpanContextFromContext(ctx context.Context) opentracing.SpanContext
SpanContextFromContext retrieves the opentracing.SpanContext set on the context by Middleware
Types ¶
This section is empty.