obs

package
v0.8.1 Latest Latest
Warning

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

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

Documentation

Overview

Package obs is a dependency-free metrics registry that serves the Prometheus text exposition format 0.0.4.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterVec

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

CounterVec is a counter family keyed by label values.

func (*CounterVec) Add

func (c *CounterVec) Add(v float64, values ...string)

Add adds v to the series for the label values.

func (*CounterVec) Inc

func (c *CounterVec) Inc(values ...string)

Inc adds 1 to the series for the label values.

type GaugeVec

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

GaugeVec is a gauge family keyed by label values.

func (*GaugeVec) Set

func (g *GaugeVec) Set(v float64, values ...string)

Set sets the series for the label values to v.

type Registry

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

Registry holds metric families and serves them over HTTP.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns an empty Registry.

func (*Registry) Counter

func (r *Registry) Counter(name, help string, labels ...string) *CounterVec

Counter registers a counter family. It panics on a duplicate name.

func (*Registry) Gauge

func (r *Registry) Gauge(name, help string, labels ...string) *GaugeVec

Gauge registers a gauge family. It panics on a duplicate name.

func (*Registry) ServeHTTP

func (r *Registry) ServeHTTP(w http.ResponseWriter, _ *http.Request)

ServeHTTP writes every family, sorted by name, with series sorted by label values.

Jump to

Keyboard shortcuts

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