metrics

package
v1.20.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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

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

func New(subsystem string) *Metrics

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

func (*Metrics) ObserveAPICall

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

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