metrics

package
v1.11.12-rc.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 13 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAndRegister added in v1.11.9

func MakeAndRegister(gatherer MultiGatherer, name string) (*prometheus.Registry, error)

Types

type Client added in v1.11.9

type Client struct {
	// contains filtered or unexported fields
}

Client for requesting metrics from a remote AvalancheGo instance

func NewClient added in v1.11.9

func NewClient(uri string) *Client

NewClient returns a new Metrics API Client

func (*Client) GetMetrics added in v1.11.9

func (c *Client) GetMetrics(ctx context.Context) (map[string]*dto.MetricFamily, error)

GetMetrics returns the metrics from the connected node. The metrics are returned as a map of metric family name to the metric family.

type MultiGatherer

type MultiGatherer interface {
	prometheus.Gatherer

	// Register adds the outputs of [gatherer] to the results of future calls to
	// Gather with the provided [name] added to the metrics.
	Register(name string, gatherer prometheus.Gatherer) error
}

MultiGatherer extends the Gatherer interface by allowing additional gatherers to be registered.

func NewLabelGatherer added in v1.11.9

func NewLabelGatherer(labelName string) MultiGatherer

NewLabelGatherer returns a new MultiGatherer that merges metrics by adding a new label.

func NewMultiGatherer deprecated

func NewMultiGatherer() MultiGatherer

Deprecated: Use NewPrefixGatherer instead.

TODO: Remove once coreth is updated.

func NewPrefixGatherer added in v1.11.9

func NewPrefixGatherer() MultiGatherer

NewPrefixGatherer returns a new MultiGatherer that merges metrics by adding a prefix to their names.

Jump to

Keyboard shortcuts

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