diff --git a/Cargo.lock b/Cargo.lock index 44796fba75980..5377c7765e038 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2164,7 +2164,7 @@ dependencies = [ "memchr", "once_cell", "ordered-float 3.9.1", - "prost", + "prost 0.12.0", "prost-reflect", "regex", "serde", @@ -2289,9 +2289,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" dependencies = [ - "prost", - "prost-types", - "tonic", + "prost 0.11.9", + "prost-types 0.11.9", + "tonic 0.9.2", "tracing-core 0.1.30", ] @@ -2307,13 +2307,13 @@ dependencies = [ "futures 0.3.28", "hdrhistogram", "humantime", - "prost-types", + "prost-types 0.11.9", "serde", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic", + "tonic 0.9.2", "tracing 0.1.37", "tracing-core 0.1.30", "tracing-subscriber", @@ -3775,11 +3775,11 @@ name = "greptime-proto" version = "0.1.0" source = "git+https://github.com/GreptimeTeam/greptime-proto.git?tag=0.2.1#4398d20c56d5f7939cc2960789cb1fa7dd18e6fe" dependencies = [ - "prost", + "prost 0.11.9", "serde", "serde_json", - "tonic", - "tonic-build", + "tonic 0.9.2", + "tonic-build 0.9.2", ] [[package]] @@ -3793,13 +3793,13 @@ dependencies = [ "futures-util", "greptime-proto", "parking_lot", - "prost", + "prost 0.11.9", "rand 0.8.5", "snafu", "tokio", "tokio-stream", - "tonic", - "tonic-build", + "tonic 0.9.2", + "tonic-build 0.9.2", "tower", ] @@ -4966,9 +4966,9 @@ version = "0.1.0" dependencies = [ "bytes 1.4.0", "chrono", - "prost", - "prost-build", - "prost-types", + "prost 0.12.0", + "prost-build 0.12.0", + "prost-types 0.12.0", "snap", ] @@ -5876,10 +5876,10 @@ dependencies = [ "chrono", "hex", "ordered-float 3.9.1", - "prost", - "prost-build", - "tonic", - "tonic-build", + "prost 0.12.0", + "prost-build 0.12.0", + "tonic 0.10.0", + "tonic-build 0.10.0", "vector-core", "vector-lookup", "vrl", @@ -6407,6 +6407,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +dependencies = [ + "proc-macro2 1.0.66", + "syn 2.0.29", +] + [[package]] name = "prettytable-rs" version = "0.10.0" @@ -6502,9 +6512,9 @@ dependencies = [ "indexmap 2.0.0", "nom", "num_enum 0.7.0", - "prost", - "prost-build", - "prost-types", + "prost 0.12.0", + "prost-build 0.12.0", + "prost-types 0.12.0", "snafu", "vector-common", ] @@ -6536,7 +6546,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes 1.4.0", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa8473a65b88506c106c28ae905ca4a2b83a2993640467a41bb3080627ddfd2c" +dependencies = [ + "bytes 1.4.0", + "prost-derive 0.12.0", ] [[package]] @@ -6552,15 +6572,37 @@ dependencies = [ "log", "multimap", "petgraph", - "prettyplease", - "prost", - "prost-types", + "prettyplease 0.1.21", + "prost 0.11.9", + "prost-types 0.11.9", "regex", "syn 1.0.109", "tempfile", "which", ] +[[package]] +name = "prost-build" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d3e647e9eb04ddfef78dfee2d5b3fefdf94821c84b710a3d8ebc89ede8b164" +dependencies = [ + "bytes 1.4.0", + "heck 0.4.1", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease 0.2.12", + "prost 0.12.0", + "prost-types 0.12.0", + "regex", + "syn 2.0.29", + "tempfile", + "which", +] + [[package]] name = "prost-derive" version = "0.11.9" @@ -6574,16 +6616,29 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56075c27b20ae524d00f247b8a4dc333e5784f889fe63099f8e626bc8d73486c" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2 1.0.66", + "quote 1.0.33", + "syn 2.0.29", +] + [[package]] name = "prost-reflect" -version = "0.11.5" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b823de344848e011658ac981009100818b322421676740546f8b52ed5249428" +checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" dependencies = [ "base64 0.21.3", "once_cell", - "prost", - "prost-types", + "prost 0.12.0", + "prost-types 0.12.0", "serde", "serde-value", ] @@ -6594,7 +6649,16 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", +] + +[[package]] +name = "prost-types" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cebe0a918c97f86c217b0f76fd754e966f8b9f41595095cf7d74cb4e59d730f6" +dependencies = [ + "prost 0.12.0", ] [[package]] @@ -6640,9 +6704,9 @@ dependencies = [ "oauth2", "openidconnect", "pem", - "prost", - "prost-build", - "prost-derive", + "prost 0.11.9", + "prost-build 0.11.9", + "prost-derive 0.11.9", "rand 0.8.5", "regex", "serde", @@ -7387,9 +7451,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -8795,7 +8859,6 @@ dependencies = [ "axum", "base64 0.21.3", "bytes 1.4.0", - "flate2", "futures-core", "futures-util", "h2", @@ -8805,7 +8868,37 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", + "rustls-pemfile", + "tokio", + "tokio-rustls 0.24.0", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing 0.1.37", +] + +[[package]] +name = "tonic" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5469afaf78a11265c343a88969045c1568aa8ecc6c787dbf756e92e70f199861" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.3", + "bytes 1.4.0", + "flate2", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.0", "rustls-native-certs", "rustls-pemfile", "tokio", @@ -8823,13 +8916,26 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" dependencies = [ - "prettyplease", + "prettyplease 0.1.21", "proc-macro2 1.0.66", - "prost-build", + "prost-build 0.11.9", "quote 1.0.33", "syn 1.0.109", ] +[[package]] +name = "tonic-build" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b477abbe1d18c0b08f56cd01d1bc288668c5b5cfd19b2ae1886bbf599c546f1" +dependencies = [ + "prettyplease 0.2.12", + "proc-macro2 1.0.66", + "prost-build 0.12.0", + "quote 1.0.33", + "syn 2.0.29", +] + [[package]] name = "tower" version = "0.4.13" @@ -9577,10 +9683,10 @@ dependencies = [ "postgres-openssl", "prometheus-parser", "proptest", - "prost", - "prost-build", + "prost 0.12.0", + "prost-build 0.12.0", "prost-reflect", - "prost-types", + "prost-types 0.12.0", "pulsar", "quickcheck", "rand 0.8.5", @@ -9623,8 +9729,8 @@ dependencies = [ "tokio-tungstenite 0.20.0", "tokio-util", "toml 0.7.6", - "tonic", - "tonic-build", + "tonic 0.10.0", + "tonic-build 0.10.0", "tower", "tower-http", "tower-test", @@ -9847,9 +9953,9 @@ dependencies = [ "parking_lot", "pin-project", "proptest", - "prost", - "prost-build", - "prost-types", + "prost 0.12.0", + "prost-build 0.12.0", + "prost-types 0.12.0", "quanta", "quickcheck", "quickcheck_macros", @@ -9872,7 +9978,7 @@ dependencies = [ "tokio-test", "tokio-util", "toml 0.7.6", - "tonic", + "tonic 0.10.0", "tower", "tracing 0.1.37", "tracing-core 0.1.30", diff --git a/Cargo.toml b/Cargo.toml index ea3e573093fbd..d6a9ef826e542 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -212,9 +212,9 @@ rmp-serde = { version = "1.1.2", default-features = false, optional = true } rmpv = { version = "1.0.1", default-features = false, features = ["with-serde"], optional = true } # Prost / Protocol Buffers -prost = { version = "0.11", default-features = false, features = ["std"] } -prost-reflect = { version = "0.11", default-features = false, optional = true } -prost-types = { version = "0.11", default-features = false, optional = true } +prost = { version = "0.12", default-features = false, features = ["std"] } +prost-reflect = { version = "0.12", default-features = false, optional = true } +prost-types = { version = "0.12", default-features = false, optional = true } # GCP goauth = { version = "0.13.1", optional = true } @@ -322,7 +322,7 @@ tikv-jemallocator = { version = "0.5.4", default-features = false, optional = tr tokio-postgres = { version = "0.7.10", default-features = false, features = ["runtime", "with-chrono-0_4"], optional = true } tokio-tungstenite = {version = "0.20.0", default-features = false, features = ["connect"], optional = true} toml = { version = "0.7.6", default-features = false, features = ["parse", "display"] } -tonic = { version = "0.9", optional = true, default-features = false, features = ["transport", "codegen", "prost", "tls", "tls-roots", "gzip"] } +tonic = { version = "0.10", optional = true, default-features = false, features = ["transport", "codegen", "prost", "tls", "tls-roots", "gzip"] } trust-dns-proto = { version = "0.23.0", default-features = false, features = ["dnssec"], optional = true } typetag = { version = "0.2.13", default-features = false } url = { version = "2.4.1", default-features = false, features = ["serde"] } @@ -346,8 +346,8 @@ atty = { version = "0.2.14", default-features = false } nix = { version = "0.26.2", default-features = false, features = ["socket", "signal"] } [build-dependencies] -prost-build = { version = "0.11", default-features = false, optional = true } -tonic-build = { version = "0.9", default-features = false, features = ["transport", "prost"], optional = true } +prost-build = { version = "0.12", default-features = false, optional = true } +tonic-build = { version = "0.10", default-features = false, features = ["transport", "prost"], optional = true } openssl-src = { version = "300", default-features = false, features = ["force-engine", "legacy"] } [dev-dependencies] diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 1f093d4cdb156..6d7e3f7215623 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -458,7 +458,7 @@ rustc_version,https://github.com/Kimundi/rustc-version-rs,MIT OR Apache-2.0,Marv rustc_version_runtime,https://github.com/seppo0010/rustc-version-runtime-rs,MIT,Sebastian Waisbrot rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman , Jakub Konka " rustls,https://github.com/rustls/rustls,Apache-2.0 OR ISC OR MIT,The rustls Authors -rustls-native-certs,https://github.com/ctz/rustls-native-certs,Apache-2.0 OR ISC OR MIT,Joseph Birr-Pixton +rustls-native-certs,https://github.com/ctz/rustls-native-certs,Apache-2.0 OR ISC OR MIT,The rustls-native-certs Authors rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The rustls-pemfile Authors rustls-webpki,https://github.com/rustls/webpki,ISC,The rustls-webpki Authors rustversion,https://github.com/dtolnay/rustversion,MIT OR Apache-2.0,David Tolnay diff --git a/lib/codecs/Cargo.toml b/lib/codecs/Cargo.toml index b77c81d59926f..429bce7490221 100644 --- a/lib/codecs/Cargo.toml +++ b/lib/codecs/Cargo.toml @@ -16,8 +16,8 @@ lookup = { package = "vector-lookup", path = "../vector-lookup", default-feature memchr = { version = "2", default-features = false } once_cell = { version = "1.18", default-features = false } ordered-float = { version = "3.9.1", default-features = false } -prost = { version = "0.11.8", default-features = false, features = ["std"] } -prost-reflect = { version = "0.11", default-features = false, features = ["serde"] } +prost = { version = "0.12.0", default-features = false, features = ["std"] } +prost-reflect = { version = "0.12", default-features = false, features = ["serde"] } regex = { version = "1.9.5", default-features = false, features = ["std", "perf"] } serde = { version = "1", default-features = false, features = ["derive"] } serde_json = { version = "1", default-features = false } diff --git a/lib/loki-logproto/Cargo.toml b/lib/loki-logproto/Cargo.toml index c140e168546a9..73ec325bda04e 100644 --- a/lib/loki-logproto/Cargo.toml +++ b/lib/loki-logproto/Cargo.toml @@ -8,8 +8,8 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -prost = { version = "0.11", default-features = false, features = ["std"] } -prost-types = { version = "0.11", default-features = false, features = ["std"] } +prost = { version = "0.12", default-features = false, features = ["std"] } +prost-types = { version = "0.12", default-features = false, features = ["std"] } bytes = { version = "1.4.0", default-features = false } snap = { version = "1.1.0", default-features = false } @@ -17,4 +17,4 @@ snap = { version = "1.1.0", default-features = false } chrono = "0.4" [build-dependencies] -prost-build = { version = "0.11" } +prost-build = { version = "0.12" } diff --git a/lib/opentelemetry-proto/Cargo.toml b/lib/opentelemetry-proto/Cargo.toml index e20acec6c320e..ea04446d3d72e 100644 --- a/lib/opentelemetry-proto/Cargo.toml +++ b/lib/opentelemetry-proto/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" publish = false [build-dependencies] -prost-build = { version = "0.11", default-features = false} -tonic-build = { version = "0.9", default-features = false, features = ["prost", "transport"] } +prost-build = { version = "0.12", default-features = false} +tonic-build = { version = "0.10", default-features = false, features = ["prost", "transport"] } [dependencies] bytes = { version = "1.4.0", default-features = false, features = ["serde"] } @@ -15,7 +15,7 @@ chrono = { version = "0.4.19", default-features = false, features = ["serde"] } hex = { version = "0.4.3", default-features = false, features = ["std"] } lookup = { package = "vector-lookup", path = "../vector-lookup", default-features = false } ordered-float = { version = "3.9.1", default-features = false } -prost = { version = "0.11", default-features = false, features = ["std"] } -tonic = { version = "0.9", default-features = false, features = ["codegen", "gzip", "prost", "tls", "tls-roots", "transport"] } +prost = { version = "0.12", default-features = false, features = ["std"] } +tonic = { version = "0.10", default-features = false, features = ["codegen", "gzip", "prost", "tls", "tls-roots", "transport"] } vrl.workspace = true vector-core = { path = "../vector-core", default-features = false } diff --git a/lib/prometheus-parser/Cargo.toml b/lib/prometheus-parser/Cargo.toml index 8ef026cd3c2da..54b0fc42dc862 100644 --- a/lib/prometheus-parser/Cargo.toml +++ b/lib/prometheus-parser/Cargo.toml @@ -12,10 +12,10 @@ license = "MPL-2.0" indexmap = "~2.0.0" nom = "7.1.3" num_enum = "0.7.0" -prost = "0.11" -prost-types = "0.11" +prost = "0.12" +prost-types = "0.12" snafu = { version = "0.7" } vector-common = { path = "../vector-common", features = ["btreemap"] } [build-dependencies] -prost-build = "0.11" +prost-build = "0.12" diff --git a/lib/prometheus-parser/build.rs b/lib/prometheus-parser/build.rs index 88d62ed031367..ce277400ce948 100644 --- a/lib/prometheus-parser/build.rs +++ b/lib/prometheus-parser/build.rs @@ -7,7 +7,6 @@ fn main() { // prost automatically adds them already to enums, which causes the // extra derives to conflict with itself. prost_build.type_attribute("Label", "#[derive(Eq, Hash, Ord, PartialOrd)]"); - prost_build.type_attribute("MetricType", "#[derive(num_enum::TryFromPrimitive)]"); prost_build .compile_protos( &["proto/prometheus-remote.proto"], diff --git a/lib/vector-core/Cargo.toml b/lib/vector-core/Cargo.toml index e4e9f86059721..c8f871a90cf7e 100644 --- a/lib/vector-core/Cargo.toml +++ b/lib/vector-core/Cargo.toml @@ -36,8 +36,8 @@ openssl = { version = "0.10.57", default-features = false, features = ["vendored parking_lot = { version = "0.12.1", default-features = false } pin-project.workspace = true proptest = { version = "1.2", optional = true } -prost-types = { version = "0.11", default-features = false } -prost = { version = "0.11", default-features = false, features = ["std"] } +prost-types = { version = "0.12", default-features = false } +prost = { version = "0.12", default-features = false, features = ["std"] } quanta = { version = "0.11.1", default-features = false } regex = { version = "1.9.5", default-features = false, features = ["std", "perf"] } ryu = { version = "1", default-features = false } @@ -52,7 +52,7 @@ tokio-openssl = { version = "0.6.3", default-features = false } tokio-stream = { version = "0.1", default-features = false, features = ["time"], optional = true } tokio-util = { version = "0.7.0", default-features = false, features = ["time"] } toml = { version = "0.7.6", default-features = false } -tonic = { version = "0.9", default-features = false, features = ["transport"] } +tonic = { version = "0.10", default-features = false, features = ["transport"] } tower = { version = "0.4", default-features = false, features = ["util"] } tracing = { version = "0.1.34", default-features = false } tracing-core = { version = "0.1.26", default-features = false } @@ -75,7 +75,7 @@ security-framework = "2.9.2" schannel = "0.1.22" [build-dependencies] -prost-build = "0.11" +prost-build = "0.12" [dev-dependencies] base64 = "0.21.3" diff --git a/src/sinks/vector/config.rs b/src/sinks/vector/config.rs index c83f088c9e35b..b0e2b6c5a8e6f 100644 --- a/src/sinks/vector/config.rs +++ b/src/sinks/vector/config.rs @@ -161,12 +161,12 @@ async fn healthcheck( let request = service.client.health_check(proto::HealthCheckRequest {}); match request.await { - Ok(response) => match proto::ServingStatus::from_i32(response.into_inner().status) { - Some(proto::ServingStatus::Serving) => Ok(()), - Some(status) => Err(Box::new(VectorSinkError::Health { + Ok(response) => match proto::ServingStatus::try_from(response.into_inner().status) { + Ok(proto::ServingStatus::Serving) => Ok(()), + Ok(status) => Err(Box::new(VectorSinkError::Health { status: Some(status.as_str_name()), })), - None => Err(Box::new(VectorSinkError::Health { status: None })), + Err(_) => Err(Box::new(VectorSinkError::Health { status: None })), }, Err(source) => Err(Box::new(VectorSinkError::Request { source })), } diff --git a/src/sources/datadog_agent/metrics.rs b/src/sources/datadog_agent/metrics.rs index d4e8260b1b937..73064da1f671f 100644 --- a/src/sources/datadog_agent/metrics.rs +++ b/src/sources/datadog_agent/metrics.rs @@ -256,8 +256,8 @@ pub(crate) fn decode_ddseries_v2( .then(|| tags.replace("source_type_name".into(), serie.source_type_name)); // As per https://github.com/DataDog/datadog-agent/blob/a62ac9fb13e1e5060b89e731b8355b2b20a07c5b/pkg/serializer/internal/metrics/iterable_series.go#L224 // serie.unit is omitted - match metric_payload::MetricType::from_i32(serie.r#type) { - Some(metric_payload::MetricType::Count) => serie + match metric_payload::MetricType::try_from(serie.r#type) { + Ok(metric_payload::MetricType::Count) => serie .points .iter() .map(|dd_point| { @@ -277,7 +277,7 @@ pub(crate) fn decode_ddseries_v2( .with_namespace(namespace) }) .collect::>(), - Some(metric_payload::MetricType::Gauge) => serie + Ok(metric_payload::MetricType::Gauge) => serie .points .iter() .map(|dd_point| { @@ -297,7 +297,7 @@ pub(crate) fn decode_ddseries_v2( .with_namespace(namespace) }) .collect::>(), - Some(metric_payload::MetricType::Rate) => serie + Ok(metric_payload::MetricType::Rate) => serie .points .iter() .map(|dd_point| { @@ -323,7 +323,7 @@ pub(crate) fn decode_ddseries_v2( .with_namespace(namespace) }) .collect::>(), - Some(metric_payload::MetricType::Unspecified) | None => { + Ok(metric_payload::MetricType::Unspecified) | Err(_) => { warn!("Unspecified metric type ({}).", serie.r#type); Vec::new() }