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
| 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. |
| 260 | type 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. |
| 270 | func (r *Registry) Register(c Collector) error { |
nothing calls this directly
no outgoing calls
no test coverage detected