Files
greptimedb/servers/http/prometheus/index.html
T

16 lines
22 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="prom supply the prometheus HTTP API Server compliance"><title>servers::http::prometheus - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-1ed95124.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="servers" data-themes="" data-resource-suffix="" data-rustdoc-version="1.98.1 (48a229cea 2026-09-01)" data-channel="1.98.1" data-search-js="search-9944d736.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-417ebf0a.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module prometheus</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../servers/index.html">servers</a><span class="version">1.4.0-alpha.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module prometheus</a></h2><h3><a href="#macros">Module Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In servers::<wbr>http</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">servers</a>::<wbr><a href="../index.html">http</a></div><h1>Module <span>prometheus</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/servers/http/prometheus.rs.html#15-4248">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>prom supply the prometheus HTTP API Server compliance</p>
</div></details><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.handle_schema_err.html" title="macro servers::http::prometheus::handle_schema_err">handle_<wbr>schema_<wbr>err</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Handles schema errors, transforming a Result into an Option.</dd><dt><a class="macro" href="macro.try_call_return_response.html" title="macro servers::http::prometheus::try_call_return_response">try_<wbr>call_<wbr>return_<wbr>response</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Helper macro which try to evaluate the expression and return its results.
If the evaluation fails, return a <code>PrometheusJsonResponse</code> early.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.BuildInfoQuery.html" title="struct servers::http::prometheus::BuildInfoQuery">Build<wbr>Info<wbr>Query</a></dt><dt><a class="struct" href="struct.Column.html" title="struct servers::http::prometheus::Column">Column</a></dt><dd>A “holder” for the reference(<a href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>) to a column name,
to help avoiding cloning <a href="https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>s when used as a <a href="https://doc.rust-lang.org/1.98.1/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a> key.</dd><dt><a class="struct" href="struct.ColumnRef.html" title="struct servers::http::prometheus::ColumnRef">Column<wbr>Ref</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.FormatQuery.html" title="struct servers::http::prometheus::FormatQuery">Format<wbr>Query</a></dt><dt><a class="struct" href="struct.InstantQuery.html" title="struct servers::http::prometheus::InstantQuery">Instant<wbr>Query</a></dt><dt><a class="struct" href="struct.LabelValueQuery.html" title="struct servers::http::prometheus::LabelValueQuery">Label<wbr>Value<wbr>Query</a></dt><dt><a class="struct" href="struct.LabelsQuery.html" title="struct servers::http::prometheus::LabelsQuery">Labels<wbr>Query</a></dt><dt><a class="struct" href="struct.Matches.html" title="struct servers::http::prometheus::Matches">Matches</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.MetadataQuery.html" title="struct servers::http::prometheus::MetadataQuery">Metadata<wbr>Query</a></dt><dd>Query parameters for the Prometheus metric metadata endpoint.</dd><dt><a class="struct" href="struct.MetricNameDiscovery.html" title="struct servers::http::prometheus::MetricNameDiscovery">Metric<wbr>Name<wbr>Discovery</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.ParseQuery.html" title="struct servers::http::prometheus::ParseQuery">Parse<wbr>Query</a></dt><dt><a class="struct" href="struct.PromData.html" title="struct servers::http::prometheus::PromData">Prom<wbr>Data</a></dt><dt><a class="struct" href="struct.PromMetadata.html" title="struct servers::http::prometheus::PromMetadata">Prom<wbr>Metadata</a></dt><dd>Metadata for a Prometheus metric family.</dd><dt><a class="struct" href="struct.PromNativeHistogram.html" title="struct servers::http::prometheus::PromNativeHistogram">Prom<wbr>Native<wbr>Histogram</a></dt><dd>A native histogram sample in the Prometheus HTTP API JSON format.</dd><dt><a class="struct" href="struct.PromSeriesMatrix.html" title="struct servers::http::prometheus::PromSeriesMatrix">Prom<wbr>Series<wbr>Matrix</a></dt><dd>For [ValueType::Matrix] result type</dd><dt><a class="struct" href="struct.PromSeriesVector.html" title="struct servers::http::prometheus::PromSeriesVector">Prom<wbr>Series<wbr>Vector</a></dt><dd>For [ValueType::Vector] result type</dd><dt><a class="struct" href="struct.PrometheusJsonResponse.html" title="struct servers::http::prometheus::PrometheusJsonResponse">Prometheus<wbr>Json<wbr>Response</a></dt><dt><a class="struct" href="struct.RangeQuery.html" title="struct servers::http::prometheus::RangeQuery">Range<wbr>Query</a></dt><dt><a class="struct" href="struct.RowWriter.html" title="struct servers::http::prometheus::RowWriter">RowWriter</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Writer from a row in the record batch to a Prometheus time series:</dd><dt><a class="struct" href="struct.SeriesQuery.html" title="struct servers::http::prometheus::SeriesQuery">Series<wbr>Query</a></dt></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.PromQueryResult.html" title="enum servers::http::prometheus::PromQueryResult">Prom<wbr>Query<wbr>Result</a></dt><dd>Variants corresponding to [ValueType]</dd><dt><a class="enum" href="enum.PromSampleValue.html" title="enum servers::http::prometheus::PromSampleValue">Prom<wbr>Sample<wbr>Value</a></dt><dd>A sample value of the Prometheus HTTP API JSON format.</dd><dt><a class="enum" href="enum.PrometheusResponse.html" title="enum servers::http::prometheus::PrometheusResponse">Prometheus<wbr>Response</a></dt></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.AsColumnRef.html" title="trait servers::http::prometheus::AsColumnRef">AsColumn<wbr>Ref</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.binary_keeps_metric_name.html" title="fn servers::http::prometheus::binary_keeps_metric_name">binary_<wbr>keeps_<wbr>metric_<wbr>name</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Whether the metric name survives a binary operation; see
<a href="fn.binary_metric_name_side.html" title="fn servers::http::prometheus::binary_metric_name_side"><code>binary_metric_name_side</code></a> for the operand that supplies it.</dd><dt><a class="fn" href="fn.binary_metric_name_side.html" title="fn servers::http::prometheus::binary_metric_name_side">binary_<wbr>metric_<wbr>name_<wbr>side</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>The operand whose labels supply the result metric name of a binary
operation.</dd><dt><a class="fn" href="fn.build_info_query.html" title="fn servers::http::prometheus::build_info_query">build_<wbr>info_<wbr>query</a></dt><dt><a class="fn" href="fn.collect_metric_names.html" title="fn servers::http::prometheus::collect_metric_names">collect_<wbr>metric_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Recursively collect all metric names from a PromQL expression</dd><dt><a class="fn" href="fn.collect_static_promql_targets.html" title="fn servers::http::prometheus::collect_static_promql_targets">collect_<wbr>static_<wbr>promql_<wbr>targets</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.collect_static_vector_target.html" title="fn servers::http::prometheus::collect_static_vector_target">collect_<wbr>static_<wbr>vector_<wbr>target</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.current_schema_metric_targets.html" title="fn servers::http::prometheus::current_schema_metric_targets">current_<wbr>schema_<wbr>metric_<wbr>targets</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.do_instant_query.html" title="fn servers::http::prometheus::do_instant_query">do_<wbr>instant_<wbr>query</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Executes a single instant query and returns response</dd><dt><a class="fn" href="fn.do_range_query.html" title="fn servers::http::prometheus::do_range_query">do_<wbr>range_<wbr>query</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Executes a single range query and returns response</dd><dt><a class="fn" href="fn.expand_metric_name_queries.html" title="fn servers::http::prometheus::expand_metric_name_queries">expand_<wbr>metric_<wbr>name_<wbr>queries</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.extend_tag_column_names.html" title="fn servers::http::prometheus::extend_tag_column_names">extend_<wbr>tag_<wbr>column_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.find_metric_name_and_matchers.html" title="fn servers::http::prometheus::find_metric_name_and_matchers">find_<wbr>metric_<wbr>name_<wbr>and_<wbr>matchers</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.find_metric_name_not_equal_matchers.html" title="fn servers::http::prometheus::find_metric_name_not_equal_matchers">find_<wbr>metric_<wbr>name_<wbr>not_<wbr>equal_<wbr>matchers</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Finds non-equality <code>__name__</code> matchers and their unambiguous schema.</dd><dt><a class="fn" href="fn.format_query.html" title="fn servers::http::prometheus::format_query">format_<wbr>query</a></dt><dt><a class="fn" href="fn.get_all_column_names.html" title="fn servers::http::prometheus::get_all_column_names">get_<wbr>all_<wbr>column_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Get all tag column name of the given schema</dd><dt><a class="fn" href="fn.get_catalog_schema.html" title="fn servers::http::prometheus::get_catalog_schema">get_<wbr>catalog_<wbr>schema</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Tries to get catalog and schema from an optional db param. And retrieves
them from [QueryContext] if they don’t present.</dd><dt><a class="fn" href="fn.get_target_column_names.html" title="fn servers::http::prometheus::get_target_column_names">get_<wbr>target_<wbr>column_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.instant_query.html" title="fn servers::http::prometheus::instant_query">instant_<wbr>query</a></dt><dt><a class="fn" href="fn.is_internal_physical_metric_table.html" title="fn servers::http::prometheus::is_internal_physical_metric_table">is_<wbr>internal_<wbr>physical_<wbr>metric_<wbr>table</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.is_ordinary_label_matcher.html" title="fn servers::http::prometheus::is_ordinary_label_matcher">is_<wbr>ordinary_<wbr>label_<wbr>matcher</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>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.</dd><dt><a class="fn" href="fn.is_prometheus_metric_table.html" title="fn servers::http::prometheus::is_prometheus_metric_table">is_<wbr>prometheus_<wbr>metric_<wbr>table</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.is_prometheus_value_column.html" title="fn servers::http::prometheus::is_prometheus_value_column">is_<wbr>prometheus_<wbr>value_<wbr>column</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.label_values_query.html" title="fn servers::http::prometheus::label_values_query">label_<wbr>values_<wbr>query</a></dt><dt><a class="fn" href="fn.labels_query.html" title="fn servers::http::prometheus::labels_query">labels_<wbr>query</a></dt><dt><a class="fn" href="fn.metadata_query.html" title="fn servers::http::prometheus::metadata_query">metadata_<wbr>query</a></dt><dt><a class="fn" href="fn.metric_name_matches.html" title="fn servers::http::prometheus::metric_name_matches">metric_<wbr>name_<wbr>matches</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Whether a metric name satisfies every <code>__name__</code> matcher of one selector.</dd><dt><a class="fn" href="fn.parse_query.html" title="fn servers::http::prometheus::parse_query">parse_<wbr>query</a></dt><dt><a class="fn" href="fn.prometheus_metadata_from_table.html" title="fn servers::http::prometheus::prometheus_metadata_from_table">prometheus_<wbr>metadata_<wbr>from_<wbr>table</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.promql_expr_to_metric_name.html" title="fn servers::http::prometheus::promql_expr_to_metric_name">promql_<wbr>expr_<wbr>to_<wbr>metric_<wbr>name</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.range_query.html" title="fn servers::http::prometheus::range_query">range_<wbr>query</a></dt><dt><a class="fn" href="fn.record_batches_to_labels_name.html" title="fn servers::http::prometheus::record_batches_to_labels_name">record_<wbr>batches_<wbr>to_<wbr>labels_<wbr>name</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Retrieve labels name from record batches</dd><dt><a class="fn" href="fn.record_batches_to_series.html" title="fn servers::http::prometheus::record_batches_to_series">record_<wbr>batches_<wbr>to_<wbr>series</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.resolved_promql_targets.html" title="fn servers::http::prometheus::resolved_promql_targets">resolved_<wbr>promql_<wbr>targets</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_exact_metric_name_from_promql.html" title="fn servers::http::prometheus::retrieve_exact_metric_name_from_promql">retrieve_<wbr>exact_<wbr>metric_<wbr>name_<wbr>from_<wbr>promql</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_field_names.html" title="fn servers::http::prometheus::retrieve_field_names">retrieve_<wbr>field_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_labels_name_from_query_result.html" title="fn servers::http::prometheus::retrieve_labels_name_from_query_result">retrieve_<wbr>labels_<wbr>name_<wbr>from_<wbr>query_<wbr>result</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Retrieve labels name from query result</dd><dt><a class="fn" href="fn.retrieve_metric_metadata.html" title="fn servers::http::prometheus::retrieve_metric_metadata">retrieve_<wbr>metric_<wbr>metadata</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_metric_name_and_result_type.html" title="fn servers::http::prometheus::retrieve_metric_name_and_result_type">retrieve_<wbr>metric_<wbr>name_<wbr>and_<wbr>result_<wbr>type</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_schema_names.html" title="fn servers::http::prometheus::retrieve_schema_names">retrieve_<wbr>schema_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_series_from_query_result.html" title="fn servers::http::prometheus::retrieve_series_from_query_result">retrieve_<wbr>series_<wbr>from_<wbr>query_<wbr>result</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_table_names.html" title="fn servers::http::prometheus::retrieve_table_names">retrieve_<wbr>table_<wbr>names</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.retrieve_table_names_by_labels.html" title="fn servers::http::prometheus::retrieve_table_names_by_labels">retrieve_<wbr>table_<wbr>names_<wbr>by_<wbr>labels</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Resolves selectors constraining ordinary labels into metric names: the data
answers the label matchers, then each selector’s <code>__name__</code> matchers narrow
the names it found.</dd><dt><a class="fn" href="fn.series_query.html" title="fn servers::http::prometheus::series_query">series_<wbr>query</a></dt><dt><a class="fn" href="fn.split_selectors_by_label_use.html" title="fn servers::http::prometheus::split_selectors_by_label_use">split_<wbr>selectors_<wbr>by_<wbr>label_<wbr>use</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Splits <code>match[]</code> 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.</dd><dt><a class="fn" href="fn.static_promql_targets.html" title="fn servers::http::prometheus::static_promql_targets">static_<wbr>promql_<wbr>targets</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.table_has_native_histogram_value.html" title="fn servers::http::prometheus::table_has_native_histogram_value">table_<wbr>has_<wbr>native_<wbr>histogram_<wbr>value</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.take_metric_name.html" title="fn servers::http::prometheus::take_metric_name">take_<wbr>metric_<wbr>name</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Take metric name from the [VectorSelector].
It takes the name in the selector or removes the name matcher.</dd><dt><a class="fn" href="fn.take_metric_name_matchers.html" title="fn servers::http::prometheus::take_metric_name_matchers">take_<wbr>metric_<wbr>name_<wbr>matchers</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Removes every <code>__name__</code> matcher from the selector and returns them, so the
rest can be planned as column predicates. A name given as <code>VectorSelector::name</code>
comes back as an equality matcher, making both spellings filter alike.</dd><dt><a class="fn" href="fn.truncate_results.html" title="fn servers::http::prometheus::truncate_results">truncate_<wbr>results</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.try_update_catalog_schema.html" title="fn servers::http::prometheus::try_update_catalog_schema">try_<wbr>update_<wbr>catalog_<wbr>schema</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Update catalog and schema in [QueryContext] if necessary.</dd><dt><a class="fn" href="fn.update_metric_name_matcher.html" title="fn servers::http::prometheus::update_metric_name_matcher">update_<wbr>metric_<wbr>name_<wbr>matcher</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>Update the <code>__name__</code> matchers in expression into special value
Returns the updated expression.</dd></dl></section></div></main></body></html>