prometheus

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

An Encoder writes Prometheus samples to the writer

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates a new Prometheus encoder.

func (*Encoder) Append

func (e *Encoder) Append(m Marshaller) error

Append marshals a Marshaller and appends it to the encoder's buffer.

type Marshaller

type Marshaller interface {
	PrometheusMetric() []Metric
}

A Marshaller can be marshalled into Prometheus samples

type Metric

type Metric struct {
	Name      string
	Labels    map[string]any
	Value     float64
	Timestamp time.Time
}

A Metric is a Prometheus metric.

Jump to

Keyboard shortcuts

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