trace

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 3 Imported by: 0

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

func Middleware(next http.Handler) http.Handler

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL