http

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package http provides helpers for configuring HTTP clients with OpenTelemetry tracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient

func NewHttpClient() http.Client

NewHttpClient initializes a new HTTP client with OpenTelemetry tracing enabled.

This function creates and returns an http.Client configured to use an OpenTelemetry transport by wrapping the default HTTP transport. This allows for tracing of all outgoing HTTP requests made by the client, providing enhanced observability for applications that rely on external HTTP communications.

Returns a new http.Client with OpenTelemetry tracing configured.

func SetHttpTransport

func SetHttpTransport(client http.Client) http.Client

SetHttpTransport configures the provided HTTP client to use OpenTelemetry's transport for tracing.

This function takes an http.Client as an argument and sets its Transport to an OpenTelemetry-enabled transport created by otelhttp.NewTransport. This allows for tracing of outgoing HTTP requests made by the client, enabling better observability and monitoring of requests in a distributed system.

Returns the configured http.Client with the OpenTelemetry transport set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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