metrics

package
v0.0.0-...-06bcc1c Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = Metrics{}

Client is a metrics obj

Functions

func InitMetrics

func InitMetrics(ctx context.Context, config types.Config, metricsDescriptions []*plugintypes.MetricsDescription) error

InitMetrics new a metrics obj

Types

type Metrics

type Metrics struct {
	Config types.Config

	StatsdAddr string
	Hostname   string

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

Metrics define metrics

func (*Metrics) RemoveInvalidNodes

func (m *Metrics) RemoveInvalidNodes(invalidNodes ...string)

RemoveInvalidNodes 清除多余的metric标签值

func (*Metrics) ResourceMiddleware

func (m *Metrics) ResourceMiddleware(cluster cluster.Cluster) func(http.Handler) http.Handler

ResourceMiddleware to make sure update resource correct

func (*Metrics) SendDeployCount

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

SendDeployCount update deploy counter

func (*Metrics) SendMetrics

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

SendMetrics update metrics

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