Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentedTransport ¶
func InstrumentedTransport(next http.RoundTripper, opts Options) http.RoundTripper
InstrumentedTransport wraps next with optional metrics and/or tracing. If next is nil, http.DefaultTransport is used. With an empty Options value, the (possibly defaulted) transport is returned unchanged.
func NewMetricsCollector ¶
func NewMetricsCollector(reg prometheus.Registerer, subsystem string) *metricsCollector
NewMetricsCollector creates a metricsCollector backed by the given registry.
Types ¶
type Options ¶
type Options struct {
// Subsystem prefix for metrics (default: "cloudscale").
Subsystem string
// Registry to register metrics on. If nil, metrics are disabled.
PrometheusRegistry prometheus.Registerer
// Tracer to use for spans. If nil, tracing is disabled.
Tracer trace.Tracer
}
Options configures the instrumented transport.
Click to show internal directories.
Click to hide internal directories.