Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics added in v1.20.0

type Metrics struct {
	APIDuration metric.Vec[metric.Observer]
	RateLimit   metric.Vec[metric.Observer]
}

Metrics holds the Prometheus metrics for external cloud API usage.

func New added in v1.20.0

func New(subsystem string) *Metrics

New returns a new Metrics for the given cloud API subsystem (e.g. "ec2", "azure").

func (*Metrics) ObserveAPICall added in v1.20.0

func (m *Metrics) ObserveAPICall(operation, status string, duration float64)

ObserveAPICall records the duration of an API call with the given operation name and response code.

func (*Metrics) ObserveRateLimit added in v1.20.0

func (m *Metrics) ObserveRateLimit(operation string, delay time.Duration)

ObserveRateLimit records a rate-limiter blocking event for the given operation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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