obs

package
v0.10.0-dev.17 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package obs is subflux's /metrics registry: the platform series and the door every other owner's series registers through. It wraps github.com/cplieger/go/measure under another name so the two never collide at an import.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric = measure.Metric

Metric is the metrics library's collector, so a series another package declares with that library registers here.

type Metrics

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

Metrics is the process's one registry; New builds it.

func New

func New() *Metrics

New builds the registry, prefix subflux, with the platform series registered and build_info set. The library already exports process_start_time_seconds beside its other process series.

func (*Metrics) Handler

func (m *Metrics) Handler() http.HandlerFunc

Handler serves the exposition.

func (*Metrics) RecordHTTP

func (m *Metrics) RecordHTTP(r httpserver.RequestMetric)

RecordHTTP is httpserver.WithRecordRouteMetric's hook: the library bounds the method and route labels.

func (*Metrics) RecordPanic

func (m *Metrics) RecordPanic()

RecordPanic counts one recovered handler panic.

func (*Metrics) Register

func (m *Metrics) Register(ms ...Metric) error

Register adds other owners' collectors in turn, stopping at the first error: a duplicate family, or one a collector captured at construction.

func (*Metrics) SetConfigMode

func (m *Metrics) SetConfigMode(mode string)

SetConfigMode sets mode's config_mode series to 1 and the others to 0. A mode outside settings' three is a programming fault: logged at ERROR, and nothing changes.

Jump to

Keyboard shortcuts

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