MCPcopy
hub / github.com/prometheus/client_golang / Registry

Struct Registry

prometheus/registry.go:260–267  ·  view source on GitHub ↗

Registry registers Prometheus collectors, collects their metrics, and gathers them into MetricFamilies for exposition. It implements Registerer, Gatherer, and Collector. The zero value is not usable. Create instances with NewRegistry or NewPedanticRegistry. Registry implements Collector to allow it

Source from the content-addressed store, hash-verified

258// Registry implements Collector to allow it to be used for creating groups of
259// metrics. See the Grouping example for how this can be done.
260type Registry struct {
261 mtx sync.RWMutex
262 collectorsByID map[uint64]Collector // ID is a hash of the descIDs.
263 descIDs map[uint64]struct{}
264 dimHashesByName map[string]uint64
265 uncheckedCollectors []Collector
266 pedanticChecksEnabled bool
267}
268
269// Register implements Registerer.
270func (r *Registry) Register(c Collector) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected