tracecontext

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tracecontext preserves the caller's trace identity independently of spans created while processing the request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMiddleware

func HTTPMiddleware() middleware.Interface

HTTPMiddleware captures the caller's trace headers before request processing.

func UnaryServerInterceptor

func UnaryServerInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

UnaryServerInterceptor captures the caller's trace from incoming gRPC metadata. Extracting independently of the active span also handles tracing stats handlers, which run before unary interceptors and may already have created a local trace.

func UpstreamTraceID

func UpstreamTraceID(ctx context.Context) string

UpstreamTraceID returns the trace ID extracted at ingress, or an empty string if the caller did not supply a valid trace. It never falls back to local spans.

Types

This section is empty.

Jump to

Keyboard shortcuts

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