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

Function NewCounter

prometheus/promauto/auto.go:167–169  ·  view source on GitHub ↗

NewCounter works like the function of the same name in the prometheus package but it automatically registers the Counter with the prometheus.DefaultRegisterer. If the registration fails, NewCounter panics.

(opts prometheus.CounterOpts)

Source from the content-addressed store, hash-verified

165// but it automatically registers the Counter with the
166// prometheus.DefaultRegisterer. If the registration fails, NewCounter panics.
167func NewCounter(opts prometheus.CounterOpts) prometheus.Counter {
168 return With(prometheus.DefaultRegisterer).NewCounter(opts)
169}
170
171// NewCounterVec works like the function of the same name in the prometheus
172// package but it automatically registers the CounterVec with the

Callers

nothing calls this directly

Calls 2

WithFunction · 0.85
NewCounterMethod · 0.80

Tested by

no test coverage detected