File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -273,9 +273,12 @@ type GaugeFunc interface {
273
273
// NewGaugeFunc creates a new GaugeFunc based on the provided GaugeOpts. The
274
274
// value reported is determined by calling the given function from within the
275
275
// Write method. Take into account that metric collection may happen
276
- // concurrently. If that results in concurrent calls to Write, like in the case
277
- // where a GaugeFunc is directly registered with Prometheus, the provided
278
- // function must be concurrency-safe.
276
+ // concurrently. Therefore, it must be safe to call the provided function
277
+ // concurrently.
278
+ //
279
+ // NewGaugeFunc is a good way to create an “info” style metric with a constant
280
+ // value of 1. Example:
281
+ // https://github.com/prometheus/common/blob/8558a5b7db3c84fa38b4766966059a7bd5bfa2ee/version/info.go#L36-L56
279
282
func NewGaugeFunc (opts GaugeOpts , function func () float64 ) GaugeFunc {
280
283
return newValueFunc (NewDesc (
281
284
BuildFQName (opts .Namespace , opts .Subsystem , opts .Name ),
You can’t perform that action at this time.
0 commit comments