build: Update Loki proto (#5484)

* build: mv loki-api to loki-proto

* fmt: fmt toml

* fix: loki-proto using rev

---------

Co-authored-by: wangrui <wangrui@baihai.ai>
This commit is contained in:
ozewr
2025-02-07 17:09:39 +08:00
committed by GitHub
parent 6eccadbf73
commit 0e4bd59fac
6 changed files with 24 additions and 18 deletions

22
Cargo.lock generated
View File

@@ -1053,7 +1053,7 @@ dependencies = [
"bitflags 2.6.0",
"cexpr",
"clang-sys",
"itertools 0.13.0",
"itertools 0.11.0",
"proc-macro2",
"quote",
"regex",
@@ -6128,7 +6128,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
"windows-targets 0.48.5",
]
[[package]]
@@ -6264,12 +6264,14 @@ dependencies = [
]
[[package]]
name = "loki-api"
version = "0.1.2"
source = "git+https://github.com/shuiyisong/tracing-loki?branch=chore%2Fprost_version#ad135292a77b6ce638d126571804c19fdaa36215"
name = "loki-proto"
version = "0.1.0"
source = "git+https://github.com/GreptimeTeam/loki-proto.git?rev=1434ecf23a2654025d86188fb5205e7a74b225d3#1434ecf23a2654025d86188fb5205e7a74b225d3"
dependencies = [
"prost 0.13.3",
"prost-types 0.13.3",
"tonic 0.12.3",
"tonic-build 0.12.3",
]
[[package]]
@@ -8741,7 +8743,7 @@ checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15"
dependencies = [
"bytes",
"heck 0.5.0",
"itertools 0.13.0",
"itertools 0.11.0",
"log",
"multimap",
"once_cell",
@@ -8787,7 +8789,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
dependencies = [
"anyhow",
"itertools 0.13.0",
"itertools 0.11.0",
"proc-macro2",
"quote",
"syn 2.0.90",
@@ -10400,7 +10402,7 @@ dependencies = [
"lazy_static",
"local-ip-address",
"log-query",
"loki-api",
"loki-proto",
"mime_guess",
"mysql_async",
"notify",
@@ -11773,7 +11775,7 @@ dependencies = [
"hyper-util",
"itertools 0.10.5",
"log-query",
"loki-api",
"loki-proto",
"meta-client",
"meta-srv",
"moka",
@@ -13248,7 +13250,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.48.0",
]
[[package]]

View File

@@ -138,7 +138,7 @@ itertools = "0.10"
jsonb = { git = "https://github.com/databendlabs/jsonb.git", rev = "8c8d2fc294a39f3ff08909d60f718639cfba3875", default-features = false }
lazy_static = "1.4"
local-ip-address = "0.6"
loki-api = { git = "https://github.com/shuiyisong/tracing-loki", branch = "chore/prost_version" }
loki-proto = { git = "https://github.com/GreptimeTeam/loki-proto.git", rev = "1434ecf23a2654025d86188fb5205e7a74b225d3" }
meter-core = { git = "https://github.com/GreptimeTeam/greptime-meter.git", rev = "5618e779cf2bb4755b499c630fba4c35e91898cb" }
mockall = "0.11.4"
moka = "0.12"

View File

@@ -70,7 +70,7 @@ itertools.workspace = true
jsonb.workspace = true
lazy_static.workspace = true
log-query.workspace = true
loki-api.workspace = true
loki-proto.workspace = true
mime_guess = "2.0"
notify.workspace = true
object-pool = "0.5"

View File

@@ -31,7 +31,7 @@ use common_telemetry::{error, warn};
use hashbrown::HashMap;
use headers::ContentType;
use lazy_static::lazy_static;
use loki_api::prost_types::Timestamp;
use loki_proto::prost_types::Timestamp;
use prost::Message;
use quoted_string::test_utils::TestSpec;
use session::context::{Channel, QueryContext};
@@ -241,7 +241,7 @@ async fn handle_pb_req(
schemas: &mut Vec<ColumnSchema>,
) -> Result<Vec<Vec<GreptimeValue>>> {
let decompressed = prom_store::snappy_decompress(&bytes).unwrap();
let req = loki_api::logproto::PushRequest::decode(&decompressed[..])
let req = loki_proto::logproto::PushRequest::decode(&decompressed[..])
.context(DecodeOtlpRequestSnafu)?;
let mut column_indexer: HashMap<String, u16> = HashMap::new();
@@ -435,7 +435,7 @@ macro_rules! unwrap_or_warn_continue {
mod tests {
use std::collections::BTreeMap;
use loki_api::prost_types::Timestamp;
use loki_proto::prost_types::Timestamp;
use crate::error::Error::InvalidLokiLabels;
use crate::http::loki::{parse_loki_labels, prost_ts_to_nano};

View File

@@ -47,7 +47,7 @@ futures.workspace = true
futures-util.workspace = true
hyper-util = { workspace = true, features = ["tokio"] }
log-query = { workspace = true }
loki-api.workspace = true
loki-proto.workspace = true
meta-client.workspace = true
meta-srv = { workspace = true, features = ["mock"] }
moka.workspace = true

View File

@@ -23,8 +23,8 @@ use common_error::status_code::StatusCode as ErrorCode;
use flate2::write::GzEncoder;
use flate2::Compression;
use log_query::{Context, Limit, LogQuery, TimeFilter};
use loki_api::logproto::{EntryAdapter, PushRequest, StreamAdapter};
use loki_api::prost_types::Timestamp;
use loki_proto::logproto::{EntryAdapter, PushRequest, StreamAdapter};
use loki_proto::prost_types::Timestamp;
use opentelemetry_proto::tonic::collector::logs::v1::ExportLogsServiceRequest;
use opentelemetry_proto::tonic::collector::metrics::v1::ExportMetricsServiceRequest;
use opentelemetry_proto::tonic::collector::trace::v1::ExportTraceServiceRequest;
@@ -2027,10 +2027,14 @@ pub async fn test_loki_pb_logs(store_type: StorageType) {
EntryAdapter {
timestamp: Some(Timestamp::from_str("2024-11-07T10:53:50").unwrap()),
line: "this is a log message".to_string(),
structured_metadata: vec![],
parsed: vec![],
},
EntryAdapter {
timestamp: Some(Timestamp::from_str("2024-11-07T10:53:50").unwrap()),
line: "this is a log message".to_string(),
structured_metadata: vec![],
parsed: vec![],
},
],
hash: rand::random(),