diff --git a/Cargo.lock b/Cargo.lock index 4c9f0d84abbc3..dd31764fa86eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3218,12 +3218,16 @@ dependencies = [ [[package]] name = "domain" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84070523f8ba0f9127ff156920f27eb27b302b425efe60bf5f41ec244d1c60" +checksum = "a11dd7f04a6a6d2aea0153c6e31f5ea7af8b2efdf52cdaeea7a9a592c7fefef9" dependencies = [ + "bumpalo", "bytes 1.10.1", + "domain-macros", "futures-util", + "hashbrown 0.14.5", + "log", "moka", "octseq", "rand 0.8.5", @@ -3234,6 +3238,17 @@ dependencies = [ "tracing 0.1.41", ] +[[package]] +name = "domain-macros" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e197fdfd2cdb5fdeb7f8ddcf3aed5d5d04ecde2890d448b14ffb716f7376b70" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.102", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -4186,9 +4201,9 @@ dependencies = [ [[package]] name = "grok" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273797968160270573071022613fc4aa28b91fe68f3eef6c96a1b2a1947ddfbd" +checksum = "6c52724b609896f661a3f4641dd3a44dc602958ef615857c12d00756b4e9355b" dependencies = [ "glob", "onig", @@ -4708,7 +4723,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.4.10", "tokio", "tower-service", "tracing 0.1.41", @@ -6430,9 +6445,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -6821,11 +6836,11 @@ dependencies = [ [[package]] name = "onig" -version = "6.4.0" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "libc", "once_cell", "onig_sys", @@ -6833,9 +6848,9 @@ dependencies = [ [[package]] name = "onig_sys" -version = "69.8.1" +version = "69.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" dependencies = [ "cc", "pkg-config", @@ -7785,7 +7800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ "heck 0.5.0", - "itertools 0.14.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -7831,7 +7846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.10.5", "proc-macro2 1.0.95", "quote 1.0.40", "syn 2.0.102", @@ -9027,9 +9042,9 @@ dependencies = [ [[package]] name = "rustyline" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1e066dc922e513bda599c6ccb5f3bb2b0ea5870a579448f2622993f0a9a2f" +checksum = "62fd9ca5ebc709e8535e8ef7c658eb51457987e48c98ead2be482172accc408d" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -9037,7 +9052,7 @@ dependencies = [ "libc", "log", "memchr", - "nix 0.29.0", + "nix 0.30.1", "unicode-segmentation", "unicode-width 0.2.0", "utf8parse", @@ -12005,8 +12020,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "vrl" version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ceadaa40aef567a26079ff014ca7a567ba85344f1b81090b5ec7d7bb16a219" +source = "git+https://github.com/vectordotdev/vrl.git?branch=main#c45f0d7165e7f39a7b353dc8095565b3df9c073f" dependencies = [ "aes", "aes-siv", diff --git a/Cargo.toml b/Cargo.toml index 86e12671670dd..f622517aa2795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -174,7 +174,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 = { features = ["arbitrary", "cli", "test", "test_framework"], version = "0.24.0" } +vrl = { git = "https://github.com/vectordotdev/vrl.git", branch = "main", features = ["arbitrary", "cli", "test", "test_framework"] } [dependencies] cfg-if.workspace = true diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index ee87492b9319d..cd7ce1243f97c 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -267,7 +267,7 @@ graphql_client_codegen,https://github.com/graphql-rust/graphql-client,Apache-2.0 graphql_query_derive,https://github.com/graphql-rust/graphql-client,Apache-2.0 OR MIT,Tom Houlé greptime-proto,https://github.com/GreptimeTeam/greptime-proto,Apache-2.0,The greptime-proto Authors greptimedb-ingester,https://github.com/GreptimeTeam/greptimedb-ingester-rust,Apache-2.0,The greptimedb-ingester Authors -grok,https://github.com/daschl/grok,Apache-2.0,Michael Nitschinger +grok,https://github.com/mmastrac/grok,Apache-2.0,"Matt Mastracci , Michael Nitschinger " group,https://github.com/zkcrypto/group,MIT OR Apache-2.0,"Sean Bowe , Jack Grigg " h2,https://github.com/hyperium/h2,MIT,"Carl Lerche , Sean McArthur " half,https://github.com/starkat99/half-rs,MIT OR Apache-2.0,Kathryn Long @@ -434,7 +434,7 @@ object,https://github.com/gimli-rs/object,Apache-2.0 OR MIT,The object Authors octseq,https://github.com/NLnetLabs/octets/,BSD-3-Clause,NLnet Labs ofb,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Developers once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov -onig,http://github.com/iwillspeak/rust-onig,MIT,"Will Speak , Ivan Ivashchenko " +onig,https://github.com/iwillspeak/rust-onig,MIT,"Will Speak , Ivan Ivashchenko " opaque-debug,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto Developers opendal,https://github.com/apache/opendal,Apache-2.0,Apache OpenDAL openidconnect,https://github.com/ramosbugs/openidconnect-rs,MIT,David A. Ramos diff --git a/lib/vector-core/src/event/vrl_target.rs b/lib/vector-core/src/event/vrl_target.rs index d7243483693f5..ddb8507dce1e3 100644 --- a/lib/vector-core/src/event/vrl_target.rs +++ b/lib/vector-core/src/event/vrl_target.rs @@ -284,10 +284,7 @@ impl Target for VrlTarget { return Err(MetricPathError::SetPathError.to_string()); } - if let Some(paths) = path - .to_alternative_components(MAX_METRIC_PATH_DEPTH) - .first() - { + if let Some(paths) = path.to_alternative_components(MAX_METRIC_PATH_DEPTH) { match paths.as_slice() { ["tags"] => { let value = @@ -418,7 +415,6 @@ impl Target for VrlTarget { if let Some(paths) = target_path .path .to_alternative_components(MAX_METRIC_PATH_DEPTH) - .first() { let removed_value = match paths.as_slice() { ["namespace"] => metric.series.name.namespace.take().map(Into::into), @@ -447,10 +443,10 @@ impl Target for VrlTarget { value.remove(&target_path.path, false); - return Ok(removed_value); + Ok(removed_value) + } else { + Ok(None) } - - Ok(None) } }, PathPrefix::Metadata => Ok(self @@ -497,27 +493,25 @@ fn target_get_metric<'a>( let value = value.get(path); - for paths in path.to_alternative_components(MAX_METRIC_PATH_DEPTH) { - match paths.as_slice() { - ["name"] | ["kind"] | ["type"] | ["tags", _] => return Ok(value), - ["namespace"] | ["timestamp"] | ["interval_ms"] | ["tags"] => { - if let Some(value) = value { - return Ok(Some(value)); - } - } - _ => { - return Err(MetricPathError::InvalidPath { - path: &path.to_string(), - expected: VALID_METRIC_PATHS_GET, - } - .to_string()) - } + let Some(paths) = path.to_alternative_components(MAX_METRIC_PATH_DEPTH) else { + return Ok(None); + }; + + match paths.as_slice() { + ["name"] + | ["kind"] + | ["type"] + | ["tags", _] + | ["namespace"] + | ["timestamp"] + | ["interval_ms"] + | ["tags"] => Ok(value), + _ => Err(MetricPathError::InvalidPath { + path: &path.to_string(), + expected: VALID_METRIC_PATHS_GET, } + .to_string()), } - - // We only reach this point if we have requested a tag that doesn't exist or an empty - // field. - Ok(None) } fn target_get_mut_metric<'a>( @@ -530,27 +524,24 @@ fn target_get_mut_metric<'a>( let value = value.get_mut(path); - for paths in path.to_alternative_components(MAX_METRIC_PATH_DEPTH) { - match paths.as_slice() { - ["name"] | ["kind"] | ["tags", _] => return Ok(value), - ["namespace"] | ["timestamp"] | ["tags"] => { - if let Some(value) = value { - return Ok(Some(value)); - } - } - _ => { - return Err(MetricPathError::InvalidPath { - path: &path.to_string(), - expected: VALID_METRIC_PATHS_SET, - } - .to_string()) - } + let Some(paths) = path.to_alternative_components(MAX_METRIC_PATH_DEPTH) else { + return Ok(None); + }; + + match paths.as_slice() { + ["name"] + | ["kind"] + | ["tags", _] + | ["namespace"] + | ["timestamp"] + | ["interval_ms"] + | ["tags"] => Ok(value), + _ => Err(MetricPathError::InvalidPath { + path: &path.to_string(), + expected: VALID_METRIC_PATHS_SET, } + .to_string()), } - - // We only reach this point if we have requested a tag that doesn't exist or an empty - // field. - Ok(None) } /// pre-compute the `Value` structure of the metric.