Skip to main content

Module prometheus

Module prometheus 

Source
Expand description

prom supply the prometheus HTTP API Server compliance

MacrosΒ§

handle_schema_err πŸ”’
Handles schema errors, transforming a Result into an Option.
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
Column
A β€œholder” for the reference(Arc) to a column name, to help avoiding cloning Strings when used as a HashMap key.
ColumnRef πŸ”’
FormatQuery
InstantQuery
LabelValueQuery
LabelsQuery
Matches πŸ”’
MetadataQuery
Query parameters for the Prometheus metric metadata endpoint.
MetricNameDiscovery πŸ”’
ParseQuery
PromData
PromMetadata
Metadata for a Prometheus metric family.
PromNativeHistogram
A native histogram sample in the Prometheus HTTP API JSON format.
PromSeriesMatrix
For [ValueType::Matrix] result type
PromSeriesVector
For [ValueType::Vector] result type
PrometheusJsonResponse
RangeQuery
RowWriter πŸ”’
Writer from a row in the record batch to a Prometheus time series:
SeriesQuery

EnumsΒ§

PromQueryResult
Variants corresponding to [ValueType]
PromSampleValue
A sample value of the Prometheus HTTP API JSON format.
PrometheusResponse

TraitsΒ§

AsColumnRef πŸ”’

FunctionsΒ§

build_info_query
collect_metric_names πŸ”’
Recursively collect all metric names from a PromQL expression
collect_static_promql_targets πŸ”’
collect_static_vector_target πŸ”’
current_schema_metric_targets πŸ”’
do_instant_query πŸ”’
Executes a single instant query and returns response
do_range_query πŸ”’
Executes a single range query and returns response
expand_metric_name_queries πŸ”’
extend_tag_column_names πŸ”’
find_metric_name_and_matchers πŸ”’
find_metric_name_not_equal_matchers πŸ”’
Finds non-equality __name__ matchers and their unambiguous schema.
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.
get_target_column_names πŸ”’
instant_query
is_internal_physical_metric_table πŸ”’
is_ordinary_label_matcher πŸ”’
Whether a matcher constrains an ordinary label. The others name the metric, the database or the field, none of which is a column to scan.
is_prometheus_metric_table πŸ”’
is_prometheus_value_column πŸ”’
label_values_query
labels_query
metadata_query
metric_name_matches πŸ”’
Whether a metric name satisfies every __name__ matcher of one selector.
parse_query
prometheus_metadata_from_table πŸ”’
promql_expr_to_metric_name πŸ”’
range_query
record_batches_to_labels_name πŸ”’
Retrieve labels name from record batches
record_batches_to_series πŸ”’
resolved_promql_targets πŸ”’
retrieve_exact_metric_name_from_promql πŸ”’
retrieve_field_names πŸ”’
retrieve_labels_name_from_query_result πŸ”’
Retrieve labels name from query result
retrieve_metric_metadata πŸ”’
retrieve_metric_name_and_result_type πŸ”’
retrieve_schema_names πŸ”’
retrieve_series_from_query_result πŸ”’
retrieve_table_names πŸ”’
retrieve_table_names_by_labels πŸ”’
Resolves selectors constraining ordinary labels into metric names: the data answers the label matchers, then each selector’s __name__ matchers narrow the names it found.
series_query
split_selectors_by_label_use πŸ”’
Splits match[] selectors by whether they constrain an ordinary label. The first group is answerable from table metadata; the second needs the data read and is returned as parsed selectors.
static_promql_targets πŸ”’
table_has_native_histogram_value πŸ”’
take_metric_name πŸ”’
Take metric name from the [VectorSelector]. It takes the name in the selector or removes the name matcher.
take_metric_name_matchers πŸ”’
Removes every __name__ matcher from the selector and returns them, so the rest can be planned as column predicates. A name given as VectorSelector::name comes back as an equality matcher, making both spellings filter alike.
truncate_results πŸ”’
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.