httptelemetry

package
v0.0.0-...-f97c3c1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package httptelemetry provides shared OpenTelemetry helpers for HTTP clients, including a toggleable RoundTripper wrapper that preserves the caller's base transport while emitting spans and metrics when enabled.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport implements http.RoundTripper with optional OpenTelemetry tracing.

func NewTransport

func NewTransport(base http.RoundTripper) *Transport

NewTransport creates a new Transport. If base is nil, cloned http.DefaultTransport is used.

func NewTransportWithTrace

func NewTransportWithTrace(base http.RoundTripper, traceEnabled bool) *Transport

NewTransportWithTrace creates a new *Transport with OpenTelemetry tracing.

If base is nil, cloned http.DefaultTransport is used.

func (*Transport) RoundTrip

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

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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