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
sourceimpl 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 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
sourceimpl Clone for RangeQueryBuilder
impl Clone for RangeQueryBuilder
sourcefn clone(&self) -> RangeQueryBuilder
fn clone(&self) -> RangeQueryBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for RangeQueryBuilder
impl Send for RangeQueryBuilder
impl Sync for RangeQueryBuilder
impl Unpin for RangeQueryBuilder
impl !UnwindSafe for RangeQueryBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more