metrics

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Path = "/metrics"

Path is the HTTP path Prometheus scrapes.

Variables

This section is empty.

Functions

func Handler

func Handler(s store.Storer, token string) http.Handler

Handler serves Prometheus text metrics from the current IPAM store. When token is non-empty, requests must send Authorization: Bearer <token>.

func Wrap

func Wrap(next, metricsHandler http.Handler) http.Handler

Wrap serves metricsHandler at Path and passes every other request to next.

Types

type Collector

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

Collector walks the IPAM store on each Prometheus scrape and emits gauges for current IP space: block fill, pool carve-out, reserved ranges, and counts.

func NewCollector

func NewCollector(s store.Storer) *Collector

NewCollector returns a Prometheus collector bound to s.

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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