pub trait PrometheusHandler {
// Required methods
fn do_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 PromQuery,
query_ctx: QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_query_permission<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [PromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn check_query_target_permission<'life0, 'life1, 'async_trait>(
&'life0 self,
targets: PermissionTableTargets,
query_ctx: &'life1 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn filter_metadata_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
metric_names: Vec<String>,
schema: &'life1 str,
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn query_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
matchers: Vec<Matcher>,
schema: &'life1 str,
ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn query_label_values<'life0, 'life1, 'async_trait>(
&'life0 self,
metric: String,
label_name: String,
matchers: Vec<Matcher>,
start: SystemTime,
end: SystemTime,
ctx: &'life1 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn catalog_manager(&self) -> CatalogManagerRef;
// Provided methods
fn do_query_parsed<'life0, 'async_trait>(
&'life0 self,
query: ParsedPromQuery,
query_ctx: QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn check_query_permission_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [ParsedPromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Required Methods§
fn do_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 PromQuery,
query_ctx: QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn check_query_permission<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [PromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check_query_permission<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [PromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Checks access to every table referenced by a batch of PromQL queries.
An empty batch still checks the operation privilege.
Sourcefn check_query_target_permission<'life0, 'life1, 'async_trait>(
&'life0 self,
targets: PermissionTableTargets,
query_ctx: &'life1 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_query_target_permission<'life0, 'life1, 'async_trait>(
&'life0 self,
targets: PermissionTableTargets,
query_ctx: &'life1 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks access to targets resolved by Prometheus metadata APIs.
Sourcefn filter_metadata_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
metric_names: Vec<String>,
schema: &'life1 str,
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn filter_metadata_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
metric_names: Vec<String>,
schema: &'life1 str,
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Removes inaccessible metric names from logical-table metadata enumeration results.
Sourcefn query_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
matchers: Vec<Matcher>,
schema: &'life1 str,
ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_metric_names<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
matchers: Vec<Matcher>,
schema: &'life1 str,
ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Query metric table names by the __name__ matchers.
fn query_label_values<'life0, 'life1, 'async_trait>(
&'life0 self,
metric: String,
label_name: String,
matchers: Vec<Matcher>,
start: SystemTime,
end: SystemTime,
ctx: &'life1 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn catalog_manager(&self) -> CatalogManagerRef
Provided Methods§
Sourcefn do_query_parsed<'life0, 'async_trait>(
&'life0 self,
query: ParsedPromQuery,
query_ctx: QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn do_query_parsed<'life0, 'async_trait>(
&'life0 self,
query: ParsedPromQuery,
query_ctx: QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Executes a query whose statement has already been parsed.
Sourcefn check_query_permission_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [ParsedPromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check_query_permission_parsed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queries: &'life1 [ParsedPromQuery],
query_ctx: &'life2 QueryContextRef,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Checks access without parsing the queries again.