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 ¶
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 ¶
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.