Files
greptimedb/servers/http/loki/index.html
2026-05-15 04:01:35 +00:00

38 lines
9.7 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="API documentation for the Rust `loki` mod in crate `servers`."><title>servers::http::loki - 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 loki</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 loki</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</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>loki</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/loki.rs.html#15-834">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.JsonStreamItem.html" title="struct servers::http::loki::JsonStreamItem">Json<wbr>Stream<wbr>Item</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.LOKI_INIT_SCHEMAS.html" title="struct servers::http::loki::LOKI_INIT_SCHEMAS">LOKI_<wbr>INIT_<wbr>SCHEMAS</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.LokiJsonParser.html" title="struct servers::http::loki::LokiJsonParser">Loki<wbr>Json<wbr>Parser</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="struct" href="struct.LokiMiddleItem.html" title="struct servers::http::loki::LokiMiddleItem">Loki<wbr>Middle<wbr>Item</a></dt><dd>This is the holder of the loki lines parsed from json or protobuf.
The generic here is either [VrlValue] or <a href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec<LabelPairAdapter></a>.
Depending on the target destination, this can be converted to <a href="struct.LokiRawItem.html" title="struct servers::http::loki::LokiRawItem">LokiRawItem</a> or <a href="struct.LokiPipeline.html" title="struct servers::http::loki::LokiPipeline">LokiPipeline</a>.</dd><dt><a class="struct" href="struct.LokiPbParser.html" title="struct servers::http::loki::LokiPbParser">Loki<wbr>PbParser</a></dt><dt><a class="struct" href="struct.LokiPipeline.html" title="struct servers::http::loki::LokiPipeline">Loki<wbr>Pipeline</a></dt><dd>This is the line item prepared for the pipeline engine.</dd><dt><a class="struct" href="struct.LokiRawItem.html" title="struct servers::http::loki::LokiRawItem">Loki<wbr>RawItem</a></dt><dd>This is the line item for the Loki raw ingestion.
Well persist the line in its whole, set labels into tags,
and structured metadata into a big JSON.</dd><dt><a class="struct" href="struct.PbStreamItem.html" title="struct servers::http::loki::PbStreamItem">PbStream<wbr>Item</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.LABEL_KEY.html" title="constant servers::http::loki::LABEL_KEY">LABEL_<wbr>KEY</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LINES_KEY.html" title="constant servers::http::loki::LINES_KEY">LINES_<wbr>KEY</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_LINE_COLUMN.html" title="constant servers::http::loki::LOKI_LINE_COLUMN">LOKI_<wbr>LINE_<wbr>COLUMN</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_LINE_COLUMN_NAME.html" title="constant servers::http::loki::LOKI_LINE_COLUMN_NAME">LOKI_<wbr>LINE_<wbr>COLUMN_<wbr>NAME</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_PIPELINE_LABEL_PREFIX.html" title="constant servers::http::loki::LOKI_PIPELINE_LABEL_PREFIX">LOKI_<wbr>PIPELINE_<wbr>LABEL_<wbr>PREFIX</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_PIPELINE_METADATA_PREFIX.html" title="constant servers::http::loki::LOKI_PIPELINE_METADATA_PREFIX">LOKI_<wbr>PIPELINE_<wbr>METADATA_<wbr>PREFIX</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_STRUCTURED_METADATA_COLUMN.html" title="constant servers::http::loki::LOKI_STRUCTURED_METADATA_COLUMN">LOKI_<wbr>STRUCTURED_<wbr>METADATA_<wbr>COLUMN</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.LOKI_TABLE_NAME.html" title="constant servers::http::loki::LOKI_TABLE_NAME">LOKI_<wbr>TABLE_<wbr>NAME</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="constant" href="constant.STREAMS_KEY.html" title="constant servers::http::loki::STREAMS_KEY">STREAMS_<wbr>KEY</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.extract_item.html" title="fn servers::http::loki::extract_item">extract_<wbr>item</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dd>This is the flow of the Loki ingestion.
++
| bytes |
++
|
+++
| | |
| JSON content type | PB content type |
+++
| | |
| JsonStreamItem | PbStreamItem |
| stream: serde_json | stream: adapter |
+++
| | |
| MiddleItem&lt;serde_json&gt; | MiddleItem<entry> |
+++
\ /
\ /
\ /
++
| MiddleItem<T> |
++
|
+++
| |
+——————+ +———————+
| LokiRawItem | | LokiPipelineItem |
+——————+ +———————+
| |
+——————+ +———————+
| Loki ingest | | run_pipeline |
+——————+ +———————+</dd><dt><a class="fn" href="fn.init_row.html" title="fn servers::http::loki::init_row">init_<wbr>row</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.loki_ingest.html" title="fn servers::http::loki::loki_ingest">loki_<wbr>ingest</a></dt><dt><a class="fn" href="fn.parse_loki_labels.html" title="fn servers::http::loki::parse_loki_labels">parse_<wbr>loki_<wbr>labels</a></dt><dd>since were hand-parsing the labels, if any error is encountered, well just skip the label
note: pub here for bench usage
ref:</dd><dt><a class="fn" href="fn.process_labels.html" title="fn servers::http::loki::process_labels">process_<wbr>labels</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt><dt><a class="fn" href="fn.prost_ts_to_nano.html" title="fn servers::http::loki::prost_ts_to_nano">prost_<wbr>ts_<wbr>to_<wbr>nano</a><span title="Restricted Visibility">&nbsp;🔒</span> </dt></dl></section></div></main></body></html>