Module prometheus

Source
Expand description

prom supply the prometheus HTTP API Server compliance

MacrosΒ§

try_call_return_response πŸ”’
Helper macro which try to evaluate the expression and return its results. If the evaluation fails, return a PrometheusJsonResponse early.

StructsΒ§

BuildInfoQuery
FormatQuery
InstantQuery
LabelValueQuery
LabelsQuery
Matches πŸ”’
ParseQuery
PromData
PromSeriesMatrix
For [ValueType::Matrix] result type
PromSeriesVector
For [ValueType::Vector] result type
PrometheusJsonResponse
RangeQuery
SeriesQuery

EnumsΒ§

PromQueryResult
Variants corresponding to [ValueType]
PrometheusResponse

FunctionsΒ§

build_info_query
do_instant_query πŸ”’
Executes a single instant query and returns response
do_range_query πŸ”’
Executes a single range query and returns response
find_metric_name_and_matchers πŸ”’
find_metric_name_not_equal_matchers πŸ”’
Try to find the __name__ matchers which op is not MatchOp::Equal.
format_query
get_all_column_names πŸ”’
Get all tag column name of the given schema
get_catalog_schema πŸ”’
Tries to get catalog and schema from an optional db param. And retrieves them from QueryContext if they don’t present.
instant_query
label_values_query
labels_query
parse_query
promql_expr_to_metric_name πŸ”’
range_query
record_batches_to_labels_name πŸ”’
Retrieve labels name from record batches
record_batches_to_series πŸ”’
retrieve_field_names πŸ”’
retrieve_labels_name_from_query_result πŸ”’
Retrieve labels name from query result
retrieve_metric_name_and_result_type πŸ”’
retrieve_metric_name_from_promql πŸ”’
Try to parse and extract the name of referenced metric from the promql query.
retrieve_series_from_query_result πŸ”’
series_query
take_metric_name πŸ”’
Take metric name from the [VectorSelector]. It takes the name in the selector or removes the name matcher.
try_update_catalog_schema πŸ”’
Update catalog and schema in QueryContext if necessary.
update_metric_name_matcher πŸ”’
Update the __name__ matchers in expression into special value Returns the updated expression.