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

Method Register

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

Register registers a new Collector to be included in metrics collection. It returns an error if the descriptors provided by the Collector are invalid or if they — in combination with descriptors of already registered Collectors — do not fulfill the consistency and uniqueness criteria described in th

(Collector)

Source from the content-addressed store, hash-verified

113 // inconsistent metrics on collection. (This would lead to scrape
114 // errors.)
115 Register(Collector) error
116 // MustRegister works like Register but registers any number of
117 // Collectors and panics upon the first registration that causes an
118 // error.

Callers 15

RegisterMethod · 0.65
TestDescribeByCollectFunction · 0.65
TestWrapRegistererFunction · 0.65
TestNilFunction · 0.65
TestWrapCollectorFunction · 0.65
TestProcessCollectorFunction · 0.65
TestAlreadyRegisteredFunction · 0.65
RegisterFunction · 0.65
HandlerForTransactionalFunction · 0.65
InstrumentMetricHandlerFunction · 0.65

Implementers 2

wrappingRegistererprometheus/wrap.go
Registryprometheus/registry.go

Calls

no outgoing calls

Tested by 9

TestDescribeByCollectFunction · 0.52
TestWrapRegistererFunction · 0.52
TestNilFunction · 0.52
TestWrapCollectorFunction · 0.52
TestProcessCollectorFunction · 0.52
TestAlreadyRegisteredFunction · 0.52
TestDBStatsCollectorFunction · 0.52