metrics

package
v1.18.1-qos Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: BSD-3-Clause Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAndRegister added in v0.1.1

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

Types

type Client added in v0.1.1

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

Client for requesting metrics from a remote Lux Node instance

func NewClient added in v0.1.1

func NewClient(uri string) *Client

NewClient returns a new Metrics API Client

func (*Client) GetMetrics added in v0.1.1

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 added in v0.1.1

type MultiGatherer interface {
	metric.Gatherer

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

	// Deregister removes the outputs of a gatherer with [name] from the results
	// of future calls to Gather. Returns true if a gatherer with [name] was
	// found.
	Deregister(name string) bool
}

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

func NewLabelGatherer added in v0.1.1

func NewLabelGatherer(labelName string) MultiGatherer

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

func NewMultiGatherer deprecated added in v1.1.11

func NewMultiGatherer() MultiGatherer

Deprecated: Use NewPrefixGatherer instead.

func NewPrefixGatherer added in v0.1.1

func NewPrefixGatherer() MultiGatherer

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

type OptionalGatherer added in v1.1.11

type OptionalGatherer interface {
	metric.Gatherer

	// Register the provided gatherer. If a gatherer was previously registered,
	// an error will be returned.
	Register(gatherer metric.Gatherer) error
}

OptionalGatherer extends the Gatherer interface by allowing the optional registration of a single gatherer. If no gatherer is registered, Gather will return no metrics and no error. If a gatherer is registered, Gather will return the results of calling Gather on the provided gatherer.

func NewOptionalGatherer added in v1.1.11

func NewOptionalGatherer() OptionalGatherer

Jump to

Keyboard shortcuts

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