Skip to content

Commit

Permalink
Document WithTimeout options for Query/QueryRange
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>
  • Loading branch information
josephwoodward committed Apr 29, 2022
1 parent 4dcf02e commit 62df418
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/prometheus/v1/api.go
Expand Up @@ -824,6 +824,8 @@ type apiOptions struct {

type Option func(c *apiOptions)

// WithTimeout can be used to provide an optional query evaluation timeout for Query and QueryRange.
// https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries
func WithTimeout(timeout time.Duration) Option {
return func(o *apiOptions) {
o.timeout = timeout
Expand Down

0 comments on commit 62df418

Please sign in to comment.