instrumentation

package
v9.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 12 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL