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

Function WrapRegistererWithPrefix

prometheus/wrap.go:74–79  ·  view source on GitHub ↗

WrapRegistererWithPrefix returns a Registerer wrapping the provided Registerer. Collectors registered with the returned Registerer will be registered with the wrapped Registerer in a modified way. The modified Collector adds the provided prefix to the name of all Metrics it collects. Wrapping a nil

(prefix string, reg Registerer)

Source from the content-addressed store, hash-verified

72// either Registerer will contain the ExistingCollector in the form it was
73// provided to the respective registry.
74func WrapRegistererWithPrefix(prefix string, reg Registerer) Registerer {
75 return &wrappingRegisterer{
76 wrappedRegisterer: reg,
77 prefix: prefix,
78 }
79}
80
81// WrapCollectorWith returns a Collector wrapping the provided Collector. The
82// wrapped Collector will add the provided Labels to all Metrics it collects (as

Callers 2

TestAlreadyRegisteredFunction · 0.92
TestWrapRegistererFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestAlreadyRegisteredFunction · 0.74
TestWrapRegistererFunction · 0.68