From f6b1978ed4eb7212c0463250e9e5e662d4ea3f28 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Thu, 7 Jun 2018 14:35:06 +0200 Subject: [PATCH] Use stricter wording for Gather returning a non-nil error Signed-off-by: beorn7 --- prometheus/registry.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prometheus/registry.go b/prometheus/registry.go index 9306cbb..fdb7bad 100644 --- a/prometheus/registry.go +++ b/prometheus/registry.go @@ -138,9 +138,11 @@ type Gatherer interface { // prevented any meaningful metric collection) or contain a number of // MetricFamily protobufs, some of which might be incomplete, and some // might be missing altogether. The returned error (which might be a - // MultiError) explains the details. In scenarios where complete - // collection is critical, the returned MetricFamily protobufs should be - // disregarded if the returned error is non-nil. + // MultiError) explains the details. Note that this is mostly useful for + // debugging purposes. If the gathered protobufs are to be used for + // exposition in actual monitoring, it is almost always better to not + // expose an incomplete result and instead disregard the returned + // MetricFamily protobufs in case the returned error is non-nil. Gather() ([]*dto.MetricFamily, error) }