Documentation
¶
Overview ¶
Package httpclient provides a shared resty HTTP client factory with optional OpenTelemetry tracing. OTel transport instrumentation activates only when OTEL_EXPORTER_OTLP_ENDPOINT is set and OTEL_SDK_DISABLED is not true, aligned with the global tracer provider in package observability.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a resty client with the default 30s timeout and optional OTel transport instrumentation.
func NewWithTimeout ¶
NewWithTimeout creates a resty client with a custom timeout and optional OTel transport instrumentation.
func StdHTTPClient ¶
StdHTTPClient returns a standard *http.Client with optional OTel transport instrumentation. No timeout is set because this client is used for SSE/streaming requests where the context deadline controls cancellation. When enabled, otelhttp resolves the TracerProvider from the request context at call time (not construction time), so it works regardless of init order.
Types ¶
This section is empty.