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

Function WrapCollectorWithPrefix

prometheus/wrap.go:108–113  ·  view source on GitHub ↗

WrapCollectorWithPrefix returns a Collector wrapping the provided Collector. The wrapped Collector will add the provided prefix to the name of all Metrics it collects. See the documentation of WrapCollectorWith for more details on the use case.

(prefix string, c Collector)

Source from the content-addressed store, hash-verified

106//
107// See the documentation of WrapCollectorWith for more details on the use case.
108func WrapCollectorWithPrefix(prefix string, c Collector) Collector {
109 return &wrappingCollector{
110 wrappedCollector: c,
111 prefix: prefix,
112 }
113}
114
115type wrappingRegisterer struct {
116 wrappedRegisterer Registerer

Callers 1

TestWrapCollectorFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestWrapCollectorFunction · 0.68