tracing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tracing provides OpenTelemetry tracing integration for httpx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	// Tracer is the OTel tracer to use. Defaults to the global tracer.
	Tracer trace.Tracer
	// Propagator is the text map propagator. Defaults to the global propagator.
	Propagator propagation.TextMapPropagator
	// Base is the underlying transport.
	Base http.RoundTripper
	// SpanNameFormatter formats the span name from the request.
	// Default: "HTTP <METHOD>"
	SpanNameFormatter func(req *http.Request) string
}

Transport wraps an http.RoundTripper with OpenTelemetry tracing. It creates a child span for each request and propagates trace context headers.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip creates an OTel span, injects trace context, and forwards the request.

Jump to

Keyboard shortcuts

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