metrics

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

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

Label represents a label for metrics.

func NewLabel

func NewLabel(key, value string) Label

NewLabel creates a new Label with key and value.

type Metric

type Metric struct {
	Name       string
	Type       MetricType
	ValueInt64 int64
	Comment    string
	Labels     []Label
}

Metric represents a single metric.

type MetricType

type MetricType int
const (
	TypeCounterInt MetricType = iota + 1
	TypeGaugeInt
)

func (MetricType) String

func (mt MetricType) String() string

type OpenTelemetryWriter

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

OpenTelemetryWriter implements the Writer interface and formats metrics in OpenTelemetryWriter exposition format.

func NewOpenTelemetryWriter

func NewOpenTelemetryWriter(w io.Writer) *OpenTelemetryWriter

NewOpenTelemetryWriter creates a new OpenTelemetryWriter.

func (*OpenTelemetryWriter) Write

func (otw *OpenTelemetryWriter) Write(m Metric) error

type Writer

type Writer interface {
	Write(Metric) error
}

Jump to

Keyboard shortcuts

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