MCPcopy
hub / github.com/grafana/dskit / RegistererWithKVName

Function RegistererWithKVName

kv/metrics.go:17–23  ·  view source on GitHub ↗

RegistererWithKVName wraps the provided Registerer with the KV name label. If a nil reg is provided, a nil registry is returned

(reg prometheus.Registerer, name string)

Source from the content-addressed store, hash-verified

15// RegistererWithKVName wraps the provided Registerer with the KV name label. If a nil reg
16// is provided, a nil registry is returned
17func RegistererWithKVName(reg prometheus.Registerer, name string) prometheus.Registerer {
18 if reg == nil {
19 return nil
20 }
21
22 return prometheus.WrapRegistererWith(prometheus.Labels{"kv_name": name}, reg)
23}
24
25// getCasErrorCode converts the provided CAS error into the code that should be used to track the operation
26// in metrics.

Callers 2

NewFunction · 0.92
NewLifecyclerFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected