@@ -58,6 +58,11 @@ func (m *MetricVec) Collect(ch chan<- Metric) {
58
58
// GetMetricWithLabelValues returns the Metric for the given slice of label
59
59
// values (same order as the VariableLabels in Desc). If that combination of
60
60
// label values is accessed for the first time, a new Metric is created.
61
+ //
62
+ // It is possible to call this method without using the returned Metric to only
63
+ // create the new Metric but leave it at its start value (e.g. a Summary or
64
+ // Histogram without any observations). See also the SummaryVec example.
65
+ //
61
66
// Keeping the Metric for later use is possible (and should be considered if
62
67
// performance is critical), but keep in mind that Reset, DeleteLabelValues and
63
68
// Delete can be used to delete the Metric from the MetricVec. In that case, the
@@ -87,8 +92,9 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) {
87
92
88
93
// GetMetricWith returns the Metric for the given Labels map (the label names
89
94
// must match those of the VariableLabels in Desc). If that label map is
90
- // accessed for the first time, a new Metric is created. Implications of keeping
91
- // the Metric are the same as for GetMetricWithLabelValues.
95
+ // accessed for the first time, a new Metric is created. Implications of
96
+ // creating a Metric without using it and keeping the Metric for later use are
97
+ // the same as for GetMetricWithLabelValues.
92
98
//
93
99
// An error is returned if the number and names of the Labels are inconsistent
94
100
// with those of the VariableLabels in Desc.
0 commit comments