diff --git a/Cargo.lock b/Cargo.lock index fe4fb8d99e00a..63f9d687bbb5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10748,7 +10748,7 @@ dependencies = [ [[package]] name = "vector" -version = "0.43.0" +version = "0.43.1" dependencies = [ "apache-avro", "approx", @@ -11320,9 +11320,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "vrl" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c66f9aa77c64c2f05d8786763098171f8631b736778c922ace99333b909781" +checksum = "ea6f5f954461e21cacc090537e49f1023c34b6d10e12030b40ca1821a43aca68" dependencies = [ "aes", "aes-siv", diff --git a/Cargo.toml b/Cargo.toml index b9dc4e0f38f5e..03dd78a1180d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vector" -version = "0.43.0" +version = "0.43.1" authors = ["Vector Contributors "] edition = "2021" description = "A lightweight and ultra-fast tool for building observability pipelines" @@ -164,7 +164,7 @@ vector-lib = { path = "lib/vector-lib", default-features = false, features = ["v vector-config = { path = "lib/vector-config" } vector-config-common = { path = "lib/vector-config-common" } vector-config-macros = { path = "lib/vector-config-macros" } -vrl = { version = "0.20.0", features = ["arbitrary", "cli", "test", "test_framework"] } +vrl = { version = "0.20.1", features = ["arbitrary", "cli", "test", "test_framework"] } [dependencies] pin-project.workspace = true diff --git a/distribution/install.sh b/distribution/install.sh index 740385a825990..6a5bab07df87d 100755 --- a/distribution/install.sh +++ b/distribution/install.sh @@ -13,7 +13,7 @@ set -u # If PACKAGE_ROOT is unset or empty, default it. PACKAGE_ROOT="${PACKAGE_ROOT:-"https://packages.timber.io/vector"}" # If VECTOR_VERSION is unset or empty, default it. -VECTOR_VERSION="${VECTOR_VERSION:-"0.43.0"}" +VECTOR_VERSION="${VECTOR_VERSION:-"0.43.1"}" _divider="--------------------------------------------------------------------------------" _prompt=">>>" _indent=" " diff --git a/lib/vector-core/src/event/util/log/all_fields.rs b/lib/vector-core/src/event/util/log/all_fields.rs index b051eeb012657..c04fc7bda2ee9 100644 --- a/lib/vector-core/src/event/util/log/all_fields.rs +++ b/lib/vector-core/src/event/util/log/all_fields.rs @@ -64,22 +64,22 @@ pub struct FieldsIter<'a> { path: Vec>, /// Treat array as a single value and don't traverse each element. skip_array_elements: bool, - /// Add quoting to field names containing periods. - quote_meta: bool, + /// Surround invalid fields with quotes to make them parsable. + quote_invalid_fields: bool, } impl<'a> FieldsIter<'a> { fn new( path_prefix: Option, fields: &'a ObjectMap, - quote_meta: bool, + quote_invalid_fields: bool, ) -> FieldsIter<'a> { FieldsIter { path_prefix, stack: vec![LeafIter::Map(fields.iter())], path: vec![], skip_array_elements: false, - quote_meta, + quote_invalid_fields, } } @@ -91,7 +91,7 @@ impl<'a> FieldsIter<'a> { stack: vec![LeafIter::Root((value, false))], path: vec![], skip_array_elements: false, - quote_meta: false, + quote_invalid_fields: true, } } @@ -101,7 +101,7 @@ impl<'a> FieldsIter<'a> { stack: vec![LeafIter::Map(fields.iter())], path: vec![], skip_array_elements: true, - quote_meta: false, + quote_invalid_fields: true, } } @@ -143,7 +143,7 @@ impl<'a> FieldsIter<'a> { match path_iter.next() { None => break res.into(), Some(PathComponent::Key(key)) => { - if self.quote_meta && !IS_VALID_PATH_SEGMENT.is_match(key) { + if self.quote_invalid_fields && !IS_VALID_PATH_SEGMENT.is_match(key) { res.push_str(&format!("\"{key}\"")); } else { res.push_str(key); diff --git a/src/internal_events/heartbeat.rs b/src/internal_events/heartbeat.rs index 17f3f91a2858f..4e71d8a45fd1a 100644 --- a/src/internal_events/heartbeat.rs +++ b/src/internal_events/heartbeat.rs @@ -1,5 +1,6 @@ use std::time::Instant; +use crate::built_info; use metrics::gauge; use vector_lib::internal_event::InternalEvent; @@ -12,5 +13,14 @@ impl InternalEvent for Heartbeat { fn emit(self) { trace!(target: "vector", message = "Beep."); gauge!("uptime_seconds").set(self.since.elapsed().as_secs() as f64); + gauge!( + "build_info", + "debug" => built_info::DEBUG, + "version" => built_info::PKG_VERSION, + "rust_version" => built_info::RUST_VERSION, + "arch" => built_info::TARGET_ARCH, + "revision" => built_info::VECTOR_BUILD_DESC.unwrap_or("") + ) + .set(1.0); } } diff --git a/src/internal_events/process.rs b/src/internal_events/process.rs index 04ac6c32e877e..5a54154eca849 100644 --- a/src/internal_events/process.rs +++ b/src/internal_events/process.rs @@ -1,5 +1,4 @@ use metrics::counter; -use metrics::gauge; use vector_lib::internal_event::InternalEvent; use vector_lib::internal_event::{error_stage, error_type}; @@ -18,15 +17,6 @@ impl InternalEvent for VectorStarted { arch = built_info::TARGET_ARCH, revision = built_info::VECTOR_BUILD_DESC.unwrap_or(""), ); - gauge!( - "build_info", - "debug" => built_info::DEBUG, - "version" => built_info::PKG_VERSION, - "rust_version" => built_info::RUST_VERSION, - "arch" => built_info::TARGET_ARCH, - "revision" => built_info::VECTOR_BUILD_DESC.unwrap_or("") - ) - .set(1.0); counter!("started_total").increment(1); } } diff --git a/src/transforms/reduce/transform.rs b/src/transforms/reduce/transform.rs index eba1f22637f75..bb9cef48666a8 100644 --- a/src/transforms/reduce/transform.rs +++ b/src/transforms/reduce/transform.rs @@ -995,4 +995,40 @@ merge_strategies.bar = "concat" }) .await } + + #[tokio::test] + async fn merged_quoted_path() { + let config = toml::from_str::(indoc!( + r#" + [ends_when] + type = "vrl" + source = "exists(.test_end)" + "#, + )) + .unwrap(); + + assert_transform_compliance(async move { + let (tx, rx) = mpsc::channel(1); + + let (topology, mut out) = create_topology(ReceiverStream::new(rx), config).await; + + let e_1 = LogEvent::from(Value::from(btreemap! {"a b" => 1})); + tx.send(e_1.into()).await.unwrap(); + + let e_2 = LogEvent::from(Value::from(btreemap! {"a b" => 2, "test_end" => "done"})); + tx.send(e_2.into()).await.unwrap(); + + let output = out.recv().await.unwrap().into_log(); + let expected_value = Value::from(btreemap! { + "a b" => 3, + "test_end" => "done" + }); + assert_eq!(*output.value(), expected_value); + + drop(tx); + topology.stop().await; + assert_eq!(out.recv().await, None); + }) + .await + } } diff --git a/website/content/en/releases/0.43.1.md b/website/content/en/releases/0.43.1.md new file mode 100644 index 0000000000000..2e20695080e3c --- /dev/null +++ b/website/content/en/releases/0.43.1.md @@ -0,0 +1,4 @@ +--- +title: Vector v0.43.1 release notes +weight: 21 +--- diff --git a/website/cue/reference/releases/0.43.1.cue b/website/cue/reference/releases/0.43.1.cue new file mode 100644 index 0000000000000..f091394a83c49 --- /dev/null +++ b/website/cue/reference/releases/0.43.1.cue @@ -0,0 +1,41 @@ +package metadata + +releases: "0.43.1": { + date: "2024-12-10" + codename: "" + + whats_next: [] + + description: """ + This patch release contains fixes for regressions in 0.43.0. + """ + + changelog: [ + { + type: "fix" + description: """ + Update to VRL v0.20.1 which a reverts to previous `to_float` behavior for non-normal floats. + """ + contributors: ["pront"] + }, + { + type: "fix" + description: """ + Emit `build_info` gauge on an interval to avoid expiration. + """ + contributors: ["jszwedko"] + }, + { + type: "fix" + description: """ + Fix `reduce` transform to quote invalid paths by default. Quoting make those paths valid. + """ + contributors: ["pront"] + }, + ] + + commits: [ + {sha: "ca3abef14605dfbdca6060bbcd038fd7abfec6f0", date: "2024-12-09 23:11:21 UTC", description: "enable quoting for invalid fields", pr_number: 21989, scopes: ["reduce transform"], type: "fix", breaking_change: false, author: "Pavlos Rontidis", files_count: 3, insertions_count: 46, deletions_count: 7}, + {sha: "43b8916fa5b381cc90a22c787a574c8fc75550b5", date: "2024-12-10 08:25:25 UTC", description: "Emit `build_info` gauge on an interval", pr_number: 21991, scopes: ["internal_metrics source"], type: "fix", breaking_change: false, author: "Jesse Szwedko", files_count: 3, insertions_count: 13, deletions_count: 10}, + ] +} diff --git a/website/cue/reference/versions.cue b/website/cue/reference/versions.cue index d9c536cd252cf..29ea408e212d2 100644 --- a/website/cue/reference/versions.cue +++ b/website/cue/reference/versions.cue @@ -2,6 +2,7 @@ package metadata // This has to be maintained manually because there's currently no way to sort versions programmatically versions: [string, ...string] & [ + "0.43.1", "0.43.0", "0.42.0", "0.41.1",