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

metrics

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client = Metrics{}
)

Functions

func InitMetrics

func InitMetrics(config types.Config, rmgr resource.Manager, metricsDescriptions []*plugintypes.MetricsDescription) error

InitMetrics builds the global metrics client and registers its collectors.

Types

type Metrics

type Metrics struct {
	StatsdAddr string
	Hostname   string

	Collectors map[string]prometheus.Collector
	// contains filtered or unexported fields
}

Metrics ships core metrics to Prometheus and statsd.

func (*Metrics) RemoveInvalidNodes

func (m *Metrics) RemoveInvalidNodes(invalidNode string)

RemoveInvalidNodes drops Prometheus label sets for a node that no longer exists.

func (*Metrics) ResourceMiddleware

func (m *Metrics) ResourceMiddleware(ctx context.Context, cluster cluster.Cluster) func(http.Handler) http.Handler

ResourceMiddleware refreshes node metrics before the wrapped handler runs; overlapping scrapes share one refresh, which runs under the server's context.

func (*Metrics) SendDeployCount

func (m *Metrics) SendDeployCount(ctx context.Context, n int)

func (*Metrics) SendMetrics

func (m *Metrics) SendMetrics(ctx context.Context, metrics ...*plugintypes.Metrics)

func (*Metrics) SendNodesMetrics added in v0.1.4

func (m *Metrics) SendNodesMetrics(ctx context.Context, nodes ...*types.Node)

SendNodesMetrics refreshes the resource metrics of the nodes in one plugin call and pushes them.

func (*Metrics) SendPodNodeStatus

func (m *Metrics) SendPodNodeStatus(ctx context.Context, node *types.Node)

Jump to

Keyboard shortcuts

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