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

Function NewMetricVec

prometheus/vec.go:47–57  ·  view source on GitHub ↗

NewMetricVec returns an initialized metricVec.

(desc *Desc, newMetric func(lvs ...string) Metric)

Source from the content-addressed store, hash-verified

45
46// NewMetricVec returns an initialized metricVec.
47func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec {
48 return &MetricVec{
49 metricMap: &metricMap{
50 metrics: map[uint64][]metricWithLabelValues{},
51 desc: desc,
52 newMetric: newMetric,
53 },
54 hashAdd: hashAdd,
55 hashAddByte: hashAddByte,
56 }
57}
58
59// DeleteLabelValues removes the metric where the variable labels are the same
60// as those passed in as labels (same order as the VariableLabels in Desc). It

Callers 5

NewInfoVecFunction · 0.92
NewCounterVecMethod · 0.85
NewHistogramVecMethod · 0.85
NewSummaryVecMethod · 0.85
NewGaugeVecMethod · 0.85

Calls

no outgoing calls

Tested by 1

NewInfoVecFunction · 0.74