mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-15 12:30:38 +00:00
7 lines
15 KiB
HTML
7 lines
15 KiB
HTML
<!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-17e0aaed.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.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.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-5013f961.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.0.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> <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-1898">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"> 🔒</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"> 🔒</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/nightly/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/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>s when used as a <a href="https://doc.rust-lang.org/nightly/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"> 🔒</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"> 🔒</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.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"> 🔒</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.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"> 🔒</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.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"> 🔒</span> </dt><dd>Recursively collect all metric names from a PromQL expression</dd><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"> 🔒</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"> 🔒</span> </dt><dd>Executes a single range query and returns response</dd><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"> 🔒</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"> 🔒</span> </dt><dd>Try to find the <code>__name__</code> matchers which op is not <code>MatchOp::Equal</code>.</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"> 🔒</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"> 🔒</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.instant_query.html" title="fn servers::http::prometheus::instant_query">instant_<wbr>query</a></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.parse_query.html" title="fn servers::http::prometheus::parse_query">parse_<wbr>query</a></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"> 🔒</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"> 🔒</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"> 🔒</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"> 🔒</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"> 🔒</span> </dt><dd>Retrieve labels name from query result</dd><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"> 🔒</span> </dt><dt><a class="fn" href="fn.retrieve_metric_name_from_promql.html" title="fn servers::http::prometheus::retrieve_metric_name_from_promql">retrieve_<wbr>metric_<wbr>name_<wbr>from_<wbr>promql</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Try to parse and extract the name of referenced metric from the promql query.</dd><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"> 🔒</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"> 🔒</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"> 🔒</span> </dt><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.take_metric_name.html" title="fn servers::http::prometheus::take_metric_name">take_<wbr>metric_<wbr>name</a><span title="Restricted Visibility"> 🔒</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.truncate_results.html" title="fn servers::http::prometheus::truncate_results">truncate_<wbr>results</a><span title="Restricted Visibility"> 🔒</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"> 🔒</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"> 🔒</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> |