Skip to content

Commit db307ec

Browse files
committed
Add Error API for pusher
Signed-off-by: kun <oiooj@qq.com>
1 parent 4ad265f commit db307ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

prometheus/push/push.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ func (p *Pusher) Collector(c prometheus.Collector) *Pusher {
168168
return p
169169
}
170170

171+
// Error returns the error that was encountered.
172+
func (p *Pusher) Error() error {
173+
return p.error
174+
}
175+
171176
// Grouping adds a label pair to the grouping key of the Pusher, replacing any
172177
// previously added label pair with the same label name. Note that setting any
173178
// labels in the grouping key that are already contained in the metrics to push

0 commit comments

Comments
 (0)