From aadde5f1523b77499a59d4b99c25fbd57da12c76 Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Mon, 30 Oct 2023 10:25:57 -0600 Subject: [PATCH] chore(dev): Add wrapper for `enrichment` to `vector-lib` (#18977) --- Cargo.lock | 2 +- Cargo.toml | 1 - lib/vector-lib/Cargo.toml | 1 + lib/vector-lib/src/lib.rs | 1 + src/conditions/datadog_search.rs | 5 +++- src/conditions/mod.rs | 15 +++++++++--- src/conditions/vrl.rs | 7 ++++-- src/config/enrichment_table.rs | 2 +- src/config/graph.rs | 2 +- src/config/transform.rs | 6 ++--- src/enrichment_tables/file.rs | 4 ++-- src/enrichment_tables/geoip.rs | 4 ++-- src/enrichment_tables/mod.rs | 2 +- src/test_util/mock/transforms/basic.rs | 2 +- .../mock/transforms/error_definitions.rs | 2 +- src/test_util/mock/transforms/noop.rs | 2 +- src/topology/builder.rs | 15 +++++++----- src/topology/schema.rs | 18 +++++++------- src/transforms/aggregate.rs | 2 +- src/transforms/aws_ec2_metadata.rs | 4 ++-- src/transforms/dedupe.rs | 2 +- src/transforms/filter.rs | 2 +- src/transforms/log_to_metric.rs | 2 +- src/transforms/lua/mod.rs | 2 +- src/transforms/metric_to_log.rs | 2 +- src/transforms/reduce/mod.rs | 8 +++---- src/transforms/remap.rs | 24 +++++++++---------- src/transforms/route.rs | 2 +- src/transforms/sample.rs | 2 +- .../tag_cardinality_limit/config.rs | 2 +- src/transforms/throttle.rs | 2 +- 31 files changed, 83 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cef324956732e7..06714ca4c8f0b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9746,7 +9746,6 @@ dependencies = [ "dnsmsg-parser", "dyn-clone", "encoding_rs", - "enrichment", "enum_dispatch", "exitcode", "fakedata", @@ -10120,6 +10119,7 @@ name = "vector-lib" version = "0.1.0" dependencies = [ "codecs", + "enrichment", "vector-buffers", "vector-common", "vector-config", diff --git a/Cargo.toml b/Cargo.toml index be124a35f62916..03c7bb28096c3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,7 +130,6 @@ pin-project.workspace = true # Internal libs dnsmsg-parser = { path = "lib/dnsmsg-parser", optional = true } -enrichment = { path = "lib/enrichment" } fakedata = { path = "lib/fakedata", optional = true } file-source = { path = "lib/file-source", optional = true } lookup = { package = "vector-lookup", path = "lib/vector-lookup" } diff --git a/lib/vector-lib/Cargo.toml b/lib/vector-lib/Cargo.toml index 9874802a9df604..65448d4eb09200 100644 --- a/lib/vector-lib/Cargo.toml +++ b/lib/vector-lib/Cargo.toml @@ -7,6 +7,7 @@ publish = false [dependencies] codecs = { path = "../codecs", default-features = false } +enrichment = { path = "../enrichment" } vector-buffers = { path = "../vector-buffers", default-features = false } vector-common = { path = "../vector-common" } vector-config = { path = "../vector-config" } diff --git a/lib/vector-lib/src/lib.rs b/lib/vector-lib/src/lib.rs index f2ac241a2766ec..83bd6d7a35086a 100644 --- a/lib/vector-lib/src/lib.rs +++ b/lib/vector-lib/src/lib.rs @@ -1,4 +1,5 @@ pub use codecs; +pub use enrichment; pub use vector_buffers as buffers; pub use vector_common::{ assert_event_data_eq, btreemap, byte_size_of, byte_size_of::ByteSizeOf, conversion, diff --git a/src/conditions/datadog_search.rs b/src/conditions/datadog_search.rs index d5f1ddcdd25133..d192f9b9104365 100644 --- a/src/conditions/datadog_search.rs +++ b/src/conditions/datadog_search.rs @@ -38,7 +38,10 @@ impl Conditional for DatadogSearchRunner { } impl ConditionalConfig for DatadogSearchConfig { - fn build(&self, _enrichment_tables: &enrichment::TableRegistry) -> crate::Result { + fn build( + &self, + _enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) -> crate::Result { let node = parse(&self.source)?; let matcher = as_log(build_matcher(&node, &EventFilter)); diff --git a/src/conditions/mod.rs b/src/conditions/mod.rs index f1dc829daf42a0..8c5244e47cb149 100644 --- a/src/conditions/mod.rs +++ b/src/conditions/mod.rs @@ -116,7 +116,10 @@ pub enum ConditionConfig { } impl ConditionConfig { - pub fn build(&self, enrichment_tables: &enrichment::TableRegistry) -> crate::Result { + pub fn build( + &self, + enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) -> crate::Result { match self { ConditionConfig::IsLog => Ok(Condition::IsLog), ConditionConfig::IsMetric => Ok(Condition::IsMetric), @@ -148,7 +151,10 @@ pub trait Conditional: std::fmt::Debug { } pub trait ConditionalConfig: std::fmt::Debug + Send + Sync + dyn_clone::DynClone { - fn build(&self, enrichment_tables: &enrichment::TableRegistry) -> crate::Result; + fn build( + &self, + enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) -> crate::Result; } dyn_clone::clone_trait_object!(ConditionalConfig); @@ -184,7 +190,10 @@ pub enum AnyCondition { } impl AnyCondition { - pub fn build(&self, enrichment_tables: &enrichment::TableRegistry) -> crate::Result { + pub fn build( + &self, + enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) -> crate::Result { match self { AnyCondition::String(s) => { let vrl_config = VrlConfig { diff --git a/src/conditions/vrl.rs b/src/conditions/vrl.rs index 16cae9bff60061..a2ad30bcf68cce 100644 --- a/src/conditions/vrl.rs +++ b/src/conditions/vrl.rs @@ -30,7 +30,10 @@ pub struct VrlConfig { impl_generate_config_from_default!(VrlConfig); impl ConditionalConfig for VrlConfig { - fn build(&self, enrichment_tables: &enrichment::TableRegistry) -> crate::Result { + fn build( + &self, + enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) -> crate::Result { // TODO(jean): re-add this to VRL // let constraint = TypeConstraint { // allow_any: false, @@ -43,7 +46,7 @@ impl ConditionalConfig for VrlConfig { let functions = vrl::stdlib::all() .into_iter() - .chain(enrichment::vrl_functions()) + .chain(vector_lib::enrichment::vrl_functions()) .chain(vector_vrl_functions::all()) .collect::>(); diff --git a/src/config/enrichment_table.rs b/src/config/enrichment_table.rs index 4810638df83cab..7052b82005b68b 100644 --- a/src/config/enrichment_table.rs +++ b/src/config/enrichment_table.rs @@ -37,5 +37,5 @@ pub trait EnrichmentTableConfig: NamedComponent + core::fmt::Debug + Send + Sync async fn build( &self, globals: &GlobalOptions, - ) -> crate::Result>; + ) -> crate::Result>; } diff --git a/src/config/graph.rs b/src/config/graph.rs index bf54d316048703..dc73ad2dfa322e 100644 --- a/src/config/graph.rs +++ b/src/config/graph.rs @@ -77,7 +77,7 @@ impl Graph { Node::Transform { in_ty: transform.inner.input().data_type(), outputs: transform.inner.outputs( - enrichment::TableRegistry::default(), + vector_lib::enrichment::TableRegistry::default(), &[(id.into(), schema::Definition::any())], schema.log_namespace(), ), diff --git a/src/config/transform.rs b/src/config/transform.rs index ce5a63eeb90094..b5cfdedeb08804 100644 --- a/src/config/transform.rs +++ b/src/config/transform.rs @@ -105,7 +105,7 @@ pub struct TransformContext { pub globals: GlobalOptions, - pub enrichment_tables: enrichment::TableRegistry, + pub enrichment_tables: vector_lib::enrichment::TableRegistry, /// Tracks the schema IDs assigned to schemas exposed by the transform. /// @@ -193,7 +193,7 @@ pub trait TransformConfig: DynClone + NamedComponent + core::fmt::Debug + Send + /// of events flowing through the transform. fn outputs( &self, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], // This only exists for transforms that create logs from non-logs, to know which namespace @@ -250,7 +250,7 @@ pub fn get_transform_output_ids( ) -> impl Iterator + '_ { transform .outputs( - enrichment::TableRegistry::default(), + vector_lib::enrichment::TableRegistry::default(), &[(key.clone().into(), schema::Definition::any())], global_log_namespace, ) diff --git a/src/enrichment_tables/file.rs b/src/enrichment_tables/file.rs index 462d40f93c14e9..c63993084897f3 100644 --- a/src/enrichment_tables/file.rs +++ b/src/enrichment_tables/file.rs @@ -8,9 +8,9 @@ use std::{ }; use bytes::Bytes; -use enrichment::{Case, Condition, IndexHandle, Table}; use tracing::trace; use vector_lib::configurable::configurable_component; +use vector_lib::enrichment::{Case, Condition, IndexHandle, Table}; use vector_lib::{conversion::Conversion, TimeZone}; use vrl::value::Value; @@ -250,7 +250,7 @@ impl EnrichmentTableConfig for FileConfig { impl_generate_config_from_default!(FileConfig); -/// A struct that implements [enrichment::Table] to handle loading enrichment data from a CSV file. +/// A struct that implements [vector_lib::enrichment::Table] to handle loading enrichment data from a CSV file. #[derive(Clone)] pub struct File { config: FileConfig, diff --git a/src/enrichment_tables/geoip.rs b/src/enrichment_tables/geoip.rs index 10847945b5e4b5..1443c4252f72ce 100644 --- a/src/enrichment_tables/geoip.rs +++ b/src/enrichment_tables/geoip.rs @@ -13,8 +13,8 @@ use maxminddb::{ use ordered_float::NotNan; use vrl::value::Value; -use enrichment::{Case, Condition, IndexHandle, Table}; use vector_lib::configurable::configurable_component; +use vector_lib::enrichment::{Case, Condition, IndexHandle, Table}; use crate::config::{EnrichmentTableConfig, GenerateConfig}; @@ -101,7 +101,7 @@ impl EnrichmentTableConfig for GeoipConfig { } #[derive(Clone)] -/// A struct that implements [enrichment::Table] to handle loading enrichment data from a GeoIP database. +/// A struct that implements [vector_lib::enrichment::Table] to handle loading enrichment data from a GeoIP database. pub struct Geoip { config: GeoipConfig, dbreader: Arc>>, diff --git a/src/enrichment_tables/mod.rs b/src/enrichment_tables/mod.rs index de1f514d24e126..15ec912d911beb 100644 --- a/src/enrichment_tables/mod.rs +++ b/src/enrichment_tables/mod.rs @@ -1,7 +1,7 @@ //! Functionality to handle enrichment tables. -pub use enrichment::{Condition, IndexHandle, Table}; use enum_dispatch::enum_dispatch; use vector_lib::configurable::{configurable_component, NamedComponent}; +pub use vector_lib::enrichment::{Condition, IndexHandle, Table}; use crate::config::{EnrichmentTableConfig, GlobalOptions}; diff --git a/src/test_util/mock/transforms/basic.rs b/src/test_util/mock/transforms/basic.rs index 37f12912301520..e6b9ba6bdad622 100644 --- a/src/test_util/mock/transforms/basic.rs +++ b/src/test_util/mock/transforms/basic.rs @@ -51,7 +51,7 @@ impl TransformConfig for BasicTransformConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/test_util/mock/transforms/error_definitions.rs b/src/test_util/mock/transforms/error_definitions.rs index b3062ab1280e2e..af739cd31b3ba9 100644 --- a/src/test_util/mock/transforms/error_definitions.rs +++ b/src/test_util/mock/transforms/error_definitions.rs @@ -32,7 +32,7 @@ impl TransformConfig for ErrorDefinitionTransformConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, definitions: &[(OutputId, Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/test_util/mock/transforms/noop.rs b/src/test_util/mock/transforms/noop.rs index a9285a28b7cbd2..630cd3af899191 100644 --- a/src/test_util/mock/transforms/noop.rs +++ b/src/test_util/mock/transforms/noop.rs @@ -41,7 +41,7 @@ impl TransformConfig for NoopTransformConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, definitions: &[(OutputId, Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/topology/builder.rs b/src/topology/builder.rs index 73ece17c2fa113..c6d41d433189f5 100644 --- a/src/topology/builder.rs +++ b/src/topology/builder.rs @@ -55,8 +55,8 @@ use crate::{ SourceSender, }; -static ENRICHMENT_TABLES: Lazy = - Lazy::new(enrichment::TableRegistry::default); +static ENRICHMENT_TABLES: Lazy = + Lazy::new(vector_lib::enrichment::TableRegistry::default); pub(crate) static SOURCE_SENDER_BUFFER_SIZE: Lazy = Lazy::new(|| *TRANSFORM_CONCURRENCY_LIMIT * CHUNK_SIZE); @@ -149,7 +149,7 @@ impl<'a> Builder<'a> { /// Loads, or reloads the enrichment tables. /// The tables are stored in the `ENRICHMENT_TABLES` global variable. - async fn load_enrichment_tables(&mut self) -> &'static enrichment::TableRegistry { + async fn load_enrichment_tables(&mut self) -> &'static vector_lib::enrichment::TableRegistry { let mut enrichment_tables = HashMap::new(); // Build enrichment tables @@ -389,7 +389,10 @@ impl<'a> Builder<'a> { source_tasks } - async fn build_transforms(&mut self, enrichment_tables: &enrichment::TableRegistry) { + async fn build_transforms( + &mut self, + enrichment_tables: &vector_lib::enrichment::TableRegistry, + ) { let mut definition_cache = HashMap::default(); for (key, transform) in self @@ -490,7 +493,7 @@ impl<'a> Builder<'a> { } } - async fn build_sinks(&mut self, enrichment_tables: &enrichment::TableRegistry) { + async fn build_sinks(&mut self, enrichment_tables: &vector_lib::enrichment::TableRegistry) { for (key, sink) in self .config .sinks() @@ -716,7 +719,7 @@ struct TransformNode { impl TransformNode { pub fn from_parts( key: ComponentKey, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, transform: &TransformOuter, schema_definition: &[(OutputId, Definition)], global_log_namespace: LogNamespace, diff --git a/src/topology/schema.rs b/src/topology/schema.rs index 47380fbf13e94c..ca7fc00040a598 100644 --- a/src/topology/schema.rs +++ b/src/topology/schema.rs @@ -22,7 +22,7 @@ type Cache = HashMap<(bool, Vec), Vec<(OutputId, Definition)>>; pub fn possible_definitions( inputs: &[OutputId], config: &dyn ComponentContainer, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, cache: &mut Cache, ) -> Result, Error> { if inputs.is_empty() { @@ -109,7 +109,7 @@ pub fn possible_definitions( /// 5` being expanded into two individual routes (So1 -> T3 -> T5 -> Si1 AND So1 -> T4 -> T5 -> /// Si1). pub(super) fn expanded_definitions( - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, inputs: &[OutputId], config: &dyn ComponentContainer, cache: &mut Cache, @@ -210,7 +210,7 @@ pub(super) fn expanded_definitions( pub(crate) fn input_definitions( inputs: &[OutputId], config: &Config, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, cache: &mut Cache, ) -> Result, Error> { if inputs.is_empty() { @@ -301,7 +301,7 @@ pub(super) fn validate_sink_expectations( key: &ComponentKey, sink: &SinkOuter, config: &topology::Config, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, ) -> Result<(), Vec> { let mut errors = vec![]; @@ -352,7 +352,7 @@ pub trait ComponentContainer { fn transform_outputs( &self, key: &ComponentKey, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, Definition)], ) -> Option>; @@ -365,7 +365,7 @@ pub trait ComponentContainer { &self, key: &ComponentKey, port: &Option, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, Definition)], ) -> Result, ()> { if let Some(outputs) = self.transform_outputs(key, enrichment_tables, input_definitions) { @@ -424,7 +424,7 @@ impl ComponentContainer for Config { fn transform_outputs( &self, key: &ComponentKey, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, Definition)], ) -> Option> { self.transform(key).map(|source| { @@ -474,7 +474,7 @@ mod tests { fn transform_outputs( &self, key: &ComponentKey, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, _: &[(OutputId, Definition)], ) -> Option> { self.transforms.get(key.id()).cloned().map(|v| v.1) @@ -818,7 +818,7 @@ mod tests { .collect::>(); let got = expanded_definitions( - enrichment::TableRegistry::default(), + vector_lib::enrichment::TableRegistry::default(), &inputs, &case, &mut HashMap::default(), diff --git a/src/transforms/aggregate.rs b/src/transforms/aggregate.rs index 8255eb4f45f9dc..a3a1b1e11c2df5 100644 --- a/src/transforms/aggregate.rs +++ b/src/transforms/aggregate.rs @@ -49,7 +49,7 @@ impl TransformConfig for AggregateConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, _: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/aws_ec2_metadata.rs b/src/transforms/aws_ec2_metadata.rs index 56ea9a0b92e457..4ff5d3a3b604c8 100644 --- a/src/transforms/aws_ec2_metadata.rs +++ b/src/transforms/aws_ec2_metadata.rs @@ -247,7 +247,7 @@ impl TransformConfig for Ec2Metadata { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { @@ -719,8 +719,8 @@ mod test { use crate::config::schema::Definition; use crate::config::{LogNamespace, OutputId, TransformConfig}; use crate::transforms::aws_ec2_metadata::Ec2Metadata; - use enrichment::TableRegistry; use lookup::OwnedTargetPath; + use vector_lib::enrichment::TableRegistry; use vrl::owned_value_path; use vrl::value::Kind; diff --git a/src/transforms/dedupe.rs b/src/transforms/dedupe.rs index a159998d8c8ff1..1d09059b4efbd7 100644 --- a/src/transforms/dedupe.rs +++ b/src/transforms/dedupe.rs @@ -160,7 +160,7 @@ impl TransformConfig for DedupeConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/filter.rs b/src/transforms/filter.rs index 2c431f06cc3a87..c2f18bda254565 100644 --- a/src/transforms/filter.rs +++ b/src/transforms/filter.rs @@ -53,7 +53,7 @@ impl TransformConfig for FilterConfig { fn outputs( &self, - _enrichment_tables: enrichment::TableRegistry, + _enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/log_to_metric.rs b/src/transforms/log_to_metric.rs index b2448dde6ae078..7b549d1815c0fb 100644 --- a/src/transforms/log_to_metric.rs +++ b/src/transforms/log_to_metric.rs @@ -165,7 +165,7 @@ impl TransformConfig for LogToMetricConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, _: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/lua/mod.rs b/src/transforms/lua/mod.rs index e6fd152bfaf969..c3b6682dad1413 100644 --- a/src/transforms/lua/mod.rs +++ b/src/transforms/lua/mod.rs @@ -109,7 +109,7 @@ impl TransformConfig for LuaConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/metric_to_log.rs b/src/transforms/metric_to_log.rs index 0b4e00332032e1..130a5384155c09 100644 --- a/src/transforms/metric_to_log.rs +++ b/src/transforms/metric_to_log.rs @@ -99,7 +99,7 @@ impl TransformConfig for MetricToLogConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, Definition)], global_log_namespace: LogNamespace, ) -> Vec { diff --git a/src/transforms/reduce/mod.rs b/src/transforms/reduce/mod.rs index 957983188a47ea..2270da1bb7b8ba 100644 --- a/src/transforms/reduce/mod.rs +++ b/src/transforms/reduce/mod.rs @@ -129,7 +129,7 @@ impl TransformConfig for ReduceConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { @@ -319,7 +319,7 @@ pub struct Reduce { impl Reduce { pub fn new( config: &ReduceConfig, - enrichment_tables: &enrichment::TableRegistry, + enrichment_tables: &vector_lib::enrichment::TableRegistry, ) -> crate::Result { if config.ends_when.is_some() && config.starts_when.is_some() { return Err("only one of `ends_when` and `starts_when` can be provided".into()); @@ -466,11 +466,11 @@ impl TaskTransform for Reduce { #[cfg(test)] mod test { - use enrichment::TableRegistry; use serde_json::json; use std::sync::Arc; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; + use vector_lib::enrichment::TableRegistry; use vrl::value::Kind; use super::*; @@ -514,7 +514,7 @@ group_by = [ "request_id" ] ); let schema_definitions = reduce_config .outputs( - enrichment::TableRegistry::default(), + vector_lib::enrichment::TableRegistry::default(), &[("test".into(), input_definition)], LogNamespace::Legacy, ) diff --git a/src/transforms/remap.rs b/src/transforms/remap.rs index f455780c1d2d96..88536c5380d338 100644 --- a/src/transforms/remap.rs +++ b/src/transforms/remap.rs @@ -140,7 +140,7 @@ pub struct RemapConfig { impl RemapConfig { fn compile_vrl_program( &self, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, merged_schema_definition: schema::Definition, ) -> Result<(Program, String, Vec>, CompileConfig)> { let source = match (&self.source, &self.file) { @@ -159,7 +159,7 @@ impl RemapConfig { }; let mut functions = vrl::stdlib::all(); - functions.append(&mut enrichment::vrl_functions()); + functions.append(&mut vector_lib::enrichment::vrl_functions()); functions.append(&mut vector_vrl_functions::all()); let state = TypeState { @@ -222,7 +222,7 @@ impl TransformConfig for RemapConfig { fn outputs( &self, - enrichment_tables: enrichment::TableRegistry, + enrichment_tables: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { @@ -627,9 +627,9 @@ mod tests { transforms::OutputBuffer, }; use chrono::DateTime; - use enrichment::TableRegistry; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; + use vector_lib::enrichment::TableRegistry; fn test_default_schema_definition() -> schema::Definition { schema::Definition::empty_legacy_namespace().with_event_field( @@ -1443,7 +1443,7 @@ mod tests { assert_eq!( conf.outputs( - enrichment::TableRegistry::default(), + vector_lib::enrichment::TableRegistry::default(), &[( "test".into(), schema::Definition::new_with_default_metadata( @@ -1606,7 +1606,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables.clone(), @@ -1679,7 +1679,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables.clone(), @@ -1760,7 +1760,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables, @@ -1803,7 +1803,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables, @@ -1834,7 +1834,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables, @@ -1877,7 +1877,7 @@ mod tests { ..Default::default() }; - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = transform1.outputs( enrichment_tables, @@ -1941,7 +1941,7 @@ mod tests { // Legacy namespace nests this under "message", Vector should set it as the root assert_eq!(result.as_log().get("."), Some(&Value::Null)); - let enrichment_tables = enrichment::TableRegistry::default(); + let enrichment_tables = vector_lib::enrichment::TableRegistry::default(); let outputs1 = conf.outputs( enrichment_tables, &[( diff --git a/src/transforms/route.rs b/src/transforms/route.rs index c1f17345f45843..2959317beeb8f6 100644 --- a/src/transforms/route.rs +++ b/src/transforms/route.rs @@ -120,7 +120,7 @@ impl TransformConfig for RouteConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/sample.rs b/src/transforms/sample.rs index 240cf03108f225..859f3c79146d8c 100644 --- a/src/transforms/sample.rs +++ b/src/transforms/sample.rs @@ -78,7 +78,7 @@ impl TransformConfig for SampleConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/tag_cardinality_limit/config.rs b/src/transforms/tag_cardinality_limit/config.rs index 4864fc2abc6cca..5c7cbe401f9e13 100644 --- a/src/transforms/tag_cardinality_limit/config.rs +++ b/src/transforms/tag_cardinality_limit/config.rs @@ -115,7 +115,7 @@ impl TransformConfig for TagCardinalityLimitConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, _: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec { diff --git a/src/transforms/throttle.rs b/src/transforms/throttle.rs index c1e12e0fd5eaaf..721509f3b4038b 100644 --- a/src/transforms/throttle.rs +++ b/src/transforms/throttle.rs @@ -60,7 +60,7 @@ impl TransformConfig for ThrottleConfig { fn outputs( &self, - _: enrichment::TableRegistry, + _: vector_lib::enrichment::TableRegistry, input_definitions: &[(OutputId, schema::Definition)], _: LogNamespace, ) -> Vec {