Skip to main content

PromQueryInterceptor

Trait PromQueryInterceptor 

Source
pub trait PromQueryInterceptor {
    type Error: ErrorExt;

    // Provided methods
    fn pre_execute(
        &self,
        _query: &PromQuery,
        _expr: &Expr,
        _plan: Option<&LogicalPlan>,
        _query_ctx: QueryContextRef,
    ) -> Result<(), Self::Error> { ... }
    fn post_execute(
        &self,
        output: Output,
        _query_ctx: QueryContextRef,
    ) -> Result<Output, Self::Error> { ... }
}
Expand description

PromQueryInterceptor can track life cycle of a prometheus request and customize or abort its execution at given point.

Required Associated Types§

Source

type Error: ErrorExt

Provided Methods§

Source

fn pre_execute( &self, _query: &PromQuery, _expr: &Expr, _plan: Option<&LogicalPlan>, _query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Called before request is actually executed.

Source

fn post_execute( &self, output: Output, _query_ctx: QueryContextRef, ) -> Result<Output, Self::Error>

Called after execution finished. The implementation can modify the output if needed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<E> PromQueryInterceptor for Option<&PromQueryInterceptorRef<E>>
where E: ErrorExt,

Source§

type Error = E

Source§

fn pre_execute( &self, query: &PromQuery, expr: &Expr, plan: Option<&LogicalPlan>, query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Source§

fn post_execute( &self, output: Output, query_ctx: QueryContextRef, ) -> Result<Output, Self::Error>

Source§

impl<E> PromQueryInterceptor for Option<PromQueryInterceptorRef<E>>
where E: ErrorExt,

Source§

type Error = E

Source§

fn pre_execute( &self, query: &PromQuery, expr: &Expr, plan: Option<&LogicalPlan>, query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Source§

fn post_execute( &self, output: Output, query_ctx: QueryContextRef, ) -> Result<Output, Self::Error>

Implementors§