metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, snapshot Snapshot, version string)

Write renders the exposition format Prometheus reads. It is a few lines of text, which is why nothing is imported to produce it.

Types

type Handler

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

func New

func New(source Source, version string, logger *slog.Logger) *Handler

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

type Measure

type Measure struct {
	Tenant string
	// Kind is the second label when a metric has one: the signature state of
	// an event, or the state of a delivery. Empty when it does not.
	Kind  string
	Value float64
}

Measure is one number with the labels that tell it apart.

type Snapshot

type Snapshot struct {
	Events        []Measure
	Deliveries    []Measure
	Attempts      []Measure
	OldestPending []Measure
	Tenants       float64
	Operators     float64
}

Snapshot is everything one scrape reports, read together so the numbers in it belong to the same moment.

type Source

type Source interface {
	Snapshot(ctx context.Context) (Snapshot, error)
}

Source is where a snapshot comes from. Declared here, by the side that consumes it, so this package depends on no storage.

Jump to

Keyboard shortcuts

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