Struct prometheus_http_query::RangeQueryBuilder
source · pub struct RangeQueryBuilder { /* private fields */ }
Expand description
A builder object used to set some query parameters in the context of a range query before sending the query on its way.
Implementations§
source§impl RangeQueryBuilder
impl RangeQueryBuilder
sourcepub fn timeout(self, timeout: i64) -> Self
pub fn timeout(self, timeout: i64) -> Self
Set the evaluation timeout (milliseconds, e.g. 1000). If this is not set the timeout will default to the value of the “-query.timeout” flag of the Prometheus server. See also: Prometheus API documentation
sourcepub fn stats(self) -> Self
pub fn stats(self) -> Self
Instruct Prometheus to compile query statistics as part of the API response.
sourcepub fn header<K: IntoHeaderName, T: Into<HeaderValue>>(
self,
name: K,
value: T
) -> Self
pub fn header<K: IntoHeaderName, T: Into<HeaderValue>>( self, name: K, value: T ) -> Self
Include an additional header to the request.
sourcepub async fn get(self) -> Result<PromqlResult, Error>
pub async fn get(self) -> Result<PromqlResult, Error>
Execute the range query (using HTTP GET) and return the parsed API response.
sourcepub async fn post(self) -> Result<PromqlResult, Error>
pub async fn post(self) -> Result<PromqlResult, Error>
Execute the instant query (using HTTP POST) and return the parsed API response. Using a POST request is useful in the context of larger PromQL queries when the size of the final URL may break Prometheus’ or an intermediate proxies’ URL character limits.
Trait Implementations§
source§impl Clone for RangeQueryBuilder
impl Clone for RangeQueryBuilder
source§fn clone(&self) -> RangeQueryBuilder
fn clone(&self) -> RangeQueryBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more