metrics

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics holds Prometheus counters and histograms for the engine.

func New

func New() *Metrics

New creates and registers a Metrics instance on an isolated registry, preventing double-registration panics when multiple instances are created (e.g. in tests).

func Noop

func Noop() *Metrics

Noop returns a Metrics instance that does nothing (used when metrics disabled).

func (*Metrics) Record

func (m *Metrics) Record(r task.Result)

Record observes the result of a completed task.

func (*Metrics) ServeHTTP

func (m *Metrics) ServeHTTP(ctx context.Context, port int)

ServeHTTP starts the Prometheus metrics HTTP endpoint and shuts it down gracefully when ctx is cancelled. Call in a goroutine.

Routes:

  • /metrics — Prometheus scrape endpoint
  • /healthz — liveness probe; always returns 200 {"status":"ok"}

Jump to

Keyboard shortcuts

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