Documentation ¶
Overview ¶
Package httpclient provides utilities for collect http metrics context into the outbound request headers.
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 the http.RoundTripper interface and wraps outbound HTTP(S) requests with a meter.
func NewTransport ¶
func NewTransport(base http.RoundTripper) *Transport
NewTransport wraps the provided http.RoundTripper with one that and includes http metrics context into the outbound request headers.
If the provided http.RoundTripper is nil, http.DefaultTransport will be used as the base http.RoundTripper. It allows for collecting metrics, specifically measuring outbound request durations in seconds, for HTTP client requests made using the wrapped RoundTripper.
base: The base http.RoundTripper to be wrapped. If nil, http.DefaultTransport is used as the default base RoundTripper.
Click to show internal directories.
Click to hide internal directories.