From db307eca4ca97df50bc8c49684c680d7d497031b Mon Sep 17 00:00:00 2001 From: kun Date: Thu, 30 Jun 2022 16:25:20 +0800 Subject: [PATCH] Add Error API for pusher Signed-off-by: kun --- prometheus/push/push.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prometheus/push/push.go b/prometheus/push/push.go index a0d009c21..9d03d8bec 100644 --- a/prometheus/push/push.go +++ b/prometheus/push/push.go @@ -168,6 +168,11 @@ func (p *Pusher) Collector(c prometheus.Collector) *Pusher { return p } +// Error returns the error that was encountered. +func (p *Pusher) Error() error { + return p.error +} + // Grouping adds a label pair to the grouping key of the Pusher, replacing any // previously added label pair with the same label name. Note that setting any // labels in the grouping key that are already contained in the metrics to push