From 0f1a22c0c62b6a86a0d3700c040a572b714d7b59 Mon Sep 17 00:00:00 2001 From: Martijn Berger Date: Mon, 17 Mar 2025 11:37:10 +0100 Subject: [PATCH 1/2] Update dependencies and enhance proto definitions in loki-api - Bump versions for `snap`, `serde`, `serde_json`, `tokio`, `tracing`, and `tracing-subscriber`. - Upgrade `prost` and `prost-types` to version 0.13.0 in `loki-api`. - Introduce new proto files for `push` and `resultscache`, enhancing the API with additional services and messages. - Get proto definitions from upstream - Update generated Rust files to reflect changes in proto definitions. --- Cargo.lock | 707 +++++++++++++----- Cargo.toml | 20 +- loki-api/README.md | 23 + loki-api/generate/Cargo.toml | 2 +- loki-api/generate/proto/logproto.proto | 496 ++++++++++-- .../proto/pkg/logqlmodel/stats/stats.proto | 154 +++- loki-api/generate/proto/pkg/push/push.proto | 56 ++ .../chunk/cache/resultscache/types.proto | 34 + loki-api/generate/src/main.rs | 1 + loki-api/src/lib.rs | 4 + loki-api/src/logproto.rs | 597 ++++++++++++--- loki-api/src/resultscache.rs | 26 + loki-api/src/stats.rs | 170 ++++- src/lib.rs | 2 + src/log_support.rs | 2 +- 15 files changed, 1880 insertions(+), 414 deletions(-) create mode 100644 loki-api/README.md create mode 100644 loki-api/generate/proto/pkg/push/push.proto create mode 100644 loki-api/generate/proto/pkg/storage/chunk/cache/resultscache/types.proto create mode 100644 loki-api/src/resultscache.rs diff --git a/Cargo.lock b/Cargo.lock index bab159e..3e3d9f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,23 +1,29 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] -name = "aho-corasick" -version = "0.7.18" +name = "addr2line" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "memchr", + "gimli", ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ - "winapi", + "memchr", ] [[package]] @@ -32,6 +38,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + [[package]] name = "base64" version = "0.13.0" @@ -52,9 +73,9 @@ checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "bytes" -version = "1.1.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" @@ -84,6 +105,17 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "either" version = "1.6.1" @@ -137,11 +169,10 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "matches", "percent-encoding", ] @@ -184,6 +215,12 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "h2" version = "0.3.12" @@ -211,21 +248,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" @@ -278,7 +303,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -311,15 +336,143 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "idna" -version = "0.2.3" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -379,18 +532,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.120" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "log" -version = "0.4.14" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "loki-api" @@ -407,17 +563,11 @@ dependencies = [ "prost-build", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" -version = "2.4.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -426,26 +576,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] -name = "mio" -version = "0.8.2" +name = "miniz_oxide" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "wasi", - "winapi", + "adler2", ] [[package]] -name = "miow" -version = "0.3.7" +name = "mio" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "winapi", + "libc", + "wasi", + "windows-sys", ] [[package]] @@ -473,29 +620,29 @@ dependencies = [ ] [[package]] -name = "ntapi" -version = "0.3.7" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ + "overload", "winapi", ] [[package]] -name = "num_cpus" -version = "1.13.1" +name = "object" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ - "hermit-abi", - "libc", + "memchr", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "openssl" @@ -530,11 +677,17 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" @@ -548,9 +701,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -564,20 +717,30 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +[[package]] +name = "prettyplease" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +dependencies = [ + "proc-macro2", + "syn 2.0.100", +] + [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "prost" -version = "0.9.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", "prost-derive", @@ -585,52 +748,51 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.9.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", + "prettyplease", "prost", "prost-types", "regex", + "syn 2.0.100", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.9.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 2.0.100", ] [[package]] name = "prost-types" -version = "0.9.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "bytes", "prost", ] [[package]] name = "quote" -version = "1.0.16" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -646,9 +808,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -657,9 +831,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "remove_dir_all" @@ -726,6 +900,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustls" version = "0.20.6" @@ -798,31 +978,32 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.100", ] [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -856,15 +1037,15 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.8.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "snap" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" @@ -876,12 +1057,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "syn" version = "1.0.89" @@ -893,6 +1090,28 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "tempfile" version = "3.3.0" @@ -917,46 +1136,40 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.5.1" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - [[package]] name = "tokio" -version = "1.17.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ + "backtrace", "bytes", "libc", - "memchr", "mio", - "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.8", "tokio-macros", - "winapi", + "windows-sys", ] [[package]] name = "tokio-macros" -version = "1.7.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.100", ] [[package]] @@ -982,9 +1195,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -1013,11 +1226,10 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.32" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1025,33 +1237,33 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.20" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.100", ] [[package]] name = "tracing-core" -version = "0.1.23" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa31669fa42c09c34d94d8165dd2012e8ff3c66aca50f3bb226b68f216f2706c" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ - "lazy_static", + "once_cell", "valuable", ] [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -1086,11 +1298,11 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.9" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ - "ansi_term", + "nu-ansi-term", "sharded-slab", "smallvec", "thread_local", @@ -1105,25 +1317,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "unicode-bidi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" - -[[package]] -name = "unicode-normalization" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.9.0" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-xid" @@ -1139,16 +1336,27 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "valuable" version = "0.1.0" @@ -1198,7 +1406,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.89", "wasm-bindgen-shared", ] @@ -1232,7 +1440,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1272,17 +1480,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "which" -version = "4.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2" -dependencies = [ - "either", - "lazy_static", - "libc", -] - [[package]] name = "winapi" version = "0.3.9" @@ -1305,6 +1502,79 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winreg" version = "0.10.1" @@ -1313,3 +1583,82 @@ checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] diff --git a/Cargo.toml b/Cargo.toml index 6fa050f..2b4ec42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,20 +17,20 @@ edition = "2021" [dependencies] loki-api = { version = "0.1.0", path = "loki-api" } reqwest = { version = ">=0.11.10,<0.13.0", default-features = false } -snap = "1.0.5" -serde = { version = "1.0.136", features = ["derive"] } -serde_json = "1.0.79" -tokio = { version = "1.17.0", features = ["sync"] } -tokio-stream = "0.1.8" -tracing = "0.1.32" -tracing-core = "0.1.23" +snap = "1.1.1" +serde = { version = "1.0.219", features = ["derive"] } +serde_json = "1.0.140" +tokio = { version = "1.44.1", features = ["sync"] } +tokio-stream = "0.1.17" +tracing = "0.1.41" +tracing-core = "0.1.33" tracing-log = ">=0.1.2,<0.3.0" tracing-serde = ">=0.1.3,<0.3.0" -tracing-subscriber = "0.3.9" -url = "2.2.2" +tracing-subscriber = "0.3.19" +url = "2.5.4" [dev-dependencies] -tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.44.1", features = ["macros", "rt-multi-thread"] } [features] default = ["compat-0-2-1", "native-tls"] diff --git a/loki-api/README.md b/loki-api/README.md new file mode 100644 index 0000000..d7011e6 --- /dev/null +++ b/loki-api/README.md @@ -0,0 +1,23 @@ +# loki-api + +A Rust wrapper around Grafana Loki's Protocol Buffer definitions. + +## Overview + +This crate provides Rust bindings for the Protocol Buffer definitions used in [Grafana Loki](https://github.com/grafana/loki). It uses [prost](https://github.com/tokio-rs/prost) to generate Rust code from the Protocol Buffer definitions. + +## Structure + +- `generate/` - Contains the original Protocol Buffer definitions from Grafana Loki +- `src/` - Contains the Rust code, including: + - Generated Rust bindings for the Protocol Buffer definitions + - Re-exports of `prost` and `prost_types` for convenience + +## License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](../LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. \ No newline at end of file diff --git a/loki-api/generate/Cargo.toml b/loki-api/generate/Cargo.toml index 7cb4207..556045f 100644 --- a/loki-api/generate/Cargo.toml +++ b/loki-api/generate/Cargo.toml @@ -9,4 +9,4 @@ license = "MIT/Apache-2.0" edition = "2021" [build-dependencies] -prost-build = "0.9" +prost-build = "0.13" diff --git a/loki-api/generate/proto/logproto.proto b/loki-api/generate/proto/logproto.proto index 7270601..b015658 100644 --- a/loki-api/generate/proto/logproto.proto +++ b/loki-api/generate/proto/logproto.proto @@ -2,54 +2,158 @@ syntax = "proto3"; package logproto; -option go_package = "github.com/grafana/loki/pkg/logproto"; - -import "google/protobuf/timestamp.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; import "pkg/logqlmodel/stats/stats.proto"; +import "pkg/push/push.proto"; +import "pkg/storage/chunk/cache/resultscache/types.proto"; -service Pusher { - rpc Push(PushRequest) returns (PushResponse) {}; -} +option go_package = "github.com/grafana/loki/v3/pkg/logproto"; service Querier { - rpc Query(QueryRequest) returns (stream QueryResponse) {}; - rpc QuerySample(SampleQueryRequest) returns (stream SampleQueryResponse) {}; - rpc Label(LabelRequest) returns (LabelResponse) {}; - rpc Tail(TailRequest) returns (stream TailResponse) {}; - rpc Series(SeriesRequest) returns (SeriesResponse) {}; - rpc TailersCount(TailersCountRequest) returns (TailersCountResponse) {}; - rpc GetChunkIDs(GetChunkIDsRequest) returns (GetChunkIDsResponse) {}; // GetChunkIDs returns ChunkIDs from the index store holding logs for given selectors and time-range. + rpc Query(QueryRequest) returns (stream QueryResponse) {} + + rpc QuerySample(SampleQueryRequest) returns (stream SampleQueryResponse) {} + + rpc Label(LabelRequest) returns (LabelResponse) {} + + rpc Tail(TailRequest) returns (stream TailResponse) {} + + rpc Series(SeriesRequest) returns (SeriesResponse) {} + + rpc TailersCount(TailersCountRequest) returns (TailersCountResponse) {} + + rpc GetChunkIDs(GetChunkIDsRequest) returns (GetChunkIDsResponse) {} + + // Note: this MUST be the same as the variant defined in + // indexgateway.proto on the IndexGateway service. + rpc GetStats(IndexStatsRequest) returns (IndexStatsResponse) {} + // Note: this MUST be the same as the variant defined in + // indexgateway.proto on the IndexGateway service. + rpc GetVolume(VolumeRequest) returns (VolumeResponse) {} + + rpc GetDetectedFields(DetectedFieldsRequest) returns (DetectedFieldsResponse) {} + + rpc GetDetectedLabels(DetectedLabelsRequest) returns (LabelToValuesResponse) {} +} + +message LabelToValuesResponse { + map labels = 1; +} + +message UniqueLabelValues { + repeated string values = 1; +} + +service StreamData { + rpc GetStreamRates(StreamRatesRequest) returns (StreamRatesResponse) {} +} + +message StreamRatesRequest {} + +message StreamRatesResponse { + repeated StreamRate streamRates = 1; +} + +message StreamMetadata { + uint64 streamHash = 1; + uint64 entriesSize = 2; + uint64 structuredMetadataSize = 3; +} + +service IngestLimitsFrontend { + rpc ExceedsLimits(ExceedsLimitsRequest) returns (ExceedsLimitsResponse) {} +} + +message ExceedsLimitsRequest { + string tenant = 1; + repeated StreamMetadata streams = 2; +} + +message ExceedsLimitsResponse { + string tenant = 1; + repeated RejectedStream rejectedStreams = 2; } -service Ingester { - rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {}; +message RejectedStream { + uint64 streamHash = 1; + string reason = 2; } -message PushRequest { - repeated StreamAdapter streams = 1 [(gogoproto.jsontag) = "streams", (gogoproto.customtype) = "Stream"]; +service IngestLimits { + rpc GetStreamUsage(GetStreamUsageRequest) returns (GetStreamUsageResponse) {} + rpc GetAssignedPartitions(GetAssignedPartitionsRequest) returns (GetAssignedPartitionsResponse) {} } -message PushResponse { +message GetStreamUsageRequest { + string tenant = 1; + repeated int32 partitions = 2; + repeated uint64 streamHashes = 3; +} + +message GetStreamUsageResponse { + string tenant = 1; + uint64 activeStreams = 2; + int64 rate = 3; + repeated uint64 unknownStreams = 4; +} + +message StreamRate { + uint64 streamHash = 1; + uint64 streamHashNoShard = 2; + int64 rate = 3; // rate in plain bytes. + string tenant = 4; + uint32 pushes = 5; +} + +message GetAssignedPartitionsRequest {} + +message GetAssignedPartitionsResponse { + map assignedPartitions = 1; } message QueryRequest { - string selector = 1; + string selector = 1 [deprecated = true]; uint32 limit = 2; - google.protobuf.Timestamp start = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp end = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; Direction direction = 5; reserved 6; repeated string shards = 7 [(gogoproto.jsontag) = "shards,omitempty"]; repeated Delete deletes = 8; + Plan plan = 9 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; + // If populated, these represent the chunk references that the querier should + // use to fetch the data, plus any other chunks reported by ingesters. + ChunkRefGroup storeChunks = 10 [(gogoproto.jsontag) = "storeChunks"]; } message SampleQueryRequest { - string selector = 1; - google.protobuf.Timestamp start = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp end = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + string selector = 1 [deprecated = true]; // mark as reserved once we've fully migrated to plan. + google.protobuf.Timestamp start = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; repeated string shards = 4 [(gogoproto.jsontag) = "shards,omitempty"]; repeated Delete deletes = 5; + Plan plan = 6 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; + // If populated, these represent the chunk references that the querier should + // use to fetch the data, plus any other chunks reported by ingesters. + ChunkRefGroup storeChunks = 10 [(gogoproto.jsontag) = "storeChunks"]; +} + +// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed. +message Plan { + bytes raw = 1; } message Delete { @@ -59,46 +163,46 @@ message Delete { } message QueryResponse { - repeated StreamAdapter streams = 1 [(gogoproto.customtype) = "Stream", (gogoproto.nullable) = true]; + repeated StreamAdapter streams = 1 [ + (gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream", + (gogoproto.nullable) = true + ]; stats.Ingester stats = 2 [(gogoproto.nullable) = false]; + repeated string warnings = 3; } message SampleQueryResponse { - repeated Series series = 1 [(gogoproto.customtype) = "Series", (gogoproto.nullable) = true]; + repeated Series series = 1 [ + (gogoproto.customtype) = "Series", + (gogoproto.nullable) = true + ]; stats.Ingester stats = 2 [(gogoproto.nullable) = false]; + repeated string warnings = 3; } - enum Direction { FORWARD = 0; BACKWARD = 1; } - - message LabelRequest { string name = 1; bool values = 2; // True to fetch label values, false for fetch labels names. - google.protobuf.Timestamp start = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; - google.protobuf.Timestamp end = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; + google.protobuf.Timestamp start = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; + google.protobuf.Timestamp end = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; + string query = 5; // Naming this query instead of match because this should be with queryrangebase.Request interface } message LabelResponse { repeated string values = 1; } -message StreamAdapter { - string labels = 1 [(gogoproto.jsontag) = "labels"]; - repeated EntryAdapter entries = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "entries"]; - // hash contains the original hash of the stream. - uint64 hash = 3 [(gogoproto.jsontag) = "-"]; -} - -message EntryAdapter { - google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.jsontag) = "ts"]; - string line = 2 [(gogoproto.jsontag) = "line"]; -} - message Sample { int64 timestamp = 1 [(gogoproto.jsontag) = "ts"]; double value = 2 [(gogoproto.jsontag) = "value"]; @@ -107,32 +211,45 @@ message Sample { // LegacySample exists for backwards compatibility reasons and is deprecated. Do not use. message LegacySample { - double value = 1; + double value = 1; int64 timestamp_ms = 2; } message Series { string labels = 1 [(gogoproto.jsontag) = "labels"]; - repeated Sample samples = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "samples"]; + repeated Sample samples = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "samples" + ]; uint64 streamHash = 3 [(gogoproto.jsontag) = "streamHash"]; } message TailRequest { - string query = 1; + string query = 1 [deprecated = true]; reserved 2; uint32 delayFor = 3; uint32 limit = 4; - google.protobuf.Timestamp start = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + Plan plan = 6 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; } message TailResponse { - StreamAdapter stream = 1 [(gogoproto.customtype) = "Stream"]; + StreamAdapter stream = 1 [(gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream"]; repeated DroppedStream droppedStreams = 2; } message SeriesRequest { - google.protobuf.Timestamp start = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp end = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; repeated string groups = 3; repeated string shards = 4 [(gogoproto.jsontag) = "shards,omitempty"]; } @@ -142,28 +259,32 @@ message SeriesResponse { } message SeriesIdentifier { - map labels = 1; + message LabelsEntry { + string key = 1; + string value = 2; + } + repeated LabelsEntry labels = 1 [(gogoproto.nullable) = false]; } message DroppedStream { - google.protobuf.Timestamp from = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp to = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp from = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp to = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; string labels = 3; } -message TimeSeriesChunk { - string from_ingester_id = 1; - string user_id = 2; - repeated LabelPair labels = 3; - repeated Chunk chunks = 4; -} - message LabelPair { string name = 1; string value = 2; } // LegacyLabelPair exists for backwards compatibility reasons and is deprecated. Do not use. +// Use LabelPair instead. message LegacyLabelPair { bytes name = 1; bytes value = 2; @@ -173,13 +294,7 @@ message Chunk { bytes data = 1; } -message TransferChunksResponse { - -} - -message TailersCountRequest { - -} +message TailersCountRequest {} message TailersCountResponse { uint32 count = 1; @@ -187,10 +302,253 @@ message TailersCountResponse { message GetChunkIDsRequest { string matchers = 1; - google.protobuf.Timestamp start = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp end = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp start = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; } message GetChunkIDsResponse { repeated string chunkIDs = 1; } + +// ChunkRef contains the metadata to reference a Chunk. +// It is embedded by the Chunk type itself and used to generate the Chunk +// checksum. So it is imported to take care of the JSON representation of the +// resulting Go struct. +message ChunkRef { + uint64 fingerprint = 1 [(gogoproto.jsontag) = "fingerprint"]; + string user_id = 2 [ + (gogoproto.customname) = "UserID", + (gogoproto.jsontag) = "userID" + ]; + int64 from = 3 [ + (gogoproto.jsontag) = "from", + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 4 [ + (gogoproto.jsontag) = "through", + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + + // The checksum is not written to the external storage. We use crc32, + // Castagnoli table. See http://www.evanjones.ca/crc32c.html. + uint32 checksum = 5 [(gogoproto.jsontag) = "-"]; +} + +message ChunkRefGroup { + repeated ChunkRef refs = 1 [(gogoproto.jsontag) = "refs"]; +} + +message LabelValuesForMetricNameRequest { + string metric_name = 1; + string label_name = 2; + int64 from = 3 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 4 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 5; +} + +message LabelNamesForMetricNameRequest { + string metric_name = 1; + int64 from = 2 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 3 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 4; +} + +// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed. +message LineFilter { + bytes raw = 1; +} + +message GetChunkRefRequest { + int64 from = 1 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 2 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 3; + // TODO(salvacorts): Delete this field once the weekly release is done. + repeated LineFilter filters = 4 [ + (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logql/syntax.LineFilter", + (gogoproto.nullable) = false + ]; + Plan plan = 5 [ + (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan", + (gogoproto.nullable) = false + ]; +} + +message GetChunkRefResponse { + repeated ChunkRef refs = 1; + stats.Index stats = 2 [(gogoproto.nullable) = false]; +} + +message GetSeriesRequest { + int64 from = 1 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 2 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 3; +} + +message GetSeriesResponse { + repeated IndexSeries series = 1 [(gogoproto.nullable) = false]; +} + +// Series calls to the TSDB Index +message IndexSeries { + repeated LabelPair labels = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "LabelAdapter" + ]; +} + +message QueryIndexResponse { + string QueryKey = 1; + repeated Row rows = 2; +} + +message Row { + bytes rangeValue = 1; + bytes value = 2; +} + +message QueryIndexRequest { + repeated IndexQuery Queries = 1; +} + +message IndexQuery { + string tableName = 1; + string hashValue = 2; + bytes rangeValuePrefix = 3; + bytes rangeValueStart = 4; + bytes valueEqual = 5; +} + +message IndexStatsRequest { + int64 from = 1 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 2 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 3; + // TODO(owen-d): add shards to grpc calls so we don't have + // to extract via labels +} + +message IndexStatsResponse { + uint64 streams = 1 [(gogoproto.jsontag) = "streams"]; + uint64 chunks = 2 [(gogoproto.jsontag) = "chunks"]; + uint64 bytes = 3 [(gogoproto.jsontag) = "bytes"]; + uint64 entries = 4 [(gogoproto.jsontag) = "entries"]; +} + +message VolumeRequest { + int64 from = 1 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + int64 through = 2 [ + (gogoproto.customtype) = "github.com/prometheus/common/model.Time", + (gogoproto.nullable) = false + ]; + string matchers = 3; + int32 limit = 4; + int64 step = 5; + repeated string targetLabels = 6; + string aggregateBy = 7; + resultscache.CachingOptions cachingOptions = 8 [(gogoproto.nullable) = false]; +} + +message VolumeResponse { + repeated Volume volumes = 1 [(gogoproto.nullable) = false]; + int32 limit = 2; +} + +message Volume { + string name = 1 [(gogoproto.jsontag) = "name"]; + uint64 volume = 3 [(gogoproto.jsontag) = "volume"]; +} + +message DetectedFieldsRequest { + google.protobuf.Timestamp start = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + string query = 3; // Naming this query instead of match because this should be with queryrangebase.Request interface + uint32 lineLimit = 4; + uint32 limit = 5; + int64 step = 6; + bool values = 7; // True to fetch detected field values, false for fetch detected field label names. + string name = 8; // Name of the detected field to fetch values for. +} + +message DetectedFieldsResponse { + repeated DetectedField fields = 1 [(gogoproto.jsontag) = "fields,omitempty"]; + uint32 limit = 2 [(gogoproto.jsontag) = "limit,omitempty"]; + repeated string values = 3 [(gogoproto.jsontag) = "values,omitempty"]; +} + +// TODO: make the detected field include the serialized sketch +// we only want cardinality in the JSON response +message DetectedField { + string label = 1; + string type = 2 [(gogoproto.casttype) = "DetectedFieldType"]; + uint64 cardinality = 3; + repeated string parsers = 4 [(gogoproto.jsontag) = "parsers"]; + bytes sketch = 5 [(gogoproto.jsontag) = "sketch,omitempty"]; +} + +message DetectedLabelsRequest { + google.protobuf.Timestamp start = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp end = 2 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + string query = 3; +} + +message DetectedLabelsResponse { + repeated DetectedLabel detectedLabels = 1; +} + +message DetectedLabel { + string label = 1; + uint64 cardinality = 2; + bytes sketch = 3 [(gogoproto.jsontag) = "sketch,omitempty"]; +} diff --git a/loki-api/generate/proto/pkg/logqlmodel/stats/stats.proto b/loki-api/generate/proto/pkg/logqlmodel/stats/stats.proto index fdf3f14..fd22549 100644 --- a/loki-api/generate/proto/pkg/logqlmodel/stats/stats.proto +++ b/loki-api/generate/proto/pkg/logqlmodel/stats/stats.proto @@ -4,25 +4,76 @@ package stats; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +option go_package = "github.com/grafana/loki/v3/pkg/logqlmodel/stats"; option (gogoproto.marshaler_all) = true; option (gogoproto.unmarshaler_all) = true; -option go_package = "github.com/grafana/loki/pkg/logqlmodel/stats"; - // Result contains LogQL query statistics. message Result { - Summary summary = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "summary"]; - Querier querier = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "querier"]; - Ingester ingester = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "ingester"]; + Summary summary = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "summary" + ]; + Querier querier = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "querier" + ]; + Ingester ingester = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "ingester" + ]; + Caches caches = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "cache" + ]; + Index index = 5 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "index" + ]; +} + +message Caches { + Cache chunk = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "chunk" + ]; + Cache index = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "index" + ]; + Cache result = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "result" + ]; + Cache statsResult = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "statsResult" + ]; + Cache volumeResult = 5 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "volumeResult" + ]; + Cache seriesResult = 6 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "seriesResult" + ]; + Cache labelResult = 7 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "labelResult" + ]; + Cache instantMetricResult = 8 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "instantMetricResult" + ]; } // Summary is the summary of a query statistics. message Summary { - // Total bytes processed per second. + // Total bytes processed per second. int64 bytesProcessedPerSecond = 1 [(gogoproto.jsontag) = "bytesProcessedPerSecond"]; // Total lines processed per second. int64 linesProcessedPerSecond = 2 [(gogoproto.jsontag) = "linesProcessedPerSecond"]; - // Total bytes processed. + // Total bytes processed. Includes structured metadata bytes. int64 totalBytesProcessed = 3 [(gogoproto.jsontag) = "totalBytesProcessed"]; // Total lines processed. int64 totalLinesProcessed = 4 [(gogoproto.jsontag) = "totalLinesProcessed"]; @@ -34,12 +85,40 @@ message Summary { // In addition to internal calculations this is also returned by the HTTP API. // Grafana expects time values to be returned in seconds as float. double queueTime = 6 [(gogoproto.jsontag) = "queueTime"]; - // Total of subqueries created to fulfill this query. + // Subqueries exists for backwards compatibility reasons and is deprecated. Do not use. + // Instead use splits and shards int64 subqueries = 7 [(gogoproto.jsontag) = "subqueries"]; + // Total number of result entries returned + int64 totalEntriesReturned = 8 [(gogoproto.jsontag) = "totalEntriesReturned"]; + // Total number of splits by time + int64 splits = 9 [(gogoproto.jsontag) = "splits"]; + // Total number of shards + int64 shards = 10 [(gogoproto.jsontag) = "shards"]; + // Total lines post query filtering + int64 totalPostFilterLines = 11 [(gogoproto.jsontag) = "totalPostFilterLines"]; + // Total bytes processed of metadata. + int64 totalStructuredMetadataBytesProcessed = 12 [(gogoproto.jsontag) = "totalStructuredMetadataBytesProcessed"]; +} + +// Statistics from Index queries +// TODO(owen-d): include bytes. +// Needs some index methods added to return _sized_ chunk refs to know +message Index { + // Total chunks + int64 totalChunks = 1 [(gogoproto.jsontag) = "totalChunks"]; + // Post-filtered chunks + int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"]; + // Nanosecond duration spent fetching shards + int64 shardsDuration = 3 [(gogoproto.jsontag) = "shardsDuration"]; + // Indicates whether the query used blooms to filter chunks + bool usedBloomFilters = 4 [(gogoproto.jsontag) = "usedBloomFilters"]; } message Querier { - Store store = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "store"]; + Store store = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "store" + ]; } message Ingester { @@ -52,27 +131,43 @@ message Ingester { // Total lines sent by ingesters. int64 totalLinesSent = 4 [(gogoproto.jsontag) = "totalLinesSent"]; - Store store = 5 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "store"]; - + Store store = 5 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "store" + ]; } message Store { - // The total of chunk reference fetched from index. - int64 totalChunksRef = 1 [(gogoproto.jsontag) = "totalChunksRef"]; - // Total number of chunks fetched. - int64 totalChunksDownloaded = 2 [(gogoproto.jsontag) = "totalChunksDownloaded"]; - // Time spent fetching chunks in nanoseconds. - int64 chunksDownloadTime = 3 [(gogoproto.jsontag) = "chunksDownloadTime"]; - - Chunk chunk = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "chunk"]; + // The total of chunk reference fetched from index. + int64 totalChunksRef = 1 [(gogoproto.jsontag) = "totalChunksRef"]; + // Total number of chunks fetched. + int64 totalChunksDownloaded = 2 [(gogoproto.jsontag) = "totalChunksDownloaded"]; + // Time spent fetching chunks in nanoseconds. + int64 chunksDownloadTime = 3 [(gogoproto.jsontag) = "chunksDownloadTime"]; + // Whether the query referenced structured metadata + bool queryReferencedStructured = 13 [(gogoproto.jsontag) = "queryReferencedStructuredMetadata"]; + + Chunk chunk = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "chunk" + ]; + + // Time spent fetching chunk refs from index. + int64 chunkRefsFetchTime = 5 [(gogoproto.jsontag) = "chunkRefsFetchTime"]; + + // Time spent being blocked on congestion control. + int64 congestionControlLatency = 6 [(gogoproto.jsontag) = "congestionControlLatency"]; + + // Total number of lines filtered by pipeline wrapper. + int64 pipelineWrapperFilteredLines = 7 [(gogoproto.jsontag) = "pipelineWrapperFilteredLines"]; } message Chunk { - // Total bytes processed but was already in memory. (found in the headchunk) + // Total bytes processed but was already in memory (found in the headchunk). Includes structured metadata bytes. int64 headChunkBytes = 4 [(gogoproto.jsontag) = "headChunkBytes"]; // Total lines processed but was already in memory. (found in the headchunk) int64 headChunkLines = 5 [(gogoproto.jsontag) = "headChunkLines"]; - // Total bytes decompressed and processed from chunks. + // Total bytes decompressed and processed from chunks. Includes structured metadata bytes. int64 decompressedBytes = 6 [(gogoproto.jsontag) = "decompressedBytes"]; // Total lines decompressed and processed from chunks. int64 decompressedLines = 7 [(gogoproto.jsontag) = "decompressedLines"]; @@ -80,4 +175,21 @@ message Chunk { int64 compressedBytes = 8 [(gogoproto.jsontag) = "compressedBytes"]; // Total duplicates found while processing. int64 totalDuplicates = 9 [(gogoproto.jsontag) = "totalDuplicates"]; + // Total lines post filtering + int64 postFilterLines = 10 [(gogoproto.jsontag) = "postFilterLines"]; + // Total bytes processed for metadata but was already in memory. (found in the headchunk) + int64 headChunkStructuredMetadataBytes = 11 [(gogoproto.jsontag) = "headChunkStructuredMetadataBytes"]; + // Total bytes of entries metadata decompressed and processed from chunks. + int64 decompressedStructuredMetadataBytes = 12 [(gogoproto.jsontag) = "decompressedStructuredMetadataBytes"]; } + +message Cache { + int32 entriesFound = 1 [(gogoproto.jsontag) = "entriesFound"]; + int32 entriesRequested = 2 [(gogoproto.jsontag) = "entriesRequested"]; + int32 entriesStored = 3 [(gogoproto.jsontag) = "entriesStored"]; + int64 bytesReceived = 4 [(gogoproto.jsontag) = "bytesReceived"]; + int64 bytesSent = 5 [(gogoproto.jsontag) = "bytesSent"]; + int32 requests = 6 [(gogoproto.jsontag) = "requests"]; + int64 downloadTime = 7 [(gogoproto.jsontag) = "downloadTime"]; + int64 queryLengthServed = 8 [(gogoproto.jsontag) = "queryLengthServed"]; +} \ No newline at end of file diff --git a/loki-api/generate/proto/pkg/push/push.proto b/loki-api/generate/proto/pkg/push/push.proto new file mode 100644 index 0000000..4887fb0 --- /dev/null +++ b/loki-api/generate/proto/pkg/push/push.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package logproto; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/grafana/loki/pkg/push"; + +service Pusher { + rpc Push(PushRequest) returns (PushResponse) {} +} + +message PushRequest { + repeated StreamAdapter streams = 1 [ + (gogoproto.jsontag) = "streams", + (gogoproto.customtype) = "Stream" + ]; +} + +message PushResponse {} + +message StreamAdapter { + string labels = 1 [(gogoproto.jsontag) = "labels"]; + repeated EntryAdapter entries = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "entries" + ]; + // hash contains the original hash of the stream. + uint64 hash = 3 [(gogoproto.jsontag) = "-"]; +} + +message LabelPairAdapter { + string name = 1; + string value = 2; +} + +message EntryAdapter { + google.protobuf.Timestamp timestamp = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "ts" + ]; + string line = 2 [(gogoproto.jsontag) = "line"]; + repeated LabelPairAdapter structuredMetadata = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "structuredMetadata,omitempty" + ]; + // This field shouldn't be used by clients to push data to Loki. + // It is only used by Loki to return parsed log lines in query responses. + // TODO: Remove this field from the write path Proto. + repeated LabelPairAdapter parsed = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "parsed,omitempty" + ]; +} diff --git a/loki-api/generate/proto/pkg/storage/chunk/cache/resultscache/types.proto b/loki-api/generate/proto/pkg/storage/chunk/cache/resultscache/types.proto new file mode 100644 index 0000000..344f8bf --- /dev/null +++ b/loki-api/generate/proto/pkg/storage/chunk/cache/resultscache/types.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package resultscache; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/grafana/loki/v3/pkg/storage/chunk/cache/resultscache"; +option (gogoproto.marshaler_all) = true; +option (gogoproto.unmarshaler_all) = true; + +// Defined here to prevent circular imports between logproto & queryrangebase +message CachingOptions { + bool disabled = 1; +} + +message CachedResponse { + string key = 1 [(gogoproto.jsontag) = "key"]; + + // List of cached responses; non-overlapping and in order. + repeated Extent extents = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "extents" + ]; +} + +message Extent { + int64 start = 1 [(gogoproto.jsontag) = "start"]; + int64 end = 2 [(gogoproto.jsontag) = "end"]; + // reserved the previous key to ensure cache transition + reserved 3; + string trace_id = 4 [(gogoproto.jsontag) = "-"]; + google.protobuf.Any response = 5 [(gogoproto.jsontag) = "response"]; +} diff --git a/loki-api/generate/src/main.rs b/loki-api/generate/src/main.rs index 35c0e3a..8bd3aba 100644 --- a/loki-api/generate/src/main.rs +++ b/loki-api/generate/src/main.rs @@ -4,6 +4,7 @@ use std::path::PathBuf; fn main() -> io::Result<()> { let out_dir = PathBuf::from(env!("OUT_DIR")); fs::copy(out_dir.join("logproto.rs"), "../src/logproto.rs")?; + fs::copy(out_dir.join("resultscache.rs"), "../src/resultscache.rs")?; fs::copy(out_dir.join("stats.rs"), "../src/stats.rs")?; Ok(()) } diff --git a/loki-api/src/lib.rs b/loki-api/src/lib.rs index 347c6a5..35f54c2 100644 --- a/loki-api/src/lib.rs +++ b/loki-api/src/lib.rs @@ -3,5 +3,9 @@ pub extern crate prost_types; #[rustfmt::skip] pub mod logproto; + +#[rustfmt::skip] +pub mod resultscache; + #[rustfmt::skip] pub mod stats; diff --git a/loki-api/src/logproto.rs b/loki-api/src/logproto.rs index 8f6dca4..7e117ce 100644 --- a/loki-api/src/logproto.rs +++ b/loki-api/src/logproto.rs @@ -1,231 +1,634 @@ +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PushRequest { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub streams: ::prost::alloc::vec::Vec, } +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct PushResponse {} #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PushResponse { +pub struct StreamAdapter { + #[prost(string, tag = "1")] + pub labels: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub entries: ::prost::alloc::vec::Vec, + /// hash contains the original hash of the stream. + #[prost(uint64, tag = "3")] + pub hash: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LabelPairAdapter { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EntryAdapter { + #[prost(message, optional, tag = "1")] + pub timestamp: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "2")] + pub line: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub structured_metadata: ::prost::alloc::vec::Vec, + /// This field shouldn't be used by clients to push data to Loki. + /// It is only used by Loki to return parsed log lines in query responses. + /// TODO: Remove this field from the write path Proto. + #[prost(message, repeated, tag = "4")] + pub parsed: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LabelToValuesResponse { + #[prost(map = "string, message", tag = "1")] + pub labels: ::std::collections::HashMap< + ::prost::alloc::string::String, + UniqueLabelValues, + >, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UniqueLabelValues { + #[prost(string, repeated, tag = "1")] + pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct StreamRatesRequest {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamRatesResponse { + #[prost(message, repeated, tag = "1")] + pub stream_rates: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct StreamMetadata { + #[prost(uint64, tag = "1")] + pub stream_hash: u64, + #[prost(uint64, tag = "2")] + pub entries_size: u64, + #[prost(uint64, tag = "3")] + pub structured_metadata_size: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExceedsLimitsRequest { + #[prost(string, tag = "1")] + pub tenant: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub streams: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExceedsLimitsResponse { + #[prost(string, tag = "1")] + pub tenant: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub rejected_streams: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RejectedStream { + #[prost(uint64, tag = "1")] + pub stream_hash: u64, + #[prost(string, tag = "2")] + pub reason: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStreamUsageRequest { + #[prost(string, tag = "1")] + pub tenant: ::prost::alloc::string::String, + #[prost(int32, repeated, tag = "2")] + pub partitions: ::prost::alloc::vec::Vec, + #[prost(uint64, repeated, tag = "3")] + pub stream_hashes: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStreamUsageResponse { + #[prost(string, tag = "1")] + pub tenant: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub active_streams: u64, + #[prost(int64, tag = "3")] + pub rate: i64, + #[prost(uint64, repeated, tag = "4")] + pub unknown_streams: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamRate { + #[prost(uint64, tag = "1")] + pub stream_hash: u64, + #[prost(uint64, tag = "2")] + pub stream_hash_no_shard: u64, + /// rate in plain bytes. + #[prost(int64, tag = "3")] + pub rate: i64, + #[prost(string, tag = "4")] + pub tenant: ::prost::alloc::string::String, + #[prost(uint32, tag = "5")] + pub pushes: u32, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct GetAssignedPartitionsRequest {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAssignedPartitionsResponse { + #[prost(map = "int32, int64", tag = "1")] + pub assigned_partitions: ::std::collections::HashMap, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRequest { - #[prost(string, tag="1")] + #[deprecated] + #[prost(string, tag = "1")] pub selector: ::prost::alloc::string::String, - #[prost(uint32, tag="2")] + #[prost(uint32, tag = "2")] pub limit: u32, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub start: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="4")] + #[prost(message, optional, tag = "4")] pub end: ::core::option::Option<::prost_types::Timestamp>, - #[prost(enumeration="Direction", tag="5")] + #[prost(enumeration = "Direction", tag = "5")] pub direction: i32, - #[prost(string, repeated, tag="7")] + #[prost(string, repeated, tag = "7")] pub shards: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag="8")] + #[prost(message, repeated, tag = "8")] pub deletes: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "9")] + pub plan: ::core::option::Option, + /// If populated, these represent the chunk references that the querier should + /// use to fetch the data, plus any other chunks reported by ingesters. + #[prost(message, optional, tag = "10")] + pub store_chunks: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SampleQueryRequest { - #[prost(string, tag="1")] + /// mark as reserved once we've fully migrated to plan. + #[deprecated] + #[prost(string, tag = "1")] pub selector: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub start: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub end: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, repeated, tag="4")] + #[prost(string, repeated, tag = "4")] pub shards: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag="5")] + #[prost(message, repeated, tag = "5")] pub deletes: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub plan: ::core::option::Option, + /// If populated, these represent the chunk references that the querier should + /// use to fetch the data, plus any other chunks reported by ingesters. + #[prost(message, optional, tag = "10")] + pub store_chunks: ::core::option::Option, +} +/// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Plan { + #[prost(bytes = "vec", tag = "1")] + pub raw: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delete { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub selector: ::prost::alloc::string::String, - #[prost(int64, tag="2")] + #[prost(int64, tag = "2")] pub start: i64, - #[prost(int64, tag="3")] + #[prost(int64, tag = "3")] pub end: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryResponse { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub streams: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub stats: ::core::option::Option, + #[prost(string, repeated, tag = "3")] + pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SampleQueryResponse { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub series: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub stats: ::core::option::Option, + #[prost(string, repeated, tag = "3")] + pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct LabelRequest { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// True to fetch label values, false for fetch labels names. - #[prost(bool, tag="2")] + #[prost(bool, tag = "2")] pub values: bool, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub start: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="4")] + #[prost(message, optional, tag = "4")] pub end: ::core::option::Option<::prost_types::Timestamp>, + /// Naming this query instead of match because this should be with queryrangebase.Request interface + #[prost(string, tag = "5")] + pub query: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct LabelResponse { - #[prost(string, repeated, tag="1")] + #[prost(string, repeated, tag = "1")] pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StreamAdapter { - #[prost(string, tag="1")] - pub labels: ::prost::alloc::string::String, - #[prost(message, repeated, tag="2")] - pub entries: ::prost::alloc::vec::Vec, - /// hash contains the original hash of the stream. - #[prost(uint64, tag="3")] - pub hash: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EntryAdapter { - #[prost(message, optional, tag="1")] - pub timestamp: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag="2")] - pub line: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Sample { - #[prost(int64, tag="1")] + #[prost(int64, tag = "1")] pub timestamp: i64, - #[prost(double, tag="2")] + #[prost(double, tag = "2")] pub value: f64, - #[prost(uint64, tag="3")] + #[prost(uint64, tag = "3")] pub hash: u64, } /// LegacySample exists for backwards compatibility reasons and is deprecated. Do not use. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LegacySample { - #[prost(double, tag="1")] + #[prost(double, tag = "1")] pub value: f64, - #[prost(int64, tag="2")] + #[prost(int64, tag = "2")] pub timestamp_ms: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Series { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub labels: ::prost::alloc::string::String, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub samples: ::prost::alloc::vec::Vec, - #[prost(uint64, tag="3")] + #[prost(uint64, tag = "3")] pub stream_hash: u64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct TailRequest { - #[prost(string, tag="1")] + #[deprecated] + #[prost(string, tag = "1")] pub query: ::prost::alloc::string::String, - #[prost(uint32, tag="3")] + #[prost(uint32, tag = "3")] pub delay_for: u32, - #[prost(uint32, tag="4")] + #[prost(uint32, tag = "4")] pub limit: u32, - #[prost(message, optional, tag="5")] + #[prost(message, optional, tag = "5")] pub start: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag = "6")] + pub plan: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct TailResponse { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub stream: ::core::option::Option, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub dropped_streams: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SeriesRequest { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub start: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub end: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, repeated, tag="3")] + #[prost(string, repeated, tag = "3")] pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag="4")] + #[prost(string, repeated, tag = "4")] pub shards: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SeriesResponse { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub series: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SeriesIdentifier { - #[prost(map="string, string", tag="1")] - pub labels: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + #[prost(message, repeated, tag = "1")] + pub labels: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `SeriesIdentifier`. +pub mod series_identifier { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct LabelsEntry { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + } } #[derive(Clone, PartialEq, ::prost::Message)] pub struct DroppedStream { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub from: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub to: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag="3")] + #[prost(string, tag = "3")] pub labels: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimeSeriesChunk { - #[prost(string, tag="1")] - pub from_ingester_id: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub user_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag="3")] - pub labels: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] - pub chunks: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] pub struct LabelPair { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - #[prost(string, tag="2")] + #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } /// LegacyLabelPair exists for backwards compatibility reasons and is deprecated. Do not use. +/// Use LabelPair instead. #[derive(Clone, PartialEq, ::prost::Message)] pub struct LegacyLabelPair { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Chunk { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, } -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransferChunksResponse { -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TailersCountRequest { -} -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct TailersCountRequest {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TailersCountResponse { - #[prost(uint32, tag="1")] + #[prost(uint32, tag = "1")] pub count: u32, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChunkIDsRequest { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub matchers: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub start: ::core::option::Option<::prost_types::Timestamp>, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub end: ::core::option::Option<::prost_types::Timestamp>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChunkIDsResponse { - #[prost(string, repeated, tag="1")] + #[prost(string, repeated, tag = "1")] pub chunk_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// ChunkRef contains the metadata to reference a Chunk. +/// It is embedded by the Chunk type itself and used to generate the Chunk +/// checksum. So it is imported to take care of the JSON representation of the +/// resulting Go struct. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChunkRef { + #[prost(uint64, tag = "1")] + pub fingerprint: u64, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub from: i64, + #[prost(int64, tag = "4")] + pub through: i64, + /// The checksum is not written to the external storage. We use crc32, + /// Castagnoli table. See + #[prost(uint32, tag = "5")] + pub checksum: u32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChunkRefGroup { + #[prost(message, repeated, tag = "1")] + pub refs: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LabelValuesForMetricNameRequest { + #[prost(string, tag = "1")] + pub metric_name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub label_name: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub from: i64, + #[prost(int64, tag = "4")] + pub through: i64, + #[prost(string, tag = "5")] + pub matchers: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LabelNamesForMetricNameRequest { + #[prost(string, tag = "1")] + pub metric_name: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub from: i64, + #[prost(int64, tag = "3")] + pub through: i64, + #[prost(string, tag = "4")] + pub matchers: ::prost::alloc::string::String, +} +/// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LineFilter { + #[prost(bytes = "vec", tag = "1")] + pub raw: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetChunkRefRequest { + #[prost(int64, tag = "1")] + pub from: i64, + #[prost(int64, tag = "2")] + pub through: i64, + #[prost(string, tag = "3")] + pub matchers: ::prost::alloc::string::String, + /// TODO(salvacorts): Delete this field once the weekly release is done. + #[prost(message, repeated, tag = "4")] + pub filters: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub plan: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetChunkRefResponse { + #[prost(message, repeated, tag = "1")] + pub refs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub stats: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSeriesRequest { + #[prost(int64, tag = "1")] + pub from: i64, + #[prost(int64, tag = "2")] + pub through: i64, + #[prost(string, tag = "3")] + pub matchers: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSeriesResponse { + #[prost(message, repeated, tag = "1")] + pub series: ::prost::alloc::vec::Vec, +} +/// Series calls to the TSDB Index +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IndexSeries { + #[prost(message, repeated, tag = "1")] + pub labels: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryIndexResponse { + #[prost(string, tag = "1")] + pub query_key: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub rows: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Row { + #[prost(bytes = "vec", tag = "1")] + pub range_value: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub value: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryIndexRequest { + #[prost(message, repeated, tag = "1")] + pub queries: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IndexQuery { + #[prost(string, tag = "1")] + pub table_name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub hash_value: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + pub range_value_prefix: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + pub range_value_start: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub value_equal: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IndexStatsRequest { + #[prost(int64, tag = "1")] + pub from: i64, + #[prost(int64, tag = "2")] + pub through: i64, + /// TODO(owen-d): add shards to grpc calls so we don't have + /// to extract via labels + #[prost(string, tag = "3")] + pub matchers: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct IndexStatsResponse { + #[prost(uint64, tag = "1")] + pub streams: u64, + #[prost(uint64, tag = "2")] + pub chunks: u64, + #[prost(uint64, tag = "3")] + pub bytes: u64, + #[prost(uint64, tag = "4")] + pub entries: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VolumeRequest { + #[prost(int64, tag = "1")] + pub from: i64, + #[prost(int64, tag = "2")] + pub through: i64, + #[prost(string, tag = "3")] + pub matchers: ::prost::alloc::string::String, + #[prost(int32, tag = "4")] + pub limit: i32, + #[prost(int64, tag = "5")] + pub step: i64, + #[prost(string, repeated, tag = "6")] + pub target_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "7")] + pub aggregate_by: ::prost::alloc::string::String, + #[prost(message, optional, tag = "8")] + pub caching_options: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VolumeResponse { + #[prost(message, repeated, tag = "1")] + pub volumes: ::prost::alloc::vec::Vec, + #[prost(int32, tag = "2")] + pub limit: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Volume { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub volume: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedFieldsRequest { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option<::prost_types::Timestamp>, + /// Naming this query instead of match because this should be with queryrangebase.Request interface + #[prost(string, tag = "3")] + pub query: ::prost::alloc::string::String, + #[prost(uint32, tag = "4")] + pub line_limit: u32, + #[prost(uint32, tag = "5")] + pub limit: u32, + #[prost(int64, tag = "6")] + pub step: i64, + /// True to fetch detected field values, false for fetch detected field label names. + #[prost(bool, tag = "7")] + pub values: bool, + /// Name of the detected field to fetch values for. + #[prost(string, tag = "8")] + pub name: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedFieldsResponse { + #[prost(message, repeated, tag = "1")] + pub fields: ::prost::alloc::vec::Vec, + #[prost(uint32, tag = "2")] + pub limit: u32, + #[prost(string, repeated, tag = "3")] + pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// TODO: make the detected field include the serialized sketch +/// we only want cardinality in the JSON response +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedField { + #[prost(string, tag = "1")] + pub label: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub r#type: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub cardinality: u64, + #[prost(string, repeated, tag = "4")] + pub parsers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(bytes = "vec", tag = "5")] + pub sketch: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedLabelsRequest { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "3")] + pub query: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedLabelsResponse { + #[prost(message, repeated, tag = "1")] + pub detected_labels: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DetectedLabel { + #[prost(string, tag = "1")] + pub label: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub cardinality: u64, + #[prost(bytes = "vec", tag = "3")] + pub sketch: ::prost::alloc::vec::Vec, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum Direction { Forward = 0, Backward = 1, } +impl Direction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Forward => "FORWARD", + Self::Backward => "BACKWARD", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FORWARD" => Some(Self::Forward), + "BACKWARD" => Some(Self::Backward), + _ => None, + } + } +} diff --git a/loki-api/src/resultscache.rs b/loki-api/src/resultscache.rs new file mode 100644 index 0000000..a8ca1fa --- /dev/null +++ b/loki-api/src/resultscache.rs @@ -0,0 +1,26 @@ +// This file is @generated by prost-build. +/// Defined here to prevent circular imports between logproto & queryrangebase +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct CachingOptions { + #[prost(bool, tag = "1")] + pub disabled: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CachedResponse { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + /// List of cached responses; non-overlapping and in order. + #[prost(message, repeated, tag = "2")] + pub extents: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Extent { + #[prost(int64, tag = "1")] + pub start: i64, + #[prost(int64, tag = "2")] + pub end: i64, + #[prost(string, tag = "4")] + pub trace_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "5")] + pub response: ::core::option::Option<::prost_types::Any>, +} diff --git a/loki-api/src/stats.rs b/loki-api/src/stats.rs index 31d6aad..3f304cf 100644 --- a/loki-api/src/stats.rs +++ b/loki-api/src/stats.rs @@ -1,96 +1,194 @@ +// This file is @generated by prost-build. /// Result contains LogQL query statistics. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Result { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub summary: ::core::option::Option, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub querier: ::core::option::Option, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub ingester: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub caches: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub index: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Caches { + #[prost(message, optional, tag = "1")] + pub chunk: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub index: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub result: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub stats_result: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub volume_result: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub series_result: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub label_result: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub instant_metric_result: ::core::option::Option, } /// Summary is the summary of a query statistics. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Summary { /// Total bytes processed per second. - #[prost(int64, tag="1")] + #[prost(int64, tag = "1")] pub bytes_processed_per_second: i64, /// Total lines processed per second. - #[prost(int64, tag="2")] + #[prost(int64, tag = "2")] pub lines_processed_per_second: i64, - /// Total bytes processed. - #[prost(int64, tag="3")] + /// Total bytes processed. Includes structured metadata bytes. + #[prost(int64, tag = "3")] pub total_bytes_processed: i64, /// Total lines processed. - #[prost(int64, tag="4")] + #[prost(int64, tag = "4")] pub total_lines_processed: i64, /// Execution time in seconds. /// In addition to internal calculations this is also returned by the HTTP API. /// Grafana expects time values to be returned in seconds as float. - #[prost(double, tag="5")] + #[prost(double, tag = "5")] pub exec_time: f64, /// Queue time in seconds. /// In addition to internal calculations this is also returned by the HTTP API. /// Grafana expects time values to be returned in seconds as float. - #[prost(double, tag="6")] + #[prost(double, tag = "6")] pub queue_time: f64, - /// Total of subqueries created to fulfill this query. - #[prost(int64, tag="7")] + /// Subqueries exists for backwards compatibility reasons and is deprecated. Do not use. + /// Instead use splits and shards + #[prost(int64, tag = "7")] pub subqueries: i64, + /// Total number of result entries returned + #[prost(int64, tag = "8")] + pub total_entries_returned: i64, + /// Total number of splits by time + #[prost(int64, tag = "9")] + pub splits: i64, + /// Total number of shards + #[prost(int64, tag = "10")] + pub shards: i64, + /// Total lines post query filtering + #[prost(int64, tag = "11")] + pub total_post_filter_lines: i64, + /// Total bytes processed of metadata. + #[prost(int64, tag = "12")] + pub total_structured_metadata_bytes_processed: i64, +} +/// Statistics from Index queries +/// TODO(owen-d): include bytes. +/// Needs some index methods added to return _sized_ chunk refs to know +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Index { + /// Total chunks + #[prost(int64, tag = "1")] + pub total_chunks: i64, + /// Post-filtered chunks + #[prost(int64, tag = "2")] + pub post_filter_chunks: i64, + /// Nanosecond duration spent fetching shards + #[prost(int64, tag = "3")] + pub shards_duration: i64, + /// Indicates whether the query used blooms to filter chunks + #[prost(bool, tag = "4")] + pub used_bloom_filters: bool, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Querier { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub store: ::core::option::Option, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Ingester { /// Total ingester reached for this query. - #[prost(int32, tag="1")] + #[prost(int32, tag = "1")] pub total_reached: i32, /// Total of chunks matched by the query from ingesters - #[prost(int64, tag="2")] + #[prost(int64, tag = "2")] pub total_chunks_matched: i64, /// Total of batches sent from ingesters. - #[prost(int64, tag="3")] + #[prost(int64, tag = "3")] pub total_batches: i64, /// Total lines sent by ingesters. - #[prost(int64, tag="4")] + #[prost(int64, tag = "4")] pub total_lines_sent: i64, - #[prost(message, optional, tag="5")] + #[prost(message, optional, tag = "5")] pub store: ::core::option::Option, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Store { /// The total of chunk reference fetched from index. - #[prost(int64, tag="1")] + #[prost(int64, tag = "1")] pub total_chunks_ref: i64, /// Total number of chunks fetched. - #[prost(int64, tag="2")] + #[prost(int64, tag = "2")] pub total_chunks_downloaded: i64, /// Time spent fetching chunks in nanoseconds. - #[prost(int64, tag="3")] + #[prost(int64, tag = "3")] pub chunks_download_time: i64, - #[prost(message, optional, tag="4")] + /// Whether the query referenced structured metadata + #[prost(bool, tag = "13")] + pub query_referenced_structured: bool, + #[prost(message, optional, tag = "4")] pub chunk: ::core::option::Option, + /// Time spent fetching chunk refs from index. + #[prost(int64, tag = "5")] + pub chunk_refs_fetch_time: i64, + /// Time spent being blocked on congestion control. + #[prost(int64, tag = "6")] + pub congestion_control_latency: i64, + /// Total number of lines filtered by pipeline wrapper. + #[prost(int64, tag = "7")] + pub pipeline_wrapper_filtered_lines: i64, } -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Chunk { - /// Total bytes processed but was already in memory. (found in the headchunk) - #[prost(int64, tag="4")] + /// Total bytes processed but was already in memory (found in the headchunk). Includes structured metadata bytes. + #[prost(int64, tag = "4")] pub head_chunk_bytes: i64, /// Total lines processed but was already in memory. (found in the headchunk) - #[prost(int64, tag="5")] + #[prost(int64, tag = "5")] pub head_chunk_lines: i64, - /// Total bytes decompressed and processed from chunks. - #[prost(int64, tag="6")] + /// Total bytes decompressed and processed from chunks. Includes structured metadata bytes. + #[prost(int64, tag = "6")] pub decompressed_bytes: i64, /// Total lines decompressed and processed from chunks. - #[prost(int64, tag="7")] + #[prost(int64, tag = "7")] pub decompressed_lines: i64, /// Total bytes of compressed chunks (blocks) processed. - #[prost(int64, tag="8")] + #[prost(int64, tag = "8")] pub compressed_bytes: i64, /// Total duplicates found while processing. - #[prost(int64, tag="9")] + #[prost(int64, tag = "9")] pub total_duplicates: i64, + /// Total lines post filtering + #[prost(int64, tag = "10")] + pub post_filter_lines: i64, + /// Total bytes processed for metadata but was already in memory. (found in the headchunk) + #[prost(int64, tag = "11")] + pub head_chunk_structured_metadata_bytes: i64, + /// Total bytes of entries metadata decompressed and processed from chunks. + #[prost(int64, tag = "12")] + pub decompressed_structured_metadata_bytes: i64, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Cache { + #[prost(int32, tag = "1")] + pub entries_found: i32, + #[prost(int32, tag = "2")] + pub entries_requested: i32, + #[prost(int32, tag = "3")] + pub entries_stored: i32, + #[prost(int64, tag = "4")] + pub bytes_received: i64, + #[prost(int64, tag = "5")] + pub bytes_sent: i64, + #[prost(int32, tag = "6")] + pub requests: i32, + #[prost(int64, tag = "7")] + pub download_time: i64, + #[prost(int64, tag = "8")] + pub query_length_served: i64, } diff --git a/src/lib.rs b/src/lib.rs index f0b01a3..328cc7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -403,6 +403,8 @@ impl SendQueue { .map(|e| loki::EntryAdapter { timestamp: Some(e.timestamp.into()), line: e.message.clone(), + structured_metadata: vec![], + parsed: vec![], }) .collect(), // Couldn't find documentation except for the promtail source code: diff --git a/src/log_support.rs b/src/log_support.rs index 2368332..f6e7ac3 100644 --- a/src/log_support.rs +++ b/src/log_support.rs @@ -10,7 +10,7 @@ use tracing_serde::SerdeMapVisitor; pub struct SerializeEventFieldMapStrippingLog<'a>(pub &'a Event<'a>); -impl<'a> Serialize for SerializeEventFieldMapStrippingLog<'a> { +impl Serialize for SerializeEventFieldMapStrippingLog<'_> { fn serialize(&self, serializer: S) -> Result { let len = self.0.fields().count(); let serializer = serializer.serialize_map(Some(len))?; From efcf042ae3db8b309683432db8beacbf258e3223 Mon Sep 17 00:00:00 2001 From: Martijn Berger Date: Thu, 24 Apr 2025 07:51:06 +0200 Subject: [PATCH 2/2] Remove updates to packages --- Cargo.lock | 707 +++++++++-------------------------- Cargo.toml | 20 +- loki-api/generate/Cargo.toml | 2 +- 3 files changed, 190 insertions(+), 539 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e3d9f7..bab159e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,29 +1,23 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] -name = "addr2line" -version = "0.24.2" +name = "aho-corasick" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ - "gimli", + "memchr", ] [[package]] -name = "adler2" -version = "2.0.0" +name = "ansi_term" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "memchr", + "winapi", ] [[package]] @@ -38,21 +32,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - [[package]] name = "base64" version = "0.13.0" @@ -73,9 +52,9 @@ checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "bytes" -version = "1.10.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" @@ -105,17 +84,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "either" version = "1.6.1" @@ -169,10 +137,11 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ + "matches", "percent-encoding", ] @@ -215,12 +184,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "h2" version = "0.3.12" @@ -248,9 +211,21 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.5.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] name = "http" @@ -303,7 +278,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.4", + "socket2", "tokio", "tower-service", "tracing", @@ -336,143 +311,15 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ - "icu_normalizer", - "icu_properties", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -532,21 +379,18 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" - -[[package]] -name = "litemap" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" [[package]] name = "log" -version = "0.4.26" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] [[package]] name = "loki-api" @@ -563,11 +407,17 @@ dependencies = [ "prost-build", ] +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + [[package]] name = "memchr" -version = "2.7.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mime" @@ -576,23 +426,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] -name = "miniz_oxide" -version = "0.8.5" +name = "mio" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ - "adler2", + "libc", + "log", + "miow", + "ntapi", + "wasi", + "winapi", ] [[package]] -name = "mio" -version = "1.0.3" +name = "miow" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "libc", - "wasi", - "windows-sys", + "winapi", ] [[package]] @@ -620,29 +473,29 @@ dependencies = [ ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "ntapi" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ - "overload", "winapi", ] [[package]] -name = "object" -version = "0.36.7" +name = "num_cpus" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "memchr", + "hermit-abi", + "libc", ] [[package]] name = "once_cell" -version = "1.21.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "openssl" @@ -677,17 +530,11 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" @@ -701,9 +548,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -717,30 +564,20 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" -[[package]] -name = "prettyplease" -version = "0.2.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ - "unicode-ident", + "unicode-xid", ] [[package]] name = "prost" -version = "0.13.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes", "prost-derive", @@ -748,51 +585,52 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ + "bytes", "heck", "itertools", + "lazy_static", "log", "multimap", - "once_cell", "petgraph", - "prettyplease", "prost", "prost-types", "regex", - "syn 2.0.100", "tempfile", + "which", ] [[package]] name = "prost-derive" -version = "0.13.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.100", + "syn", ] [[package]] name = "prost-types" -version = "0.13.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ + "bytes", "prost", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" dependencies = [ "proc-macro2", ] @@ -808,21 +646,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -831,9 +657,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -900,12 +726,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustls" version = "0.20.6" @@ -978,32 +798,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn", ] [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", - "memchr", "ryu", "serde", ] @@ -1037,15 +856,15 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "snap" -version = "1.1.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" [[package]] name = "socket2" @@ -1057,28 +876,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "socket2" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "syn" version = "1.0.89" @@ -1090,28 +893,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "tempfile" version = "3.3.0" @@ -1136,40 +917,46 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + [[package]] name = "tokio" -version = "1.44.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ - "backtrace", "bytes", "libc", + "memchr", "mio", + "num_cpus", "pin-project-lite", - "socket2 0.5.8", + "socket2", "tokio-macros", - "windows-sys", + "winapi", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn", ] [[package]] @@ -1195,9 +982,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1226,10 +1013,11 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" dependencies = [ + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1237,33 +1025,33 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "aa31669fa42c09c34d94d8165dd2012e8ff3c66aca50f3bb226b68f216f2706c" dependencies = [ - "once_cell", + "lazy_static", "valuable", ] [[package]] name = "tracing-log" -version = "0.2.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ + "lazy_static", "log", - "once_cell", "tracing-core", ] @@ -1298,11 +1086,11 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" dependencies = [ - "nu-ansi-term", + "ansi_term", "sharded-slab", "smallvec", "thread_local", @@ -1317,10 +1105,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "unicode-ident" -version = "1.0.18" +name = "unicode-bidi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" @@ -1336,27 +1139,16 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.5.4" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", + "matches", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "valuable" version = "0.1.0" @@ -1406,7 +1198,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 1.0.89", + "syn", "wasm-bindgen-shared", ] @@ -1440,7 +1232,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.89", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1480,6 +1272,17 @@ dependencies = [ "webpki", ] +[[package]] +name = "which" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2" +dependencies = [ + "either", + "lazy_static", + "libc", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1502,79 +1305,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - [[package]] name = "winreg" version = "0.10.1" @@ -1583,82 +1313,3 @@ checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] diff --git a/Cargo.toml b/Cargo.toml index 2b4ec42..6fa050f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,20 +17,20 @@ edition = "2021" [dependencies] loki-api = { version = "0.1.0", path = "loki-api" } reqwest = { version = ">=0.11.10,<0.13.0", default-features = false } -snap = "1.1.1" -serde = { version = "1.0.219", features = ["derive"] } -serde_json = "1.0.140" -tokio = { version = "1.44.1", features = ["sync"] } -tokio-stream = "0.1.17" -tracing = "0.1.41" -tracing-core = "0.1.33" +snap = "1.0.5" +serde = { version = "1.0.136", features = ["derive"] } +serde_json = "1.0.79" +tokio = { version = "1.17.0", features = ["sync"] } +tokio-stream = "0.1.8" +tracing = "0.1.32" +tracing-core = "0.1.23" tracing-log = ">=0.1.2,<0.3.0" tracing-serde = ">=0.1.3,<0.3.0" -tracing-subscriber = "0.3.19" -url = "2.5.4" +tracing-subscriber = "0.3.9" +url = "2.2.2" [dev-dependencies] -tokio = { version = "1.44.1", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread"] } [features] default = ["compat-0-2-1", "native-tls"] diff --git a/loki-api/generate/Cargo.toml b/loki-api/generate/Cargo.toml index 556045f..7cb4207 100644 --- a/loki-api/generate/Cargo.toml +++ b/loki-api/generate/Cargo.toml @@ -9,4 +9,4 @@ license = "MIT/Apache-2.0" edition = "2021" [build-dependencies] -prost-build = "0.13" +prost-build = "0.9"