pub trait PromStoreProtocolInterceptor {
type Error: ErrorExt;
// Required method
fn pre_write_exemplars(
&self,
exemplars: &ExemplarBatch,
ctx: QueryContextRef,
) -> Result<(), Self::Error>;
// Provided methods
fn pre_write(
&self,
_write_req: &RowInsertRequests,
_ctx: QueryContextRef,
) -> Result<(), Self::Error> { ... }
fn pre_read(
&self,
_read_req: &ReadRequest,
_ctx: QueryContextRef,
) -> Result<(), Self::Error> { ... }
}Expand description
PromStoreProtocolInterceptor can track life cycle of a prom store request and customize or abort its execution at given point.
Required Associated Types§
Required Methods§
Sourcefn pre_write_exemplars(
&self,
exemplars: &ExemplarBatch,
ctx: QueryContextRef,
) -> Result<(), Self::Error>
fn pre_write_exemplars( &self, exemplars: &ExemplarBatch, ctx: QueryContextRef, ) -> Result<(), Self::Error>
Checks exemplar batches and may redirect their destination through ctx.
Implement the exemplar policy here because these batches bypass Self::pre_write.
Provided Methods§
fn pre_write( &self, _write_req: &RowInsertRequests, _ctx: QueryContextRef, ) -> Result<(), Self::Error>
fn pre_read( &self, _read_req: &ReadRequest, _ctx: QueryContextRef, ) -> Result<(), Self::Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".