Skip to content

Commit

Permalink
push.go: document that PushOptions.WaitGroup can be used for waiting …
Browse files Browse the repository at this point in the history
…for background push workers to stop

This is a follow-up for c45a8b1
  • Loading branch information
valyala committed Jan 15, 2024
1 parent c45a8b1 commit 64b88f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions push.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type PushOptions struct {
// InitPushWithOptions sets up periodic push for globally registered metrics to the given pushURL with the given interval.
//
// The periodic push is stopped when ctx is canceled.
// It is possible to wait until the background metrics push worker is stopped on a WaitGroup passed via opts.WaitGroup.
//
// If pushProcessMetrics is set to true, then 'process_*' and `go_*` metrics are also pushed to pushURL.
//
Expand Down Expand Up @@ -116,6 +117,7 @@ func PushMetrics(ctx context.Context, pushURL string, pushProcessMetrics bool, o
// InitPushWithOptions sets up periodic push for metrics from s to the given pushURL with the given interval.
//
// The periodic push is stopped when the ctx is canceled.
// It is possible to wait until the background metrics push worker is stopped on a WaitGroup passed via opts.WaitGroup.
//
// opts may contain additional configuration options if non-nil.
//
Expand Down Expand Up @@ -187,6 +189,7 @@ func InitPushExt(pushURL string, interval time.Duration, extraLabels string, wri
// See https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format
//
// The periodic push is stopped when the ctx is canceled.
// It is possible to wait until the background metrics push worker is stopped on a WaitGroup passed via opts.WaitGroup.
//
// opts may contain additional configuration options if non-nil.
//
Expand Down

0 comments on commit 64b88f0

Please sign in to comment.