Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerFormatter ¶
HandlerFormatter is a span formatter that may be provided to otelhttp.WithSpanNameFormatter to include the component and url path in the span names generated by otelhttp.NewHandler.
func NewTransport ¶
func NewTransport(rt http.RoundTripper) http.RoundTripper
NewTransport wraps the provided http.RoundTripper with one that automatically adds spans for each http request.
Note: special care has been taken to ensure that the returned http.RoundTripper has a CloseIdleConnections method because the otelhttp.Transport does not implement it: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3543. Once the issue is resolved the wrapper may be discarded.
func NewTransportWithInner ¶
func NewTransportWithInner(rt http.RoundTripper, inner http.RoundTripper) http.RoundTripper
NewTransportWithInner wraps the provided http.RoundTripper with one that automatically adds spans for each http request. The inner round tripper is used to close idle connections when rt.CloseIdleConnections isn't implemented for the rt provided.
Note: special care has been taken to ensure that the returned http.RoundTripper has a CloseIdleConnections method because the otelhttp.Transport does not implement it: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3543. Once the issue is resolved the wrapper may be discarded.
func TransportFormatter ¶
TransportFormatter is a span formatter that may be provided to otelhttp.WithSpanNameFormatter to include the url path in the span names generated by an otelhttp.Transport.
Types ¶
This section is empty.