metric

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Family

type Family struct {
	Name    string
	Type    Type
	Metrics []*Metric
}

Family represents a set of metrics with the same name and help text.

func (Family) ByteSlice

func (f Family) ByteSlice() []byte

ByteSlice returns the given Family in its string representation.

func (Family) Inspect

func (f Family) Inspect(inspect func(Family))

Inspect use to inspect the inside of a Family

type FamilyInterface

type FamilyInterface interface {
	Inspect(inspect func(Family))
	ByteSlice() []byte
}

FamilyInterface interface for a family

type Metric

type Metric struct {
	// The name of a metric is injected by its family to reduce duplication.
	LabelKeys   []string
	LabelValues []string
	Value       float64
}

Metric represents a single time series.

func (*Metric) Write

func (m *Metric) Write(s *strings.Builder)

type Type

type Type string

Type represents the type of the metric. See https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#metric-types.

var (

	// Gauge defines an OpenMetrics gauge.
	Gauge Type = "gauge"

	// Info defines an OpenMetrics info.
	Info Type = "info"

	// StateSet defines an OpenMetrics stateset.
	StateSet Type = "stateset"

	// Counter defines an OpenMetrics counter.
	Counter Type = "counter"
)

Supported metric types.

Jump to

Keyboard shortcuts

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