MCPcopy
hub / github.com/prometheus/client_golang / WithTimeout

Function WithTimeout

api/prometheus/v1/api.go:1098–1102  ·  view source on GitHub ↗

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

(timeout time.Duration)

Source from the content-addressed store, hash-verified

1096// WithTimeout can be used to provide an optional query evaluation timeout for Query and QueryRange.
1097// https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries
1098func WithTimeout(timeout time.Duration) Option {
1099 return func(o *apiOptions) {
1100 o.timeout = timeout
1101 }
1102}
1103
1104// WithLookbackDelta can be used to provide an optional query lookback delta for Query and QueryRange.
1105// This URL variable is not documented on Prometheus HTTP API.

Callers 3

ExampleAPI_queryFunction · 0.92
ExampleAPI_queryRangeFunction · 0.92
TestAPIsFunction · 0.85

Calls

no outgoing calls

Tested by 3

ExampleAPI_queryFunction · 0.74
ExampleAPI_queryRangeFunction · 0.74
TestAPIsFunction · 0.68