diff --git a/Cargo.lock b/Cargo.lock index 389d7355930c5..6ab6f9f1eb7ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9866,11 +9866,11 @@ dependencies = [ "uuid", "vector-api-client", "vector-buffers", - "vector-common", "vector-config", "vector-config-common", "vector-config-macros", "vector-core", + "vector-lib", "vector-lookup", "vector-stream", "vector-vrl-functions", @@ -10114,6 +10114,13 @@ dependencies = [ "vrl", ] +[[package]] +name = "vector-lib" +version = "0.1.0" +dependencies = [ + "vector-common", +] + [[package]] name = "vector-lookup" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 3a5b607be302d..286900ecaf0ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,6 +109,7 @@ members = [ "lib/vector-config-common", "lib/vector-config-macros", "lib/vector-core", + "lib/vector-lib", "lib/vector-lookup", "lib/vector-stream", "lib/vector-vrl/cli", @@ -140,11 +141,11 @@ opentelemetry-proto = { path = "lib/opentelemetry-proto", optional = true } tracing-limit = { path = "lib/tracing-limit" } vector-api-client = { path = "lib/vector-api-client", optional = true } vector-buffers = { path = "lib/vector-buffers", default-features = false } -vector-common = { path = "lib/vector-common" } vector-config = { path = "lib/vector-config" } vector-config-common = { path = "lib/vector-config-common" } vector-config-macros = { path = "lib/vector-config-macros" } vector-core = { path = "lib/vector-core", default-features = false, features = ["vrl"] } +vector-lib = { path = "lib/vector-lib", default-features = false } vector-stream = { path = "lib/vector-stream" } vector-vrl-functions = { path = "lib/vector-vrl/functions" } loki-logproto = { path = "lib/loki-logproto", optional = true } diff --git a/lib/vector-core/src/config/output_id.rs b/lib/vector-core/src/config/output_id.rs index c4491e210a271..f2d8bc9d6b54d 100644 --- a/lib/vector-core/src/config/output_id.rs +++ b/lib/vector-core/src/config/output_id.rs @@ -2,7 +2,8 @@ use std::fmt; use vector_common::config::ComponentKey; -use crate::{config::configurable_component, schema}; +use super::configurable_component; +use crate::schema; /// Component output identifier. #[configurable_component] diff --git a/lib/vector-core/src/event/array.rs b/lib/vector-core/src/event/array.rs index f03d6393e8ac7..0519920ace4ff 100644 --- a/lib/vector-core/src/event/array.rs +++ b/lib/vector-core/src/event/array.rs @@ -9,6 +9,7 @@ use futures::{stream, Stream}; use quickcheck::{Arbitrary, Gen}; use vector_buffers::EventCount; use vector_common::{ + byte_size_of::ByteSizeOf, config::ComponentKey, finalization::{AddBatchNotifier, BatchNotifier, EventFinalizers, Finalizable}, json_size::JsonSize, @@ -18,7 +19,6 @@ use super::{ EstimatedJsonEncodedSizeOf, Event, EventDataEq, EventFinalizer, EventMutRef, EventRef, LogEvent, Metric, TraceEvent, }; -use crate::ByteSizeOf; /// The type alias for an array of `LogEvent` elements. pub type LogArray = Vec; diff --git a/lib/vector-core/src/event/log_event.rs b/lib/vector-core/src/event/log_event.rs index f27f2b7af64fb..25306f350b3ea 100644 --- a/lib/vector-core/src/event/log_event.rs +++ b/lib/vector-core/src/event/log_event.rs @@ -13,28 +13,29 @@ use std::{ use crossbeam_utils::atomic::AtomicCell; use lookup::lookup_v2::TargetPath; use lookup::PathPrefix; +use lookup::{metadata_path, path}; +use once_cell::sync::Lazy; use serde::{Deserialize, Serialize, Serializer}; use vector_common::{ + byte_size_of::ByteSizeOf, internal_event::{OptionalTag, TaggedEventsSent}, json_size::{JsonSize, NonZeroJsonSize}, request_metadata::GetEventCountTags, EventDataEq, }; use vrl::path::{parse_target_path, OwnedTargetPath, PathParseError}; +use vrl::{event_path, owned_value_path}; use super::{ estimated_json_encoded_size_of::EstimatedJsonEncodedSizeOf, finalization::{BatchNotifier, EventFinalizer}, metadata::EventMetadata, - util, EventFinalizers, Finalizable, Value, + util, + util::log::{all_fields, all_metadata_fields}, + EventFinalizers, Finalizable, MaybeAsLogMut, Value, }; use crate::config::LogNamespace; use crate::config::{log_schema, telemetry}; -use crate::event::util::log::{all_fields, all_metadata_fields}; -use crate::{event::MaybeAsLogMut, ByteSizeOf}; -use lookup::{metadata_path, path}; -use once_cell::sync::Lazy; -use vrl::{event_path, owned_value_path}; static VECTOR_SOURCE_TYPE_PATH: Lazy> = Lazy::new(|| { Some(OwnedTargetPath::metadata(owned_value_path!( diff --git a/lib/vector-core/src/event/lua/event.rs b/lib/vector-core/src/event/lua/event.rs index ded7dab1728ec..2e477d7568a99 100644 --- a/lib/vector-core/src/event/lua/event.rs +++ b/lib/vector-core/src/event/lua/event.rs @@ -1,7 +1,7 @@ use mlua::prelude::*; -use crate::event::lua::metric::LuaMetric; -use crate::event::{Event, LogEvent, Metric}; +use super::super::{Event, LogEvent, Metric}; +use super::metric::LuaMetric; pub struct LuaEvent { pub event: Event, diff --git a/lib/vector-core/src/event/lua/log.rs b/lib/vector-core/src/event/lua/log.rs index 8d05055ef1a3c..03c7855bc780f 100644 --- a/lib/vector-core/src/event/lua/log.rs +++ b/lib/vector-core/src/event/lua/log.rs @@ -1,6 +1,6 @@ use mlua::prelude::*; -use crate::event::{EventMetadata, LogEvent, Value}; +use super::super::{EventMetadata, LogEvent, Value}; impl<'a> IntoLua<'a> for LogEvent { #![allow(clippy::wrong_self_convention)] // this trait is defined by mlua diff --git a/lib/vector-core/src/event/lua/metric.rs b/lib/vector-core/src/event/lua/metric.rs index f1bdbb73e8344..6c062767cce64 100644 --- a/lib/vector-core/src/event/lua/metric.rs +++ b/lib/vector-core/src/event/lua/metric.rs @@ -2,15 +2,13 @@ use std::collections::BTreeMap; use mlua::prelude::*; -use super::util::{table_to_timestamp, timestamp_to_table}; -use crate::event::metric::TagValue; -use crate::{ - event::{ - metric::{self, MetricSketch, MetricTags, TagValueSet}, - Metric, MetricKind, MetricValue, StatisticKind, - }, - metrics::AgentDDSketch, +use super::super::{ + metric::TagValue, + metric::{self, MetricSketch, MetricTags, TagValueSet}, + Metric, MetricKind, MetricValue, StatisticKind, }; +use super::util::{table_to_timestamp, timestamp_to_table}; +use crate::metrics::AgentDDSketch; pub struct LuaMetric { pub metric: Metric, diff --git a/lib/vector-core/src/event/merge_state.rs b/lib/vector-core/src/event/merge_state.rs index 9f210e785e266..6c1322d93daba 100644 --- a/lib/vector-core/src/event/merge_state.rs +++ b/lib/vector-core/src/event/merge_state.rs @@ -1,4 +1,4 @@ -use crate::event::LogEvent; +use super::LogEvent; /// Encapsulates the inductive events merging algorithm. /// @@ -38,8 +38,7 @@ impl LogEventMergeState { #[cfg(test)] mod test { - use super::LogEventMergeState; - use crate::event::LogEvent; + use super::*; fn log_event_with_message(message: &str) -> LogEvent { LogEvent::from(message) diff --git a/lib/vector-core/src/event/metadata.rs b/lib/vector-core/src/event/metadata.rs index a9942fd64d65b..0030464ac06c5 100644 --- a/lib/vector-core/src/event/metadata.rs +++ b/lib/vector-core/src/event/metadata.rs @@ -3,7 +3,7 @@ use std::{borrow::Cow, collections::BTreeMap, fmt, sync::Arc}; use serde::{Deserialize, Serialize}; -use vector_common::{config::ComponentKey, EventDataEq}; +use vector_common::{byte_size_of::ByteSizeOf, config::ComponentKey, EventDataEq}; use vrl::{ compiler::SecretTarget, value::{Kind, Value}, @@ -12,7 +12,7 @@ use vrl::{ use super::{BatchNotifier, EventFinalizer, EventFinalizers, EventStatus}; use crate::{ config::{LogNamespace, OutputId}, - schema, ByteSizeOf, + schema, }; const DATADOG_API_KEY: &str = "datadog_api_key"; diff --git a/lib/vector-core/src/event/metric/mod.rs b/lib/vector-core/src/event/metric/mod.rs index f27c24ae119fb..d3a8b77756f48 100644 --- a/lib/vector-core/src/event/metric/mod.rs +++ b/lib/vector-core/src/event/metric/mod.rs @@ -12,6 +12,7 @@ use std::{ use chrono::{DateTime, Utc}; use vector_common::{ + byte_size_of::ByteSizeOf, internal_event::{OptionalTag, TaggedEventsSent}, json_size::JsonSize, request_metadata::GetEventCountTags, @@ -19,14 +20,11 @@ use vector_common::{ }; use vector_config::configurable_component; -use crate::{ - config::telemetry, - event::{ - estimated_json_encoded_size_of::EstimatedJsonEncodedSizeOf, BatchNotifier, EventFinalizer, - EventFinalizers, EventMetadata, Finalizable, - }, - ByteSizeOf, +use super::{ + estimated_json_encoded_size_of::EstimatedJsonEncodedSizeOf, BatchNotifier, EventFinalizer, + EventFinalizers, EventMetadata, Finalizable, }; +use crate::config::telemetry; #[cfg(any(test, feature = "test"))] mod arbitrary; diff --git a/lib/vector-core/src/event/metric/series.rs b/lib/vector-core/src/event/metric/series.rs index ac81389cd9de2..4c2da4a3c8988 100644 --- a/lib/vector-core/src/event/metric/series.rs +++ b/lib/vector-core/src/event/metric/series.rs @@ -1,10 +1,9 @@ use core::fmt; -use crate::event::metric::TagValue; use vector_common::byte_size_of::ByteSizeOf; use vector_config::configurable_component; -use super::{write_list, write_word, MetricTags}; +use super::{write_list, write_word, MetricTags, TagValue}; /// Metrics series. #[configurable_component] diff --git a/lib/vector-core/src/event/mod.rs b/lib/vector-core/src/event/mod.rs index 5bb7d144f91b2..3b9d237339268 100644 --- a/lib/vector-core/src/event/mod.rs +++ b/lib/vector-core/src/event/mod.rs @@ -1,7 +1,5 @@ use std::{collections::BTreeMap, convert::TryInto, fmt::Debug, sync::Arc}; -use crate::config::LogNamespace; -use crate::{config::OutputId, ByteSizeOf}; pub use array::{into_event_stream, EventArray, EventContainer, LogArray, MetricArray, TraceArray}; pub use estimated_json_encoded_size_of::EstimatedJsonEncodedSizeOf; pub use finalization::{ @@ -23,6 +21,9 @@ pub use vrl::value::Value; #[cfg(feature = "vrl")] pub use vrl_target::{TargetEvents, VrlTarget}; +use crate::config::LogNamespace; +use crate::{config::OutputId, ByteSizeOf}; + pub mod array; pub mod discriminant; mod estimated_json_encoded_size_of; diff --git a/lib/vector-core/src/event/proto.rs b/lib/vector-core/src/event/proto.rs index f5be0af1062f8..d767306343cb6 100644 --- a/lib/vector-core/src/event/proto.rs +++ b/lib/vector-core/src/event/proto.rs @@ -3,10 +3,8 @@ use std::sync::Arc; use chrono::TimeZone; use ordered_float::NotNan; -use crate::{ - event::{self, BTreeMap, MetricTags, WithMetadata}, - metrics::AgentDDSketch, -}; +use super::{BTreeMap, MetricTags, WithMetadata}; +use crate::metrics::AgentDDSketch; #[allow(warnings, clippy::all, clippy::pedantic)] mod proto_event { @@ -91,7 +89,7 @@ impl From for Event { } } -impl From for event::LogEvent { +impl From for super::LogEvent { fn from(log: Log) -> Self { #[allow(deprecated)] let metadata = log @@ -119,7 +117,7 @@ impl From for event::LogEvent { } } -impl From for event::TraceEvent { +impl From for super::TraceEvent { fn from(trace: Trace) -> Self { #[allow(deprecated)] let metadata = trace @@ -139,11 +137,11 @@ impl From for event::TraceEvent { .filter_map(|(k, v)| decode_value(v).map(|value| (k, value))) .collect::>(); - Self::from(event::LogEvent::from_map(fields, metadata)) + Self::from(super::LogEvent::from_map(fields, metadata)) } } -impl From for event::MetricValue { +impl From for super::MetricValue { fn from(value: MetricValue) -> Self { match value { MetricValue::Counter(counter) => Self::Counter { @@ -155,14 +153,14 @@ impl From for event::MetricValue { }, MetricValue::Distribution1(dist) => Self::Distribution { statistic: dist.statistic().into(), - samples: event::metric::zip_samples(dist.values, dist.sample_rates), + samples: super::metric::zip_samples(dist.values, dist.sample_rates), }, MetricValue::Distribution2(dist) => Self::Distribution { statistic: dist.statistic().into(), samples: dist.samples.into_iter().map(Into::into).collect(), }, MetricValue::AggregatedHistogram1(hist) => Self::AggregatedHistogram { - buckets: event::metric::zip_buckets( + buckets: super::metric::zip_buckets( hist.buckets, hist.counts.iter().map(|h| u64::from(*h)), ), @@ -180,7 +178,7 @@ impl From for event::MetricValue { sum: hist.sum, }, MetricValue::AggregatedSummary1(summary) => Self::AggregatedSummary { - quantiles: event::metric::zip_quantiles(summary.quantiles, summary.values), + quantiles: super::metric::zip_quantiles(summary.quantiles, summary.values), count: u64::from(summary.count), sum: summary.sum, }, @@ -203,11 +201,11 @@ impl From for event::MetricValue { } } -impl From for event::Metric { +impl From for super::Metric { fn from(metric: Metric) -> Self { let kind = match metric.kind() { - metric::Kind::Incremental => event::MetricKind::Incremental, - metric::Kind::Absolute => event::MetricKind::Absolute, + metric::Kind::Incremental => super::MetricKind::Incremental, + metric::Kind::Absolute => super::MetricKind::Absolute, }; let name = metric.name; @@ -231,7 +229,7 @@ impl From for event::Metric { values .values .into_iter() - .map(|value| event::metric::TagValue::from(value.value)) + .map(|value| super::metric::TagValue::from(value.value)) .collect(), ) }) @@ -243,7 +241,7 @@ impl From for event::Metric { tags.extend(metric.tags_v1); let tags = (!tags.is_empty()).then_some(tags); - let value = event::MetricValue::from(metric.value.unwrap()); + let value = super::MetricValue::from(metric.value.unwrap()); #[allow(deprecated)] let metadata = metric @@ -265,7 +263,7 @@ impl From for event::Metric { } } -impl From for event::Event { +impl From for super::Event { fn from(proto: EventWrapper) -> Self { let event = proto.event.unwrap(); @@ -277,20 +275,20 @@ impl From for event::Event { } } -impl From for Log { - fn from(log_event: event::LogEvent) -> Self { +impl From for Log { + fn from(log_event: super::LogEvent) -> Self { WithMetadata::::from(log_event).data } } -impl From for Trace { - fn from(trace: event::TraceEvent) -> Self { +impl From for Trace { + fn from(trace: super::TraceEvent) -> Self { WithMetadata::::from(trace).data } } -impl From for WithMetadata { - fn from(log_event: event::LogEvent) -> Self { +impl From for WithMetadata { + fn from(log_event: super::LogEvent) -> Self { let (value, metadata) = log_event.into_parts(); // Due to the backwards compatibility requirement by the @@ -330,8 +328,8 @@ impl From for WithMetadata { } } -impl From for WithMetadata { - fn from(trace: event::TraceEvent) -> Self { +impl From for WithMetadata { + fn from(trace: super::TraceEvent) -> Self { let (fields, metadata) = trace.into_parts(); let fields = fields .into_iter() @@ -349,31 +347,31 @@ impl From for WithMetadata { } } -impl From for Metric { - fn from(metric: event::Metric) -> Self { +impl From for Metric { + fn from(metric: super::Metric) -> Self { WithMetadata::::from(metric).data } } -impl From for MetricValue { - fn from(value: event::MetricValue) -> Self { +impl From for MetricValue { + fn from(value: super::MetricValue) -> Self { match value { - event::MetricValue::Counter { value } => Self::Counter(Counter { value }), - event::MetricValue::Gauge { value } => Self::Gauge(Gauge { value }), - event::MetricValue::Set { values } => Self::Set(Set { + super::MetricValue::Counter { value } => Self::Counter(Counter { value }), + super::MetricValue::Gauge { value } => Self::Gauge(Gauge { value }), + super::MetricValue::Set { values } => Self::Set(Set { values: values.into_iter().collect(), }), - event::MetricValue::Distribution { samples, statistic } => { + super::MetricValue::Distribution { samples, statistic } => { Self::Distribution2(Distribution2 { samples: samples.into_iter().map(Into::into).collect(), statistic: match statistic { - event::StatisticKind::Histogram => StatisticKind::Histogram, - event::StatisticKind::Summary => StatisticKind::Summary, + super::StatisticKind::Histogram => StatisticKind::Histogram, + super::StatisticKind::Summary => StatisticKind::Summary, } .into(), }) } - event::MetricValue::AggregatedHistogram { + super::MetricValue::AggregatedHistogram { buckets, count, sum, @@ -382,7 +380,7 @@ impl From for MetricValue { count, sum, }), - event::MetricValue::AggregatedSummary { + super::MetricValue::AggregatedSummary { quantiles, count, sum, @@ -391,7 +389,7 @@ impl From for MetricValue { count, sum, }), - event::MetricValue::Sketch { sketch } => match sketch { + super::MetricValue::Sketch { sketch } => match sketch { MetricSketch::AgentDDSketch(ddsketch) => { let bin_map = ddsketch.bin_map(); let (keys, counts) = bin_map.into_parts(); @@ -415,8 +413,8 @@ impl From for MetricValue { } } -impl From for WithMetadata { - fn from(metric: event::Metric) -> Self { +impl From for WithMetadata { + fn from(metric: super::Metric) -> Self { let (series, data, metadata) = metric.into_parts(); let name = series.name.name; let namespace = series.name.namespace.unwrap_or_default(); @@ -431,8 +429,8 @@ impl From for WithMetadata { let tags = series.tags.unwrap_or_default(); let kind = match data.kind { - event::MetricKind::Incremental => metric::Kind::Incremental, - event::MetricKind::Absolute => metric::Kind::Absolute, + super::MetricKind::Incremental => metric::Kind::Incremental, + super::MetricKind::Absolute => metric::Kind::Absolute, } .into(); @@ -482,30 +480,30 @@ impl From for WithMetadata { } } -impl From for Event { - fn from(event: event::Event) -> Self { +impl From for Event { + fn from(event: super::Event) -> Self { WithMetadata::::from(event).data } } -impl From for WithMetadata { - fn from(event: event::Event) -> Self { +impl From for WithMetadata { + fn from(event: super::Event) -> Self { match event { - event::Event::Log(log_event) => WithMetadata::::from(log_event).into(), - event::Event::Metric(metric) => WithMetadata::::from(metric).into(), - event::Event::Trace(trace) => WithMetadata::::from(trace).into(), + super::Event::Log(log_event) => WithMetadata::::from(log_event).into(), + super::Event::Metric(metric) => WithMetadata::::from(metric).into(), + super::Event::Trace(trace) => WithMetadata::::from(trace).into(), } } } -impl From for EventWrapper { - fn from(event: event::Event) -> Self { +impl From for EventWrapper { + fn from(event: super::Event) -> Self { WithMetadata::::from(event).data } } -impl From for WithMetadata { - fn from(event: event::Event) -> Self { +impl From for WithMetadata { + fn from(event: super::Event) -> Self { WithMetadata::::from(event).into() } } @@ -562,15 +560,15 @@ impl From for MetricSketch { } } -impl From for Secrets { - fn from(value: event::metadata::Secrets) -> Self { +impl From for Secrets { + fn from(value: super::metadata::Secrets) -> Self { Self { entries: value.into_iter().map(|(k, v)| (k, v.to_string())).collect(), } } } -impl From for event::metadata::Secrets { +impl From for super::metadata::Secrets { fn from(value: Secrets) -> Self { let mut secrets = Self::new(); for (k, v) in value.entries { @@ -581,8 +579,8 @@ impl From for event::metadata::Secrets { } } -impl From for DatadogOriginMetadata { - fn from(value: event::DatadogMetricOriginMetadata) -> Self { +impl From for DatadogOriginMetadata { + fn from(value: super::DatadogMetricOriginMetadata) -> Self { Self { origin_product: value.product(), origin_category: value.category(), @@ -591,7 +589,7 @@ impl From for DatadogOriginMetadata { } } -impl From for event::DatadogMetricOriginMetadata { +impl From for super::DatadogMetricOriginMetadata { fn from(value: DatadogOriginMetadata) -> Self { Self::new( value.origin_product, @@ -677,21 +675,21 @@ impl From for EventMetadata { } } -fn decode_value(input: Value) -> Option { +fn decode_value(input: Value) -> Option { match input.kind { - Some(value::Kind::RawBytes(data)) => Some(event::Value::Bytes(data)), - Some(value::Kind::Timestamp(ts)) => Some(event::Value::Timestamp( + Some(value::Kind::RawBytes(data)) => Some(super::Value::Bytes(data)), + Some(value::Kind::Timestamp(ts)) => Some(super::Value::Timestamp( chrono::Utc .timestamp_opt(ts.seconds, ts.nanos as u32) .single() .expect("invalid timestamp"), )), - Some(value::Kind::Integer(value)) => Some(event::Value::Integer(value)), - Some(value::Kind::Float(value)) => Some(event::Value::Float(NotNan::new(value).unwrap())), - Some(value::Kind::Boolean(value)) => Some(event::Value::Boolean(value)), + Some(value::Kind::Integer(value)) => Some(super::Value::Integer(value)), + Some(value::Kind::Float(value)) => Some(super::Value::Float(NotNan::new(value).unwrap())), + Some(value::Kind::Boolean(value)) => Some(super::Value::Boolean(value)), Some(value::Kind::Map(map)) => decode_map(map.fields), Some(value::Kind::Array(array)) => decode_array(array.items), - Some(value::Kind::Null(_)) => Some(event::Value::Null), + Some(value::Kind::Null(_)) => Some(super::Value::Null), None => { error!("Encoded event contains unknown value kind."); None @@ -699,42 +697,42 @@ fn decode_value(input: Value) -> Option { } } -fn decode_map(fields: BTreeMap) -> Option { +fn decode_map(fields: BTreeMap) -> Option { fields .into_iter() .map(|(key, value)| decode_value(value).map(|value| (key, value))) .collect::>>() - .map(event::Value::Object) + .map(super::Value::Object) } -fn decode_array(items: Vec) -> Option { +fn decode_array(items: Vec) -> Option { items .into_iter() .map(decode_value) .collect::>>() - .map(event::Value::Array) + .map(super::Value::Array) } -fn encode_value(value: event::Value) -> Value { +fn encode_value(value: super::Value) -> Value { Value { kind: match value { - event::Value::Bytes(b) => Some(value::Kind::RawBytes(b)), - event::Value::Regex(regex) => Some(value::Kind::RawBytes(regex.as_bytes())), - event::Value::Timestamp(ts) => Some(value::Kind::Timestamp(prost_types::Timestamp { + super::Value::Bytes(b) => Some(value::Kind::RawBytes(b)), + super::Value::Regex(regex) => Some(value::Kind::RawBytes(regex.as_bytes())), + super::Value::Timestamp(ts) => Some(value::Kind::Timestamp(prost_types::Timestamp { seconds: ts.timestamp(), nanos: ts.timestamp_subsec_nanos() as i32, })), - event::Value::Integer(value) => Some(value::Kind::Integer(value)), - event::Value::Float(value) => Some(value::Kind::Float(value.into_inner())), - event::Value::Boolean(value) => Some(value::Kind::Boolean(value)), - event::Value::Object(fields) => Some(value::Kind::Map(encode_map(fields))), - event::Value::Array(items) => Some(value::Kind::Array(encode_array(items))), - event::Value::Null => Some(value::Kind::Null(ValueNull::NullValue as i32)), + super::Value::Integer(value) => Some(value::Kind::Integer(value)), + super::Value::Float(value) => Some(value::Kind::Float(value.into_inner())), + super::Value::Boolean(value) => Some(value::Kind::Boolean(value)), + super::Value::Object(fields) => Some(value::Kind::Map(encode_map(fields))), + super::Value::Array(items) => Some(value::Kind::Array(encode_array(items))), + super::Value::Null => Some(value::Kind::Null(ValueNull::NullValue as i32)), }, } } -fn encode_map(fields: BTreeMap) -> ValueMap { +fn encode_map(fields: BTreeMap) -> ValueMap { ValueMap { fields: fields .into_iter() @@ -743,7 +741,7 @@ fn encode_map(fields: BTreeMap) -> ValueMap { } } -fn encode_array(items: Vec) -> ValueArray { +fn encode_array(items: Vec) -> ValueArray { ValueArray { items: items.into_iter().map(encode_value).collect(), } diff --git a/lib/vector-core/src/event/test/common.rs b/lib/vector-core/src/event/test/common.rs index c7ccca9521f70..0f7d00908e152 100644 --- a/lib/vector-core/src/event/test/common.rs +++ b/lib/vector-core/src/event/test/common.rs @@ -6,17 +6,15 @@ use std::{ use chrono::{DateTime, NaiveDateTime, Utc}; use quickcheck::{empty_shrinker, Arbitrary, Gen}; -use crate::{ - event::{ - metric::{ - Bucket, MetricData, MetricName, MetricSeries, MetricSketch, MetricTags, MetricTime, - Quantile, Sample, - }, - Event, EventMetadata, LogEvent, Metric, MetricKind, MetricValue, StatisticKind, TraceEvent, - Value, +use super::super::{ + metric::{ + Bucket, MetricData, MetricName, MetricSeries, MetricSketch, MetricTags, MetricTime, + Quantile, Sample, }, - metrics::AgentDDSketch, + Event, EventMetadata, LogEvent, Metric, MetricKind, MetricValue, StatisticKind, TraceEvent, + Value, }; +use crate::metrics::AgentDDSketch; const MAX_F64_SIZE: f64 = 1_000_000.0; const MAX_MAP_SIZE: usize = 4; diff --git a/lib/vector-core/src/event/test/size_of.rs b/lib/vector-core/src/event/test/size_of.rs index 522b0f0520fe4..6db19a96db1e1 100644 --- a/lib/vector-core/src/event/test/size_of.rs +++ b/lib/vector-core/src/event/test/size_of.rs @@ -2,9 +2,10 @@ use std::mem; use lookup::{path, PathPrefix}; use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult}; +use vector_common::byte_size_of::ByteSizeOf; +use super::common::Name; use super::*; -use crate::{event::test::common::Name, ByteSizeOf}; #[test] fn at_least_wrapper_size() { diff --git a/lib/vector-core/src/event/trace.rs b/lib/vector-core/src/event/trace.rs index 120c6c55f490b..851c504592d86 100644 --- a/lib/vector-core/src/event/trace.rs +++ b/lib/vector-core/src/event/trace.rs @@ -4,8 +4,8 @@ use lookup::lookup_v2::TargetPath; use serde::{Deserialize, Serialize}; use vector_buffers::EventCount; use vector_common::{ - internal_event::TaggedEventsSent, json_size::JsonSize, request_metadata::GetEventCountTags, - EventDataEq, + byte_size_of::ByteSizeOf, internal_event::TaggedEventsSent, json_size::JsonSize, + request_metadata::GetEventCountTags, EventDataEq, }; use vrl::path::PathParseError; @@ -13,7 +13,6 @@ use super::{ BatchNotifier, EstimatedJsonEncodedSizeOf, EventFinalizer, EventFinalizers, EventMetadata, Finalizable, LogEvent, Value, }; -use crate::ByteSizeOf; /// Traces are a newtype of `LogEvent` #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] diff --git a/lib/vector-core/src/event/vrl_target.rs b/lib/vector-core/src/event/vrl_target.rs index b29439a9a1e43..fd94f307fd245 100644 --- a/lib/vector-core/src/event/vrl_target.rs +++ b/lib/vector-core/src/event/vrl_target.rs @@ -9,9 +9,8 @@ use vrl::compiler::{ProgramInfo, SecretTarget, Target}; use vrl::prelude::Collection; use vrl::value::{Kind, Value}; -use super::{Event, EventMetadata, LogEvent, Metric, MetricKind, TraceEvent}; +use super::{metric::TagValue, Event, EventMetadata, LogEvent, Metric, MetricKind, TraceEvent}; use crate::config::{log_schema, LogNamespace}; -use crate::event::metric::TagValue; use crate::schema::Definition; const VALID_METRIC_PATHS_SET: &str = ".name, .namespace, .timestamp, .kind, .tags"; diff --git a/lib/vector-core/src/schema/definition.rs b/lib/vector-core/src/schema/definition.rs index 421b0b91a043a..b802cdd48cc9c 100644 --- a/lib/vector-core/src/schema/definition.rs +++ b/lib/vector-core/src/schema/definition.rs @@ -1,10 +1,11 @@ use std::collections::{BTreeMap, BTreeSet}; -use crate::config::{log_schema, LegacyKey, LogNamespace}; use lookup::lookup_v2::TargetPath; use lookup::{owned_value_path, OwnedTargetPath, OwnedValuePath, PathPrefix}; use vrl::value::{kind::Collection, Kind}; +use crate::config::{log_schema, LegacyKey, LogNamespace}; + /// The definition of a schema. /// /// This struct contains all the information needed to inspect the schema of an event emitted by diff --git a/lib/vector-lib/Cargo.toml b/lib/vector-lib/Cargo.toml new file mode 100644 index 0000000000000..51e6cdc6e7f80 --- /dev/null +++ b/lib/vector-lib/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "vector-lib" +version = "0.1.0" +authors = ["Vector Contributors "] +edition = "2021" +publish = false + +[dependencies] +vector-common = { path = "../vector-common", default-features = false } diff --git a/lib/vector-lib/src/lib.rs b/lib/vector-lib/src/lib.rs new file mode 100644 index 0000000000000..f089e7d004aaf --- /dev/null +++ b/lib/vector-lib/src/lib.rs @@ -0,0 +1,6 @@ +pub use vector_common::{ + assert_event_data_eq, btreemap, byte_size_of, byte_size_of::ByteSizeOf, config, conversion, + encode_logfmt, finalization, finalizer, impl_event_data_eq, internal_event, json_size, + registered_event, request_metadata, sensitive_string, shutdown, trigger, Error, Result, + TimeZone, +}; diff --git a/lib/vrl/value/Cargo.toml b/lib/vrl/value/Cargo.toml deleted file mode 100644 index 11854a880617f..0000000000000 --- a/lib/vrl/value/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "value" -version = "0.1.0" -authors = ["Vector Contributors "] -edition = "2021" -license = "MPL-2.0" -readme = "README.md" -publish = false - -[dependencies] -bytes = { version = "1.4.0", default-features = false, features = ["serde"] } -chrono = { version = "0.4.19", default-features = false, features = ["serde", "std"] } -lookup = { path = "../lookup", default-features = false } -ordered-float = { version = "3.7.0", default-features = false } -regex = { version = "1.7.2", default-features = false, features = ["std", "perf"]} -snafu = { version = "0.7.4", default-features = false } -tracing = { version = "0.1.34", default-features = false, features = ["attributes"] } - -# Optional -async-graphql = { version = "5.0.7", default-features = false, optional = true } -mlua = { version = "0.9.1", default-features = false, features = ["lua54", "send", "vendored"], optional = true} -serde = { version = "1.0.158", default-features = false, features = ["derive", "rc"], optional = true } -serde_json = { version = "1.0.94", optional = true } -toml = { version = "0.7.3", default-features = false, optional = true } -quickcheck = { version = "1.0.3", optional = true } - -[features] -lua = ["dep:mlua"] -api = ["dep:async-graphql", "json"] -json = ["dep:serde", "dep:serde_json"] -test = [] -arbitrary = ["dep:quickcheck"] - -[dev-dependencies] -async-graphql = { version = "5.0.7", default-features = false } -indoc = { version = "2.0.1", default-features = false } -quickcheck = "1.0.3" -lookup = { path = "../lookup", default-features = false, features = ["arbitrary"] } -serde = { version = "1.0.158", default-features = false, features = ["derive", "rc"]} -serde_json = { version = "1.0.94"} -toml = { version = "0.7.3", default-features = false } -mlua = { version = "0.9.1", default-features = false, features = ["lua54", "send", "vendored"]} diff --git a/src/api/schema/events/log.rs b/src/api/schema/events/log.rs index ad53474622510..1faedfa509ad6 100644 --- a/src/api/schema/events/log.rs +++ b/src/api/schema/events/log.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use async_graphql::Object; use chrono::{DateTime, Utc}; -use vector_common::encode_logfmt; +use vector_lib::encode_logfmt; use vrl::event_path; use super::EventEncodingType; diff --git a/src/api/schema/events/metric.rs b/src/api/schema/events/metric.rs index 23975758b3a5d..31786b579bfc5 100644 --- a/src/api/schema/events/metric.rs +++ b/src/api/schema/events/metric.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use async_graphql::{Enum, Object}; use chrono::{DateTime, Utc}; use serde_json::Value; -use vector_common::encode_logfmt; +use vector_lib::encode_logfmt; use super::EventEncodingType; use crate::{ diff --git a/src/api/schema/events/trace.rs b/src/api/schema/events/trace.rs index 9bd52d3ce053e..db2606fac5c95 100644 --- a/src/api/schema/events/trace.rs +++ b/src/api/schema/events/trace.rs @@ -1,5 +1,5 @@ use async_graphql::Object; -use vector_common::encode_logfmt; +use vector_lib::encode_logfmt; use vrl::event_path; use super::EventEncodingType; diff --git a/src/aws/auth.rs b/src/aws/auth.rs index d05d479aaaab1..776a57f4c25b6 100644 --- a/src/aws/auth.rs +++ b/src/aws/auth.rs @@ -14,8 +14,8 @@ use aws_credential_types::{ }; use aws_types::region::Region; use serde_with::serde_as; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; // matches default load timeout from the SDK as of 0.10.1, but lets us confidently document the // default rather than relying on the SDK default to not change diff --git a/src/codecs/decoding/config.rs b/src/codecs/decoding/config.rs index b4a01245bcfe0..00e0c7e67d73b 100644 --- a/src/codecs/decoding/config.rs +++ b/src/codecs/decoding/config.rs @@ -41,7 +41,7 @@ impl DecodingConfig { } /// Builds a `Decoder` from the provided configuration. - pub fn build(&self) -> vector_common::Result { + pub fn build(&self) -> vector_lib::Result { // Build the framer. let framer = self.framing.build(); diff --git a/src/codecs/encoding/transformer.rs b/src/codecs/encoding/transformer.rs index 4e5ed9e195793..6b2690b6c5cc1 100644 --- a/src/codecs/encoding/transformer.rs +++ b/src/codecs/encoding/transformer.rs @@ -267,8 +267,8 @@ pub enum TimestampFormat { mod tests { use indoc::indoc; use lookup::path::parse_target_path; - use vector_common::btreemap; use vector_core::config::{log_schema, LogNamespace}; + use vector_lib::btreemap; use vrl::value::Kind; use crate::config::schema; diff --git a/src/components/validation/resources/http.rs b/src/components/validation/resources/http.rs index 7fd6105b579e6..5e9be4edb2a2c 100644 --- a/src/components/validation/resources/http.rs +++ b/src/components/validation/resources/http.rs @@ -62,7 +62,7 @@ impl HttpResourceConfig { codec: ResourceCodec, output_tx: mpsc::Sender>, task_coordinator: &TaskCoordinator, - ) -> vector_common::Result<()> { + ) -> vector_lib::Result<()> { match direction { // We'll pull data from the sink. ResourceDirection::Pull => Ok(spawn_output_http_client( @@ -230,7 +230,7 @@ fn spawn_output_http_server( codec: ResourceCodec, output_tx: mpsc::Sender>, task_coordinator: &TaskCoordinator, -) -> vector_common::Result<()> { +) -> vector_lib::Result<()> { // This HTTP server will wait for events to be sent by a sink, and collect them and send them on // via an output sender. We accept/collect events until we're told to shutdown. diff --git a/src/components/validation/resources/mod.rs b/src/components/validation/resources/mod.rs index b66e9832c0f0f..5d48427f70b45 100644 --- a/src/components/validation/resources/mod.rs +++ b/src/components/validation/resources/mod.rs @@ -96,7 +96,7 @@ impl ResourceCodec { /// /// The decoder is generated as an inverse to the input codec: if an encoding configuration was /// given, we generate a decoder that satisfies that encoding configuration, and vice versa. - pub fn into_decoder(&self) -> vector_common::Result { + pub fn into_decoder(&self) -> vector_lib::Result { let (framer, deserializer) = match self { Self::Decoding(config) => return config.build(), Self::Encoding(config) => ( @@ -187,7 +187,7 @@ fn decoder_framing_to_encoding_framer(framing: &decoding::FramingConfig) -> enco fn serializer_config_to_deserializer( config: &SerializerConfig, -) -> vector_common::Result { +) -> vector_lib::Result { let deserializer_config = match config { SerializerConfig::Avro { .. } => todo!(), SerializerConfig::Csv { .. } => todo!(), @@ -328,7 +328,7 @@ impl ExternalResource { self, output_tx: mpsc::Sender>, task_coordinator: &TaskCoordinator, - ) -> vector_common::Result<()> { + ) -> vector_lib::Result<()> { match self.definition { ResourceDefinition::Http(http_config) => { http_config.spawn_as_output(self.direction, self.codec, output_tx, task_coordinator) diff --git a/src/components/validation/runner/io.rs b/src/components/validation/runner/io.rs index 55e4fca1eaecf..b554140e04788 100644 --- a/src/components/validation/runner/io.rs +++ b/src/components/validation/runner/io.rs @@ -9,8 +9,8 @@ use tonic::{ Status, }; use tower::Service; -use vector_common::shutdown::ShutdownSignal; use vector_core::{event::Event, tls::MaybeTlsSettings}; +use vector_lib::shutdown::ShutdownSignal; use crate::{ components::validation::{ diff --git a/src/components/validation/runner/mod.rs b/src/components/validation/runner/mod.rs index f38bdc75a3f41..210043e406ca4 100644 --- a/src/components/validation/runner/mod.rs +++ b/src/components/validation/runner/mod.rs @@ -191,7 +191,7 @@ impl Runner { } } - pub async fn run_validation(self) -> Result, vector_common::Error> { + pub async fn run_validation(self) -> Result, vector_lib::Error> { // Initialize our test environment. initialize_test_environment(); @@ -413,7 +413,7 @@ fn build_external_resource( configuration: &ValidationConfiguration, input_task_coordinator: &TaskCoordinator, output_task_coordinator: &TaskCoordinator, -) -> Result<(RunnerInput, RunnerOutput, Option>), vector_common::Error> { +) -> Result<(RunnerInput, RunnerOutput, Option>), vector_lib::Error> { let component_type = configuration.component_type(); let maybe_external_resource = configuration.external_resource(); let maybe_encoder = maybe_external_resource diff --git a/src/conditions/vrl.rs b/src/conditions/vrl.rs index 8011f8cba4701..3a14089f82c83 100644 --- a/src/conditions/vrl.rs +++ b/src/conditions/vrl.rs @@ -1,6 +1,6 @@ -use vector_common::TimeZone; use vector_config::configurable_component; use vector_core::compile_vrl; +use vector_lib::TimeZone; use vrl::compiler::runtime::{Runtime, RuntimeResult, Terminate}; use vrl::compiler::{CompilationResult, CompileConfig, Program, TypeState, VrlRuntime}; use vrl::diagnostic::Formatter; diff --git a/src/config/loading/secret.rs b/src/config/loading/secret.rs index 09a32260708e1..909fa30b13f90 100644 --- a/src/config/loading/secret.rs +++ b/src/config/loading/secret.rs @@ -8,7 +8,7 @@ use once_cell::sync::Lazy; use regex::{Captures, Regex}; use serde::{Deserialize, Serialize}; use toml::value::Table; -use vector_common::config::ComponentKey; +use vector_lib::config::ComponentKey; use crate::{ config::{ diff --git a/src/config/mod.rs b/src/config/mod.rs index c65de18da77d4..46f206d0b0d84 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1452,8 +1452,8 @@ mod resource_config_tests { fn generate_component_config_schema() { use crate::config::{SinkOuter, SourceOuter, TransformOuter}; use indexmap::IndexMap; - use vector_common::config::ComponentKey; use vector_config::configurable_component; + use vector_lib::config::ComponentKey; /// Top-level Vector configuration. #[configurable_component] diff --git a/src/enrichment_tables/file.rs b/src/enrichment_tables/file.rs index 6c92bf395f244..0401a118e4f5e 100644 --- a/src/enrichment_tables/file.rs +++ b/src/enrichment_tables/file.rs @@ -10,8 +10,8 @@ use std::{ use bytes::Bytes; use enrichment::{Case, Condition, IndexHandle, Table}; use tracing::trace; -use vector_common::{conversion::Conversion, TimeZone}; use vector_config::configurable_component; +use vector_lib::{conversion::Conversion, TimeZone}; use vrl::value::Value; use crate::config::EnrichmentTableConfig; diff --git a/src/gcp.rs b/src/gcp.rs index dd235cd52c404..485cc51dd3a27 100644 --- a/src/gcp.rs +++ b/src/gcp.rs @@ -17,8 +17,8 @@ use once_cell::sync::Lazy; use smpl_jwt::Jwt; use snafu::{ResultExt, Snafu}; use tokio::{sync::watch, time::Instant}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::{config::ProxyConfig, http::HttpClient, http::HttpError}; diff --git a/src/http.rs b/src/http.rs index 84e0364c00515..ae3c7ae09300c 100644 --- a/src/http.rs +++ b/src/http.rs @@ -17,8 +17,8 @@ use hyper_proxy::ProxyConnector; use snafu::{ResultExt, Snafu}; use tower::Service; use tracing::Instrument; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::{ config::ProxyConfig, diff --git a/src/internal_events/adaptive_concurrency.rs b/src/internal_events/adaptive_concurrency.rs index 8aa5cf5344dc3..e0d7bb7c2cf7e 100644 --- a/src/internal_events/adaptive_concurrency.rs +++ b/src/internal_events/adaptive_concurrency.rs @@ -1,7 +1,7 @@ use std::time::Duration; use metrics::{register_histogram, Histogram}; -use vector_common::registered_event; +use vector_lib::registered_event; #[derive(Clone, Copy)] pub struct AdaptiveConcurrencyLimitData { diff --git a/src/internal_events/amqp.rs b/src/internal_events/amqp.rs index a042b86278ed3..c0b05313b4b53 100644 --- a/src/internal_events/amqp.rs +++ b/src/internal_events/amqp.rs @@ -1,8 +1,8 @@ #[cfg(feature = "sources-amqp")] pub mod source { use metrics::counter; - use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; + use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct AmqpBytesReceived { @@ -93,10 +93,10 @@ pub mod source { pub mod sink { use crate::emit; use metrics::counter; - use vector_common::internal_event::{ + use vector_core::internal_event::InternalEvent; + use vector_lib::internal_event::{ error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, }; - use vector_core::internal_event::InternalEvent; #[derive(Debug)] pub struct AmqpDeliveryError<'a> { diff --git a/src/internal_events/apache_metrics.rs b/src/internal_events/apache_metrics.rs index 0e42463f960e8..88c3d74613dd3 100644 --- a/src/internal_events/apache_metrics.rs +++ b/src/internal_events/apache_metrics.rs @@ -1,10 +1,10 @@ use metrics::counter; -use vector_common::{ +use vector_core::internal_event::InternalEvent; +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; -use vector_core::internal_event::InternalEvent; use super::prelude::http_error_code; use crate::sources::apache_metrics; diff --git a/src/internal_events/aws.rs b/src/internal_events/aws.rs index 140253f41d807..b2b100136a903 100644 --- a/src/internal_events/aws.rs +++ b/src/internal_events/aws.rs @@ -1,5 +1,5 @@ use metrics::counter; -use vector_common::internal_event::InternalEvent; +use vector_lib::internal_event::InternalEvent; pub struct AwsBytesSent { pub byte_size: usize, diff --git a/src/internal_events/aws_cloudwatch_logs.rs b/src/internal_events/aws_cloudwatch_logs.rs index ca1069e7733c5..857827849b892 100644 --- a/src/internal_events/aws_cloudwatch_logs.rs +++ b/src/internal_events/aws_cloudwatch_logs.rs @@ -1,8 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; use crate::emit; diff --git a/src/internal_events/aws_ec2_metadata.rs b/src/internal_events/aws_ec2_metadata.rs index dc1b2f6523447..eefa592d871d5 100644 --- a/src/internal_events/aws_ec2_metadata.rs +++ b/src/internal_events/aws_ec2_metadata.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct AwsEc2MetadataRefreshSuccessful; diff --git a/src/internal_events/aws_ecs_metrics.rs b/src/internal_events/aws_ecs_metrics.rs index 2ae8081697a66..d15061ad0e9c6 100644 --- a/src/internal_events/aws_ecs_metrics.rs +++ b/src/internal_events/aws_ecs_metrics.rs @@ -1,11 +1,11 @@ use std::borrow::Cow; use metrics::counter; -use vector_common::{ +use vector_core::internal_event::InternalEvent; +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; -use vector_core::internal_event::InternalEvent; use super::prelude::{http_error_code, hyper_error_code}; diff --git a/src/internal_events/aws_kinesis.rs b/src/internal_events/aws_kinesis.rs index ef928dc6b38a7..0af8de5a03517 100644 --- a/src/internal_events/aws_kinesis.rs +++ b/src/internal_events/aws_kinesis.rs @@ -1,10 +1,8 @@ /// Used in both `aws_kinesis_streams` and `aws_kinesis_firehose` sinks use crate::emit; use metrics::counter; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct AwsKinesisStreamNoPartitionKeyError<'a> { diff --git a/src/internal_events/aws_kinesis_firehose.rs b/src/internal_events/aws_kinesis_firehose.rs index ae992633e7248..65906c1e4d155 100644 --- a/src/internal_events/aws_kinesis_firehose.rs +++ b/src/internal_events/aws_kinesis_firehose.rs @@ -1,6 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type}; use super::prelude::{http_error_code, io_error_code}; use crate::sources::aws_kinesis_firehose::Compression; diff --git a/src/internal_events/aws_sqs.rs b/src/internal_events/aws_sqs.rs index 6a0f114e0371a..3cdd6e9539974 100644 --- a/src/internal_events/aws_sqs.rs +++ b/src/internal_events/aws_sqs.rs @@ -4,7 +4,7 @@ pub use s3::*; use vector_core::internal_event::InternalEvent; #[cfg(any(feature = "sources-aws_s3", feature = "sources-aws_sqs"))] -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[cfg(feature = "sources-aws_s3")] mod s3 { diff --git a/src/internal_events/batch.rs b/src/internal_events/batch.rs index 1044d1cca82ab..72462905a086c 100644 --- a/src/internal_events/batch.rs +++ b/src/internal_events/batch.rs @@ -2,9 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct LargeEventDroppedError { diff --git a/src/internal_events/codecs.rs b/src/internal_events/codecs.rs index 1801bce38d3c1..0794c0e21a450 100644 --- a/src/internal_events/codecs.rs +++ b/src/internal_events/codecs.rs @@ -2,9 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct DecoderFramingError { diff --git a/src/internal_events/common.rs b/src/internal_events/common.rs index 0bf94f54ae25a..0099c24524ddc 100644 --- a/src/internal_events/common.rs +++ b/src/internal_events/common.rs @@ -5,9 +5,7 @@ use metrics::{counter, histogram}; pub use vector_core::internal_event::EventsReceived; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct EndpointBytesReceived<'a> { diff --git a/src/internal_events/conditions.rs b/src/internal_events/conditions.rs index 31ddeecc60bae..88576b8dac425 100644 --- a/src/internal_events/conditions.rs +++ b/src/internal_events/conditions.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug, Copy, Clone)] pub struct VrlConditionExecutionError<'a> { diff --git a/src/internal_events/datadog_metrics.rs b/src/internal_events/datadog_metrics.rs index c4daf1d3ce7f8..417629547ba78 100644 --- a/src/internal_events/datadog_metrics.rs +++ b/src/internal_events/datadog_metrics.rs @@ -2,9 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct DatadogMetricsEncodingError<'a> { diff --git a/src/internal_events/datadog_traces.rs b/src/internal_events/datadog_traces.rs index e6724a9adb484..77d3b2935a222 100644 --- a/src/internal_events/datadog_traces.rs +++ b/src/internal_events/datadog_traces.rs @@ -2,9 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct DatadogTracesEncodingError { diff --git a/src/internal_events/dnstap.rs b/src/internal_events/dnstap.rs index ce1fe24812d6c..4b68b965c58c0 100644 --- a/src/internal_events/dnstap.rs +++ b/src/internal_events/dnstap.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub(crate) struct DnstapParseError { diff --git a/src/internal_events/docker_logs.rs b/src/internal_events/docker_logs.rs index 6992eb1b7ead4..49b423a5d4d1d 100644 --- a/src/internal_events/docker_logs.rs +++ b/src/internal_events/docker_logs.rs @@ -1,11 +1,11 @@ use bollard::errors::Error; use chrono::ParseError; use metrics::counter; -use vector_common::{ +use vector_core::internal_event::InternalEvent; +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; -use vector_core::internal_event::InternalEvent; #[derive(Debug)] pub struct DockerLogsEventsReceived<'a> { diff --git a/src/internal_events/eventstoredb_metrics.rs b/src/internal_events/eventstoredb_metrics.rs index 360192363d4fe..19dbff55b2ac4 100644 --- a/src/internal_events/eventstoredb_metrics.rs +++ b/src/internal_events/eventstoredb_metrics.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct EventStoreDbMetricsHttpError { diff --git a/src/internal_events/exec.rs b/src/internal_events/exec.rs index 4fd3461a1f822..4d5baabcd91c0 100644 --- a/src/internal_events/exec.rs +++ b/src/internal_events/exec.rs @@ -3,11 +3,11 @@ use std::time::Duration; use crate::emit; use metrics::{counter, histogram}; use tokio::time::error::Elapsed; -use vector_common::{ +use vector_core::internal_event::InternalEvent; +use vector_lib::{ internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}, json_size::JsonSize, }; -use vector_core::internal_event::InternalEvent; use super::prelude::io_error_code; diff --git a/src/internal_events/file.rs b/src/internal_events/file.rs index aedac3d74afb2..d947698b2bc81 100644 --- a/src/internal_events/file.rs +++ b/src/internal_events/file.rs @@ -7,7 +7,7 @@ use crate::emit; #[cfg(any(feature = "sources-file", feature = "sources-kubernetes_logs"))] pub use self::source::*; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct FileOpen { @@ -87,7 +87,7 @@ mod source { use super::{FileOpen, InternalEvent}; use crate::emit; - use vector_common::{ + use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; diff --git a/src/internal_events/file_descriptor.rs b/src/internal_events/file_descriptor.rs index 9d6b484c85f53..45f73bfc400cf 100644 --- a/src/internal_events/file_descriptor.rs +++ b/src/internal_events/file_descriptor.rs @@ -1,6 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct FileDescriptorReadError { diff --git a/src/internal_events/filter.rs b/src/internal_events/filter.rs index 44d3c607f4f1f..867dbffa915da 100644 --- a/src/internal_events/filter.rs +++ b/src/internal_events/filter.rs @@ -1,8 +1,8 @@ -use vector_common::internal_event::{ComponentEventsDropped, Count, Registered, INTENTIONAL}; +use vector_lib::internal_event::{ComponentEventsDropped, Count, Registered, INTENTIONAL}; use crate::register; -vector_common::registered_event! ( +vector_lib::registered_event! ( FilterEventsDropped => { events_dropped: Registered> = register!(ComponentEventsDropped::::from( diff --git a/src/internal_events/fluent.rs b/src/internal_events/fluent.rs index 9fbcdc0031e5f..5ac8685a65802 100644 --- a/src/internal_events/fluent.rs +++ b/src/internal_events/fluent.rs @@ -2,7 +2,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::sources::fluent::DecodeError; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct FluentMessageReceived { diff --git a/src/internal_events/gcp_pubsub.rs b/src/internal_events/gcp_pubsub.rs index 05621bc66b924..9e669620448d4 100644 --- a/src/internal_events/gcp_pubsub.rs +++ b/src/internal_events/gcp_pubsub.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; pub struct GcpPubsubConnectError { pub error: tonic::transport::Error, diff --git a/src/internal_events/grpc.rs b/src/internal_events/grpc.rs index e30388ed4710b..7f48b2930b290 100644 --- a/src/internal_events/grpc.rs +++ b/src/internal_events/grpc.rs @@ -1,6 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct GrpcInvalidCompressionSchemeError<'a> { diff --git a/src/internal_events/host_metrics.rs b/src/internal_events/host_metrics.rs index fc25394486111..59b957ff071e0 100644 --- a/src/internal_events/host_metrics.rs +++ b/src/internal_events/host_metrics.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct HostMetricsScrapeError { diff --git a/src/internal_events/http.rs b/src/internal_events/http.rs index 5243cf47628f5..ce4bae4ede61d 100644 --- a/src/internal_events/http.rs +++ b/src/internal_events/http.rs @@ -3,7 +3,7 @@ use std::error::Error; use metrics::{counter, histogram}; use vector_core::internal_event::InternalEvent; -use vector_common::{ +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; diff --git a/src/internal_events/http_client.rs b/src/internal_events/http_client.rs index e6cca8b743188..5d47336c8dad0 100644 --- a/src/internal_events/http_client.rs +++ b/src/internal_events/http_client.rs @@ -8,7 +8,7 @@ use hyper::{body::HttpBody, Error}; use metrics::{counter, histogram}; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct AboutToSendHttpRequest<'a, T> { diff --git a/src/internal_events/http_client_source.rs b/src/internal_events/http_client_source.rs index b5eb27e8a3fd9..55a868c1da597 100644 --- a/src/internal_events/http_client_source.rs +++ b/src/internal_events/http_client_source.rs @@ -1,9 +1,9 @@ use metrics::counter; -use vector_common::{ +use vector_core::internal_event::InternalEvent; +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; -use vector_core::internal_event::InternalEvent; use super::prelude::http_error_code; diff --git a/src/internal_events/influxdb.rs b/src/internal_events/influxdb.rs index cbd1e36c0c472..4dcbbcf081264 100644 --- a/src/internal_events/influxdb.rs +++ b/src/internal_events/influxdb.rs @@ -1,9 +1,7 @@ use crate::emit; use metrics::counter; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct InfluxdbEncodingError { diff --git a/src/internal_events/internal_logs.rs b/src/internal_events/internal_logs.rs index 5d6637bfec986..9f0806db7b0a1 100644 --- a/src/internal_events/internal_logs.rs +++ b/src/internal_events/internal_logs.rs @@ -1,6 +1,6 @@ use metrics::counter; -use vector_common::json_size::JsonSize; use vector_core::internal_event::InternalEvent; +use vector_lib::json_size::JsonSize; #[derive(Debug)] pub struct InternalLogsBytesReceived { diff --git a/src/internal_events/journald.rs b/src/internal_events/journald.rs index 1863990c4b9ee..5f0fc62cc767f 100644 --- a/src/internal_events/journald.rs +++ b/src/internal_events/journald.rs @@ -2,7 +2,7 @@ use codecs::decoding::BoxedFramingError; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct JournaldInvalidRecordError { diff --git a/src/internal_events/kafka.rs b/src/internal_events/kafka.rs index 7a968626d0cb9..b6d50da6407ba 100644 --- a/src/internal_events/kafka.rs +++ b/src/internal_events/kafka.rs @@ -2,7 +2,7 @@ use metrics::{counter, gauge}; use vector_core::{internal_event::InternalEvent, update_counter}; use vrl::path::OwnedTargetPath; -use vector_common::{ +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; diff --git a/src/internal_events/kubernetes_logs.rs b/src/internal_events/kubernetes_logs.rs index aff0109295078..44a7964070028 100644 --- a/src/internal_events/kubernetes_logs.rs +++ b/src/internal_events/kubernetes_logs.rs @@ -3,7 +3,7 @@ use vector_core::internal_event::InternalEvent; use crate::emit; use crate::event::Event; -use vector_common::{ +use vector_lib::{ internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}, json_size::JsonSize, }; diff --git a/src/internal_events/log_to_metric.rs b/src/internal_events/log_to_metric.rs index 1925dd135efba..800d2693a4d3b 100644 --- a/src/internal_events/log_to_metric.rs +++ b/src/internal_events/log_to_metric.rs @@ -4,9 +4,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::emit; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; pub struct LogToMetricFieldNullError<'a> { pub field: &'a str, diff --git a/src/internal_events/logplex.rs b/src/internal_events/logplex.rs index ab0be914847d0..2d1e07cd8cad1 100644 --- a/src/internal_events/logplex.rs +++ b/src/internal_events/logplex.rs @@ -1,6 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type}; use super::prelude::io_error_code; diff --git a/src/internal_events/loki.rs b/src/internal_events/loki.rs index eff93d7a7a429..ea88bf2207fbf 100644 --- a/src/internal_events/loki.rs +++ b/src/internal_events/loki.rs @@ -1,7 +1,7 @@ use crate::emit; use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::{ComponentEventsDropped, InternalEvent, INTENTIONAL}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct LokiEventUnlabeledError; diff --git a/src/internal_events/lua.rs b/src/internal_events/lua.rs index a18665d87b419..f9fb819af7557 100644 --- a/src/internal_events/lua.rs +++ b/src/internal_events/lua.rs @@ -3,9 +3,7 @@ use vector_core::internal_event::InternalEvent; use crate::emit; use crate::transforms::lua::v2::BuildError; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct LuaGcTriggered { diff --git a/src/internal_events/metric_to_log.rs b/src/internal_events/metric_to_log.rs index 14463782d3adc..efec0705507fa 100644 --- a/src/internal_events/metric_to_log.rs +++ b/src/internal_events/metric_to_log.rs @@ -3,9 +3,7 @@ use serde_json::Error; use vector_core::internal_event::InternalEvent; use crate::emit; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct MetricToLogSerializeError { diff --git a/src/internal_events/mod.rs b/src/internal_events/mod.rs index 2692212dc9e2e..64b8664aeef0d 100644 --- a/src/internal_events/mod.rs +++ b/src/internal_events/mod.rs @@ -276,7 +276,7 @@ pub use self::{ #[macro_export] macro_rules! emit { ($event:expr) => { - vector_common::internal_event::emit(vector_common::internal_event::DefaultName { + vector_lib::internal_event::emit(vector_lib::internal_event::DefaultName { event: $event, name: stringify!($event), }) @@ -287,7 +287,7 @@ macro_rules! emit { #[macro_export] macro_rules! emit { ($event:expr) => { - vector_common::internal_event::emit($event) + vector_lib::internal_event::emit($event) }; } @@ -295,7 +295,7 @@ macro_rules! emit { #[macro_export] macro_rules! register { ($event:expr) => { - vector_common::internal_event::register(vector_common::internal_event::DefaultName { + vector_lib::internal_event::register(vector_lib::internal_event::DefaultName { event: $event, name: stringify!($event), }) @@ -306,6 +306,6 @@ macro_rules! register { #[macro_export] macro_rules! register { ($event:expr) => { - vector_common::internal_event::register($event) + vector_lib::internal_event::register($event) }; } diff --git a/src/internal_events/mongodb_metrics.rs b/src/internal_events/mongodb_metrics.rs index 1e749dc5ba8c2..715a886ff48e2 100644 --- a/src/internal_events/mongodb_metrics.rs +++ b/src/internal_events/mongodb_metrics.rs @@ -2,7 +2,7 @@ use metrics::counter; use mongodb::{bson, error::Error as MongoError}; use vector_core::internal_event::InternalEvent; -use vector_common::{ +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; diff --git a/src/internal_events/nginx_metrics.rs b/src/internal_events/nginx_metrics.rs index eb5adcf8485d1..7d5fab1d272e3 100644 --- a/src/internal_events/nginx_metrics.rs +++ b/src/internal_events/nginx_metrics.rs @@ -2,7 +2,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::sources::nginx_metrics::parser::ParseError; -use vector_common::{ +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; diff --git a/src/internal_events/parser.rs b/src/internal_events/parser.rs index 07826e3b6f155..fe29ccfc363be 100644 --- a/src/internal_events/parser.rs +++ b/src/internal_events/parser.rs @@ -4,9 +4,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::emit; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; fn truncate_string_at(s: &str, maxlen: usize) -> Cow { let ellipsis: &str = "[...]"; diff --git a/src/internal_events/postgresql_metrics.rs b/src/internal_events/postgresql_metrics.rs index 77dc451152c15..bc5ca8a230587 100644 --- a/src/internal_events/postgresql_metrics.rs +++ b/src/internal_events/postgresql_metrics.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct PostgresqlMetricsCollectError<'a> { diff --git a/src/internal_events/process.rs b/src/internal_events/process.rs index 82fb2add4c09d..0ed898aa77297 100644 --- a/src/internal_events/process.rs +++ b/src/internal_events/process.rs @@ -3,7 +3,7 @@ use metrics::gauge; use vector_core::internal_event::InternalEvent; use crate::{built_info, config}; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct VectorStarted; diff --git a/src/internal_events/prometheus.rs b/src/internal_events/prometheus.rs index 1f0c96684ba19..4a85609ec7fca 100644 --- a/src/internal_events/prometheus.rs +++ b/src/internal_events/prometheus.rs @@ -8,9 +8,7 @@ use prometheus_parser::ParserError; use vector_core::internal_event::InternalEvent; use crate::emit; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[cfg(feature = "sources-prometheus-scrape")] #[derive(Debug)] diff --git a/src/internal_events/pulsar.rs b/src/internal_events/pulsar.rs index ffa5f51883d8a..f714e77d40a35 100644 --- a/src/internal_events/pulsar.rs +++ b/src/internal_events/pulsar.rs @@ -2,14 +2,12 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::emit; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct PulsarSendingError { pub count: usize, - pub error: vector_common::Error, + pub error: vector_lib::Error, } impl InternalEvent for PulsarSendingError { diff --git a/src/internal_events/redis.rs b/src/internal_events/redis.rs index 6a25b79af1a39..998b81fc48a35 100644 --- a/src/internal_events/redis.rs +++ b/src/internal_events/redis.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct RedisReceiveEventError { diff --git a/src/internal_events/remap.rs b/src/internal_events/remap.rs index 7a6bb5500cc30..66fbaa67b4212 100644 --- a/src/internal_events/remap.rs +++ b/src/internal_events/remap.rs @@ -2,7 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{ +use vector_lib::internal_event::{ error_stage, error_type, ComponentEventsDropped, INTENTIONAL, UNINTENTIONAL, }; diff --git a/src/internal_events/sematext_metrics.rs b/src/internal_events/sematext_metrics.rs index fea41b796c9f1..af14d78fa8367 100644 --- a/src/internal_events/sematext_metrics.rs +++ b/src/internal_events/sematext_metrics.rs @@ -2,9 +2,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; use crate::{emit, event::metric::Metric}; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct SematextMetricsInvalidMetricError<'a> { diff --git a/src/internal_events/socket.rs b/src/internal_events/socket.rs index daa03a27991b5..d68cb41cf1a88 100644 --- a/src/internal_events/socket.rs +++ b/src/internal_events/socket.rs @@ -1,9 +1,9 @@ use metrics::counter; -use vector_common::{ +use vector_core::internal_event::{ComponentEventsDropped, InternalEvent, UNINTENTIONAL}; +use vector_lib::{ internal_event::{error_stage, error_type}, json_size::JsonSize, }; -use vector_core::internal_event::{ComponentEventsDropped, InternalEvent, UNINTENTIONAL}; use crate::emit; diff --git a/src/internal_events/splunk_hec.rs b/src/internal_events/splunk_hec.rs index 8dd7040a1f781..5b155386db401 100644 --- a/src/internal_events/splunk_hec.rs +++ b/src/internal_events/splunk_hec.rs @@ -16,13 +16,13 @@ mod sink { event::metric::{MetricKind, MetricValue}, sinks::splunk_hec::common::acknowledgements::HecAckApiError, }; - use vector_common::internal_event::{ + use vector_lib::internal_event::{ error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, }; #[derive(Debug)] pub struct SplunkEventEncodeError { - pub error: vector_common::Error, + pub error: vector_lib::Error, } impl InternalEvent for SplunkEventEncodeError { @@ -201,7 +201,7 @@ mod source { use vector_core::internal_event::InternalEvent; use crate::sources::splunk_hec::ApiError; - use vector_common::internal_event::{error_stage, error_type}; + use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct SplunkHecRequestReceived<'a> { diff --git a/src/internal_events/statsd_sink.rs b/src/internal_events/statsd_sink.rs index 20766f3376aad..73be541eeea23 100644 --- a/src/internal_events/statsd_sink.rs +++ b/src/internal_events/statsd_sink.rs @@ -3,9 +3,7 @@ use vector_core::internal_event::InternalEvent; use crate::emit; use crate::event::metric::{MetricKind, MetricValue}; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; #[derive(Debug)] pub struct StatsdInvalidMetricError<'a> { diff --git a/src/internal_events/tcp.rs b/src/internal_events/tcp.rs index 5c915278bba9e..1bd99e835172e 100644 --- a/src/internal_events/tcp.rs +++ b/src/internal_events/tcp.rs @@ -1,8 +1,8 @@ use std::net::SocketAddr; use metrics::counter; -use vector_common::internal_event::{error_stage, error_type}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type}; use crate::{emit, internal_events::SocketOutgoingConnectionError, tls::TlsError}; diff --git a/src/internal_events/template.rs b/src/internal_events/template.rs index b9ecd702d0dca..c263e46250c4a 100644 --- a/src/internal_events/template.rs +++ b/src/internal_events/template.rs @@ -2,7 +2,7 @@ use crate::emit; use metrics::counter; use vector_core::internal_event::{ComponentEventsDropped, InternalEvent, UNINTENTIONAL}; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; pub struct TemplateRenderingError<'a> { pub field: Option<&'a str>, diff --git a/src/internal_events/udp.rs b/src/internal_events/udp.rs index e74ef16b16abd..0821107b19e01 100644 --- a/src/internal_events/udp.rs +++ b/src/internal_events/udp.rs @@ -1,8 +1,6 @@ use metrics::counter; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; use crate::{emit, internal_events::SocketOutgoingConnectionError}; diff --git a/src/internal_events/unix.rs b/src/internal_events/unix.rs index 2f004ec38b826..4affef0370ea9 100644 --- a/src/internal_events/unix.rs +++ b/src/internal_events/unix.rs @@ -1,10 +1,8 @@ use std::{io::Error, path::Path}; use metrics::counter; -use vector_common::internal_event::{ - error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL, -}; use vector_core::internal_event::InternalEvent; +use vector_lib::internal_event::{error_stage, error_type, ComponentEventsDropped, UNINTENTIONAL}; use crate::{emit, internal_events::SocketOutgoingConnectionError}; diff --git a/src/internal_events/websocket.rs b/src/internal_events/websocket.rs index 93cfb11128f6b..acc7c25203b0e 100644 --- a/src/internal_events/websocket.rs +++ b/src/internal_events/websocket.rs @@ -4,7 +4,7 @@ use std::fmt::Debug; use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct WsConnectionEstablished; diff --git a/src/internal_events/windows.rs b/src/internal_events/windows.rs index b0adc6f3d6beb..3634ab99af1f8 100644 --- a/src/internal_events/windows.rs +++ b/src/internal_events/windows.rs @@ -1,7 +1,7 @@ use metrics::counter; use vector_core::internal_event::InternalEvent; -use vector_common::internal_event::{error_stage, error_type}; +use vector_lib::internal_event::{error_stage, error_type}; #[derive(Debug)] pub struct WindowsServiceStart<'a> { diff --git a/src/kafka.rs b/src/kafka.rs index 9c940511275e0..97776e0b014c9 100644 --- a/src/kafka.rs +++ b/src/kafka.rs @@ -3,8 +3,8 @@ use std::path::{Path, PathBuf}; use rdkafka::{consumer::ConsumerContext, ClientConfig, ClientContext, Statistics}; use snafu::Snafu; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::{ internal_events::KafkaStatisticsReceived, tls::TlsEnableableConfig, tls::PEM_START_MARKER, diff --git a/src/lib.rs b/src/lib.rs index b133205c844b9..8b726b0144b7a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,8 +121,8 @@ pub mod validate; pub mod vector_windows; pub use source_sender::SourceSender; -pub use vector_common::{shutdown, Error, Result}; pub use vector_core::{event, metrics, schema, tcp, tls}; +pub use vector_lib::{shutdown, Error, Result}; static APP_NAME_SLUG: std::sync::OnceLock = std::sync::OnceLock::new(); diff --git a/src/nats.rs b/src/nats.rs index 5d20516d49939..edcac86fd68db 100644 --- a/src/nats.rs +++ b/src/nats.rs @@ -1,7 +1,7 @@ use nkeys::error::Error as NKeysError; use snafu::{ResultExt, Snafu}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::tls::TlsEnableableConfig; diff --git a/src/sinks/appsignal/config.rs b/src/sinks/appsignal/config.rs index 7d85422fbccc2..94bcf770c32b7 100644 --- a/src/sinks/appsignal/config.rs +++ b/src/sinks/appsignal/config.rs @@ -2,12 +2,12 @@ use futures::FutureExt; use http::{header::AUTHORIZATION, Request, Uri}; use hyper::Body; use tower::ServiceBuilder; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::{ config::{proxy::ProxyConfig, AcknowledgementsConfig, DataType, Input}, tls::{MaybeTlsSettings, TlsEnableableConfig}, }; +use vector_lib::sensitive_string::SensitiveString; use crate::{ codecs::Transformer, diff --git a/src/sinks/appsignal/encoder.rs b/src/sinks/appsignal/encoder.rs index f56edd04c2f68..59731316ab66f 100644 --- a/src/sinks/appsignal/encoder.rs +++ b/src/sinks/appsignal/encoder.rs @@ -1,6 +1,6 @@ use serde_json::{json, Value}; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, event::Event, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use crate::{ codecs::Transformer, diff --git a/src/sinks/appsignal/request_builder.rs b/src/sinks/appsignal/request_builder.rs index 96c0cece7e6f4..83e9923461d2a 100644 --- a/src/sinks/appsignal/request_builder.rs +++ b/src/sinks/appsignal/request_builder.rs @@ -1,11 +1,11 @@ use bytes::Bytes; -use vector_common::{ +use vector_core::event::Event; +use vector_lib::{ byte_size_of::ByteSizeOf, finalization::{EventFinalizers, Finalizable}, request_metadata::{MetaDescriptive, RequestMetadata}, }; -use vector_core::event::Event; use crate::sinks::util::{ metadata::RequestMetadataBuilder, request_builder::EncodeResult, Compression, RequestBuilder, diff --git a/src/sinks/appsignal/service.rs b/src/sinks/appsignal/service.rs index 188972eae7963..e505ab1569c7c 100644 --- a/src/sinks/appsignal/service.rs +++ b/src/sinks/appsignal/service.rs @@ -9,7 +9,7 @@ use http::{header::AUTHORIZATION, Request, StatusCode, Uri}; use hyper::Body; use tower::{Service, ServiceExt}; -use vector_common::{ +use vector_lib::{ finalization::EventStatus, request_metadata::GroupedCountByteSize, request_metadata::MetaDescriptive, sensitive_string::SensitiveString, }; diff --git a/src/sinks/aws_cloudwatch_logs/request_builder.rs b/src/sinks/aws_cloudwatch_logs/request_builder.rs index 177a9ccc5a5e8..ac8d6a0367833 100644 --- a/src/sinks/aws_cloudwatch_logs/request_builder.rs +++ b/src/sinks/aws_cloudwatch_logs/request_builder.rs @@ -3,11 +3,11 @@ use std::num::NonZeroUsize; use bytes::BytesMut; use chrono::Utc; use tokio_util::codec::Encoder as _; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::{ event::{EventFinalizers, Finalizable}, ByteSizeOf, }; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use super::TemplateRenderingError; use crate::{ diff --git a/src/sinks/aws_cloudwatch_logs/service.rs b/src/sinks/aws_cloudwatch_logs/service.rs index 0df88c82bf565..5189563bac725 100644 --- a/src/sinks/aws_cloudwatch_logs/service.rs +++ b/src/sinks/aws_cloudwatch_logs/service.rs @@ -22,7 +22,7 @@ use tower::{ timeout::Timeout, Service, ServiceBuilder, ServiceExt, }; -use vector_common::{ +use vector_lib::{ finalization::EventStatus, request_metadata::{GroupedCountByteSize, MetaDescriptive}, }; diff --git a/src/sinks/aws_cloudwatch_logs/sink.rs b/src/sinks/aws_cloudwatch_logs/sink.rs index b734774bfbb9b..ff4e65bf9bc8c 100644 --- a/src/sinks/aws_cloudwatch_logs/sink.rs +++ b/src/sinks/aws_cloudwatch_logs/sink.rs @@ -4,8 +4,8 @@ use async_trait::async_trait; use chrono::{Duration, Utc}; use futures::{future, stream::BoxStream, StreamExt}; use tower::Service; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::{partition::Partitioner, sink::StreamSink}; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_stream::{BatcherSettings, DriverResponse}; use crate::{ diff --git a/src/sinks/aws_kinesis/request_builder.rs b/src/sinks/aws_kinesis/request_builder.rs index 0483dd01e318b..9e3d271e2388c 100644 --- a/src/sinks/aws_kinesis/request_builder.rs +++ b/src/sinks/aws_kinesis/request_builder.rs @@ -1,8 +1,8 @@ use std::{io, marker::PhantomData}; use bytes::Bytes; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::ByteSizeOf; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use super::{ record::Record, diff --git a/src/sinks/aws_s3/sink.rs b/src/sinks/aws_s3/sink.rs index c9849cf834e13..4c4f745fedd32 100644 --- a/src/sinks/aws_s3/sink.rs +++ b/src/sinks/aws_s3/sink.rs @@ -4,8 +4,8 @@ use bytes::Bytes; use chrono::Utc; use codecs::encoding::Framer; use uuid::Uuid; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::Finalizable; +use vector_lib::request_metadata::RequestMetadata; use crate::{ codecs::{Encoder, Transformer}, diff --git a/src/sinks/aws_s_s/request_builder.rs b/src/sinks/aws_s_s/request_builder.rs index fb977244e932c..afb4f1bf882f7 100644 --- a/src/sinks/aws_s_s/request_builder.rs +++ b/src/sinks/aws_s_s/request_builder.rs @@ -1,6 +1,6 @@ use bytes::Bytes; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::ByteSizeOf; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use crate::codecs::EncodingConfig; use crate::{ diff --git a/src/sinks/aws_s_s/service.rs b/src/sinks/aws_s_s/service.rs index 4d4d1f88832f1..5d02d0e2fff49 100644 --- a/src/sinks/aws_s_s/service.rs +++ b/src/sinks/aws_s_s/service.rs @@ -4,8 +4,8 @@ use std::task::{Context, Poll}; use aws_sdk_sqs::types::SdkError; use futures::future::BoxFuture; use tower::Service; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{event::EventStatus, ByteSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use vector_stream::DriverResponse; use super::{client::Client, request_builder::SendMessageEntry}; diff --git a/src/sinks/axiom.rs b/src/sinks/axiom.rs index e3213f3ea04ed..2e33da17b2071 100644 --- a/src/sinks/axiom.rs +++ b/src/sinks/axiom.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::{ config::{AcknowledgementsConfig, DataType, GenerateConfig, Input, SinkConfig, SinkContext}, diff --git a/src/sinks/azure_blob/config.rs b/src/sinks/azure_blob/config.rs index 2fb5287fa9ca3..01a7369dfdd81 100644 --- a/src/sinks/azure_blob/config.rs +++ b/src/sinks/azure_blob/config.rs @@ -3,8 +3,8 @@ use std::sync::Arc; use azure_storage_blobs::prelude::*; use codecs::{encoding::Framer, JsonSerializerConfig, NewlineDelimitedEncoderConfig}; use tower::ServiceBuilder; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use super::request_builder::AzureBlobRequestOptions; use crate::{ diff --git a/src/sinks/azure_blob/request_builder.rs b/src/sinks/azure_blob/request_builder.rs index 0ae3fb848d922..a12417ec5c684 100644 --- a/src/sinks/azure_blob/request_builder.rs +++ b/src/sinks/azure_blob/request_builder.rs @@ -2,8 +2,8 @@ use bytes::Bytes; use chrono::Utc; use codecs::encoding::Framer; use uuid::Uuid; -use vector_common::request_metadata::RequestMetadata; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::request_metadata::RequestMetadata; use crate::{ codecs::{Encoder, Transformer}, diff --git a/src/sinks/azure_blob/test.rs b/src/sinks/azure_blob/test.rs index d35606ac12938..3733a9b992926 100644 --- a/src/sinks/azure_blob/test.rs +++ b/src/sinks/azure_blob/test.rs @@ -4,8 +4,8 @@ use codecs::{ encoding::{Framer, FramingConfig}, NewlineDelimitedEncoder, TextSerializerConfig, }; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{partition::Partitioner, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use super::config::AzureBlobSinkConfig; use super::request_builder::AzureBlobRequestOptions; diff --git a/src/sinks/azure_common/config.rs b/src/sinks/azure_common/config.rs index 1fa8494221e3e..1d6fdf32e9258 100644 --- a/src/sinks/azure_common/config.rs +++ b/src/sinks/azure_common/config.rs @@ -8,7 +8,7 @@ use bytes::Bytes; use futures::FutureExt; use http::StatusCode; use snafu::Snafu; -use vector_common::{ +use vector_lib::{ json_size::JsonSize, request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}, }; diff --git a/src/sinks/azure_monitor_logs/config.rs b/src/sinks/azure_monitor_logs/config.rs index 7a48b88c7b82b..44a3ee2afd485 100644 --- a/src/sinks/azure_monitor_logs/config.rs +++ b/src/sinks/azure_monitor_logs/config.rs @@ -1,9 +1,9 @@ use lookup::{lookup_v2::OptionalValuePath, OwnedValuePath}; use openssl::{base64, pkey}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::{config::log_schema, schema}; +use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; use crate::{ diff --git a/src/sinks/blackhole/sink.rs b/src/sinks/blackhole/sink.rs index 09fb5f6353d94..9ed7164e44309 100644 --- a/src/sinks/blackhole/sink.rs +++ b/src/sinks/blackhole/sink.rs @@ -13,10 +13,10 @@ use tokio::{ sync::watch, time::{interval, sleep_until}, }; -use vector_common::internal_event::{ +use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ ByteSize, BytesSent, CountByteSize, EventsSent, InternalEventHandle as _, Output, Protocol, }; -use vector_core::EstimatedJsonEncodedSizeOf; use crate::{ event::{EventArray, EventContainer}, diff --git a/src/sinks/databend/integration_tests.rs b/src/sinks/databend/integration_tests.rs index 5438775a4d385..7bc592c843274 100644 --- a/src/sinks/databend/integration_tests.rs +++ b/src/sinks/databend/integration_tests.rs @@ -3,9 +3,9 @@ use std::collections::BTreeMap; use futures::future::ready; use futures::stream; -use vector_common::sensitive_string::SensitiveString; use vector_core::config::proxy::ProxyConfig; use vector_core::event::{BatchNotifier, BatchStatus, BatchStatusReceiver, Event, LogEvent}; +use vector_lib::sensitive_string::SensitiveString; use crate::sinks::util::test::load_sink; use crate::{ diff --git a/src/sinks/databend/request_builder.rs b/src/sinks/databend/request_builder.rs index 7636e43aa165a..ddbbff1e1f6e4 100644 --- a/src/sinks/databend/request_builder.rs +++ b/src/sinks/databend/request_builder.rs @@ -2,9 +2,9 @@ use std::io; use bytes::Bytes; use codecs::encoding::Framer; -use vector_common::finalization::{EventFinalizers, Finalizable}; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::Event; +use vector_lib::finalization::{EventFinalizers, Finalizable}; +use vector_lib::request_metadata::RequestMetadata; use crate::sinks::util::Compression; use crate::{ diff --git a/src/sinks/databend/service.rs b/src/sinks/databend/service.rs index 463c880749b3d..b76d366afd1ed 100644 --- a/src/sinks/databend/service.rs +++ b/src/sinks/databend/service.rs @@ -8,8 +8,8 @@ use rand::{thread_rng, Rng}; use rand_distr::Alphanumeric; use snafu::Snafu; use tower::Service; -use vector_common::finalization::{EventFinalizers, EventStatus, Finalizable}; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; +use vector_lib::finalization::{EventFinalizers, EventStatus, Finalizable}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use crate::{internal_events::EndpointBytesSent, sinks::util::retries::RetryLogic}; diff --git a/src/sinks/datadog/events/request_builder.rs b/src/sinks/datadog/events/request_builder.rs index bbb2c53e22fd7..ab770b0d8dc56 100644 --- a/src/sinks/datadog/events/request_builder.rs +++ b/src/sinks/datadog/events/request_builder.rs @@ -3,8 +3,8 @@ use std::{io, sync::Arc}; use bytes::Bytes; use codecs::JsonSerializerConfig; use lookup::lookup_v2::ConfigValuePath; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::ByteSizeOf; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use crate::{ codecs::{Encoder, TimestampFormat, Transformer}, diff --git a/src/sinks/datadog/events/service.rs b/src/sinks/datadog/events/service.rs index 89035116390db..a7254f20868b5 100644 --- a/src/sinks/datadog/events/service.rs +++ b/src/sinks/datadog/events/service.rs @@ -8,7 +8,7 @@ use futures::{ use http::Request; use hyper::Body; use tower::{Service, ServiceExt}; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive}; use vector_stream::DriverResponse; use crate::{ diff --git a/src/sinks/datadog/logs/service.rs b/src/sinks/datadog/logs/service.rs index 6c80fbc8a482d..94cdb6b276797 100644 --- a/src/sinks/datadog/logs/service.rs +++ b/src/sinks/datadog/logs/service.rs @@ -14,8 +14,8 @@ use hyper::Body; use indexmap::IndexMap; use tower::Service; use tracing::Instrument; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_core::event::{EventFinalizers, EventStatus, Finalizable}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use crate::{ diff --git a/src/sinks/datadog/metrics/encoder.rs b/src/sinks/datadog/metrics/encoder.rs index b93a19a008476..fdc4914e65aae 100644 --- a/src/sinks/datadog/metrics/encoder.rs +++ b/src/sinks/datadog/metrics/encoder.rs @@ -9,13 +9,13 @@ use bytes::{BufMut, Bytes}; use chrono::{DateTime, Utc}; use once_cell::sync::Lazy; use snafu::{ResultExt, Snafu}; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{ config::{log_schema, telemetry, LogSchema}, event::{metric::MetricSketch, DatadogMetricOriginMetadata, Metric, MetricTags, MetricValue}, metrics::AgentDDSketch, EstimatedJsonEncodedSizeOf, }; +use vector_lib::request_metadata::GroupedCountByteSize; use super::config::{ DatadogMetricsEndpoint, SeriesApiVersion, MAXIMUM_PAYLOAD_COMPRESSED_SIZE, MAXIMUM_PAYLOAD_SIZE, diff --git a/src/sinks/datadog/metrics/request_builder.rs b/src/sinks/datadog/metrics/request_builder.rs index f84c95d482669..e4fb34a9fa0c3 100644 --- a/src/sinks/datadog/metrics/request_builder.rs +++ b/src/sinks/datadog/metrics/request_builder.rs @@ -1,8 +1,8 @@ use bytes::Bytes; use snafu::Snafu; use std::sync::Arc; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::{EventFinalizers, Finalizable, Metric}; +use vector_lib::request_metadata::RequestMetadata; use super::{ config::{DatadogMetricsEndpoint, DatadogMetricsEndpointConfiguration}, diff --git a/src/sinks/datadog/metrics/service.rs b/src/sinks/datadog/metrics/service.rs index f51728cb2cf18..e73f85c0c70ed 100644 --- a/src/sinks/datadog/metrics/service.rs +++ b/src/sinks/datadog/metrics/service.rs @@ -10,8 +10,8 @@ use http::{ use hyper::Body; use snafu::ResultExt; use tower::Service; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_core::event::{EventFinalizers, EventStatus, Finalizable}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use crate::{ diff --git a/src/sinks/datadog/mod.rs b/src/sinks/datadog/mod.rs index 40dbc42428ffa..745495dcc3a16 100644 --- a/src/sinks/datadog/mod.rs +++ b/src/sinks/datadog/mod.rs @@ -2,9 +2,9 @@ use futures_util::FutureExt; use http::{Request, StatusCode, Uri}; use hyper::body::Body; use snafu::Snafu; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::{config::AcknowledgementsConfig, tls::TlsEnableableConfig}; +use vector_lib::sensitive_string::SensitiveString; use crate::{ common::datadog::{get_api_base_endpoint, get_base_domain_region, Region, DD_US_SITE}, diff --git a/src/sinks/datadog/traces/apm_stats/flusher.rs b/src/sinks/datadog/traces/apm_stats/flusher.rs index d8a670473fc18..d1ee1e73e949b 100644 --- a/src/sinks/datadog/traces/apm_stats/flusher.rs +++ b/src/sinks/datadog/traces/apm_stats/flusher.rs @@ -6,7 +6,7 @@ use std::{ use bytes::Bytes; use snafu::ResultExt; use tokio::sync::oneshot::{Receiver, Sender}; -use vector_common::{finalization::EventFinalizers, request_metadata::RequestMetadata}; +use vector_lib::{finalization::EventFinalizers, request_metadata::RequestMetadata}; use super::{ aggregation::Aggregator, build_request, DDTracesMetadata, DatadogTracesEndpoint, diff --git a/src/sinks/datadog/traces/request_builder.rs b/src/sinks/datadog/traces/request_builder.rs index 01ec1742a381e..4fea8d4468724 100644 --- a/src/sinks/datadog/traces/request_builder.rs +++ b/src/sinks/datadog/traces/request_builder.rs @@ -8,8 +8,8 @@ use std::{ use bytes::Bytes; use prost::Message; use snafu::Snafu; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::{EventFinalizers, Finalizable}; +use vector_lib::request_metadata::RequestMetadata; use vrl::event_path; use super::{ diff --git a/src/sinks/datadog/traces/service.rs b/src/sinks/datadog/traces/service.rs index 01f820f841431..5e305e906952c 100644 --- a/src/sinks/datadog/traces/service.rs +++ b/src/sinks/datadog/traces/service.rs @@ -9,8 +9,8 @@ use http::{Request, StatusCode, Uri}; use hyper::Body; use snafu::ResultExt; use tower::Service; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_core::event::{EventFinalizers, EventStatus, Finalizable}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use crate::{ diff --git a/src/sinks/elasticsearch/encoder.rs b/src/sinks/elasticsearch/encoder.rs index cdee7812097e6..53925277295f3 100644 --- a/src/sinks/elasticsearch/encoder.rs +++ b/src/sinks/elasticsearch/encoder.rs @@ -2,12 +2,12 @@ use std::{io, io::Write}; use serde::Serialize; use vector_buffers::EventCount; -use vector_common::{ +use vector_core::{config::telemetry, event::Event, ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::{ internal_event::TaggedEventsSent, json_size::JsonSize, request_metadata::{GetEventCountTags, GroupedCountByteSize}, }; -use vector_core::{config::telemetry, event::Event, ByteSizeOf, EstimatedJsonEncodedSizeOf}; use crate::{ codecs::Transformer, diff --git a/src/sinks/elasticsearch/mod.rs b/src/sinks/elasticsearch/mod.rs index 4f4502d39c286..687a79023594c 100644 --- a/src/sinks/elasticsearch/mod.rs +++ b/src/sinks/elasticsearch/mod.rs @@ -21,8 +21,8 @@ pub use config::*; pub use encoder::ElasticsearchEncoder; use http::{uri::InvalidUri, Request}; use snafu::Snafu; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use crate::{ event::{EventRef, LogEvent}, diff --git a/src/sinks/elasticsearch/request_builder.rs b/src/sinks/elasticsearch/request_builder.rs index c5918df6e384c..0fbbf465e1e74 100644 --- a/src/sinks/elasticsearch/request_builder.rs +++ b/src/sinks/elasticsearch/request_builder.rs @@ -1,6 +1,6 @@ use bytes::Bytes; -use vector_common::{json_size::JsonSize, request_metadata::RequestMetadata}; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::{json_size::JsonSize, request_metadata::RequestMetadata}; use crate::{ event::{EventFinalizers, Finalizable}, diff --git a/src/sinks/elasticsearch/retry.rs b/src/sinks/elasticsearch/retry.rs index bf40d1751f051..a97096542c724 100644 --- a/src/sinks/elasticsearch/retry.rs +++ b/src/sinks/elasticsearch/retry.rs @@ -160,7 +160,7 @@ mod tests { use bytes::Bytes; use http::Response; use similar_asserts::assert_eq; - use vector_common::{internal_event::CountByteSize, json_size::JsonSize}; + use vector_lib::{internal_event::CountByteSize, json_size::JsonSize}; use super::*; use crate::event::EventStatus; diff --git a/src/sinks/elasticsearch/service.rs b/src/sinks/elasticsearch/service.rs index 95bc4fdd1be60..9f466e582230c 100644 --- a/src/sinks/elasticsearch/service.rs +++ b/src/sinks/elasticsearch/service.rs @@ -9,11 +9,11 @@ use futures::future::BoxFuture; use http::{Response, Uri}; use hyper::{service::Service, Body, Request}; use tower::ServiceExt; -use vector_common::{ +use vector_core::ByteSizeOf; +use vector_lib::{ json_size::JsonSize, request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}, }; -use vector_core::ByteSizeOf; use vector_stream::DriverResponse; use super::{ElasticsearchCommon, ElasticsearchConfig}; diff --git a/src/sinks/gcp/chronicle_unstructured.rs b/src/sinks/gcp/chronicle_unstructured.rs index 3043cc2ba519c..76ce1324d18fc 100644 --- a/src/sinks/gcp/chronicle_unstructured.rs +++ b/src/sinks/gcp/chronicle_unstructured.rs @@ -12,7 +12,6 @@ use snafu::Snafu; use std::io; use tokio_util::codec::Encoder as _; use tower::{Service, ServiceBuilder}; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_config::configurable_component; use vector_core::{ config::{telemetry, AcknowledgementsConfig, Input}, @@ -20,6 +19,7 @@ use vector_core::{ sink::VectorSink, EstimatedJsonEncodedSizeOf, }; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vrl::value::Kind; use crate::{ diff --git a/src/sinks/gcp/cloud_storage.rs b/src/sinks/gcp/cloud_storage.rs index 45b051a87ca3d..9d2185f53ad79 100644 --- a/src/sinks/gcp/cloud_storage.rs +++ b/src/sinks/gcp/cloud_storage.rs @@ -10,9 +10,9 @@ use snafu::ResultExt; use snafu::Snafu; use tower::ServiceBuilder; use uuid::Uuid; -use vector_common::request_metadata::RequestMetadata; use vector_config::configurable_component; use vector_core::event::{EventFinalizers, Finalizable}; +use vector_lib::request_metadata::RequestMetadata; use crate::sinks::util::metadata::RequestMetadataBuilder; use crate::{ @@ -410,9 +410,9 @@ mod tests { use codecs::encoding::FramingConfig; use codecs::{JsonSerializerConfig, NewlineDelimitedEncoderConfig, TextSerializerConfig}; use futures_util::{future::ready, stream}; - use vector_common::request_metadata::GroupedCountByteSize; use vector_core::partition::Partitioner; use vector_core::EstimatedJsonEncodedSizeOf; + use vector_lib::request_metadata::GroupedCountByteSize; use crate::event::LogEvent; use crate::test_util::{ diff --git a/src/sinks/gcs_common/service.rs b/src/sinks/gcs_common/service.rs index 455df2eb919fe..3271e28755161 100644 --- a/src/sinks/gcs_common/service.rs +++ b/src/sinks/gcs_common/service.rs @@ -8,7 +8,7 @@ use http::{ }; use hyper::Body; use tower::Service; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use crate::{ diff --git a/src/sinks/greptimedb/mod.rs b/src/sinks/greptimedb/mod.rs index af0588e34b12b..ab1d132adc98b 100644 --- a/src/sinks/greptimedb/mod.rs +++ b/src/sinks/greptimedb/mod.rs @@ -21,7 +21,7 @@ //! use greptimedb_client::Client; use snafu::Snafu; -use vector_common::sensitive_string::SensitiveString; +use vector_lib::sensitive_string::SensitiveString; use crate::sinks::prelude::*; diff --git a/src/sinks/honeycomb/config.rs b/src/sinks/honeycomb/config.rs index 0a53bf16369cc..6dda01074f7f0 100644 --- a/src/sinks/honeycomb/config.rs +++ b/src/sinks/honeycomb/config.rs @@ -3,7 +3,7 @@ use bytes::Bytes; use futures::FutureExt; use http::{Request, StatusCode, Uri}; -use vector_common::sensitive_string::SensitiveString; +use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; use crate::{ diff --git a/src/sinks/honeycomb/service.rs b/src/sinks/honeycomb/service.rs index 57eda27501558..3e97c981382b6 100644 --- a/src/sinks/honeycomb/service.rs +++ b/src/sinks/honeycomb/service.rs @@ -2,7 +2,7 @@ use bytes::Bytes; use http::{Request, Uri}; -use vector_common::sensitive_string::SensitiveString; +use vector_lib::sensitive_string::SensitiveString; use crate::sinks::util::http::HttpServiceRequestBuilder; diff --git a/src/sinks/humio/logs.rs b/src/sinks/humio/logs.rs index bdfddfda59f2e..a8f55d4c6c3d4 100644 --- a/src/sinks/humio/logs.rs +++ b/src/sinks/humio/logs.rs @@ -1,7 +1,7 @@ use codecs::JsonSerializerConfig; use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use super::config_host_key; use crate::sinks::splunk_hec::common::config_timestamp_key; diff --git a/src/sinks/humio/metrics.rs b/src/sinks/humio/metrics.rs index 1142206e1dfdf..2b9248eb26f85 100644 --- a/src/sinks/humio/metrics.rs +++ b/src/sinks/humio/metrics.rs @@ -4,9 +4,9 @@ use futures::StreamExt; use futures_util::stream::BoxStream; use indoc::indoc; use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::sink::StreamSink; +use vector_lib::sensitive_string::SensitiveString; use super::{ config_host_key, diff --git a/src/sinks/influxdb/mod.rs b/src/sinks/influxdb/mod.rs index a2b322c74ddf8..090fdc4f46518 100644 --- a/src/sinks/influxdb/mod.rs +++ b/src/sinks/influxdb/mod.rs @@ -9,9 +9,9 @@ use futures::FutureExt; use http::{StatusCode, Uri}; use snafu::{ResultExt, Snafu}; use tower::Service; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::event::MetricTags; +use vector_lib::sensitive_string::SensitiveString; use crate::http::HttpClient; diff --git a/src/sinks/loki/integration_tests.rs b/src/sinks/loki/integration_tests.rs index f93828b353956..20d4e2441a50e 100644 --- a/src/sinks/loki/integration_tests.rs +++ b/src/sinks/loki/integration_tests.rs @@ -5,11 +5,11 @@ use bytes::Bytes; use chrono::{DateTime, Duration, Utc}; use futures::stream; use lookup::owned_value_path; -use vector_common::encode_logfmt; use vector_core::{ config::{init_telemetry, LogNamespace, Tags, Telemetry}, event::{BatchNotifier, BatchStatus, Event, LogEvent}, }; +use vector_lib::encode_logfmt; use vrl::value::{kind::Collection, Kind}; use super::config::{LokiConfig, OutOfOrderAction}; diff --git a/src/sinks/mezmo.rs b/src/sinks/mezmo.rs index 25999e73163f0..b25864db37134 100644 --- a/src/sinks/mezmo.rs +++ b/src/sinks/mezmo.rs @@ -4,8 +4,8 @@ use bytes::Bytes; use futures::{FutureExt, SinkExt}; use http::{Request, StatusCode, Uri}; use serde_json::json; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use vrl::event_path; use vrl::value::{Kind, Value}; diff --git a/src/sinks/new_relic/config.rs b/src/sinks/new_relic/config.rs index af892849f0964..6ac338929a0aa 100644 --- a/src/sinks/new_relic/config.rs +++ b/src/sinks/new_relic/config.rs @@ -2,7 +2,7 @@ use std::{fmt::Debug, sync::Arc}; use http::Uri; use tower::ServiceBuilder; -use vector_common::sensitive_string::SensitiveString; +use vector_lib::sensitive_string::SensitiveString; use super::{ healthcheck, NewRelicApiResponse, NewRelicApiService, NewRelicEncoder, NewRelicSink, diff --git a/src/sinks/new_relic/encoding.rs b/src/sinks/new_relic/encoding.rs index f058161d20fb9..f103369c89cde 100644 --- a/src/sinks/new_relic/encoding.rs +++ b/src/sinks/new_relic/encoding.rs @@ -1,8 +1,8 @@ use std::{io, sync::Arc}; use serde::Serialize; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, event::Event, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use super::{ EventsApiModel, LogsApiModel, MetricsApiModel, NewRelicApi, NewRelicApiModel, diff --git a/src/sinks/new_relic/model.rs b/src/sinks/new_relic/model.rs index 5a8b2fc800897..1014d3c54925a 100644 --- a/src/sinks/new_relic/model.rs +++ b/src/sinks/new_relic/model.rs @@ -8,7 +8,7 @@ use std::{ use chrono::{DateTime, Utc}; use ordered_float::NotNan; use serde::{Deserialize, Serialize}; -use vector_common::internal_event::{ComponentEventsDropped, INTENTIONAL, UNINTENTIONAL}; +use vector_lib::internal_event::{ComponentEventsDropped, INTENTIONAL, UNINTENTIONAL}; use vrl::event_path; use super::NewRelicSinkError; diff --git a/src/sinks/prelude.rs b/src/sinks/prelude.rs index 100811537062c..1d20c67edfc7b 100644 --- a/src/sinks/prelude.rs +++ b/src/sinks/prelude.rs @@ -5,12 +5,6 @@ pub use async_trait::async_trait; pub use futures::{future, future::BoxFuture, stream::BoxStream, FutureExt, StreamExt}; pub use tower::{Service, ServiceBuilder}; pub use vector_buffers::EventCount; -pub use vector_common::{ - finalization::{EventFinalizers, EventStatus, Finalizable}, - internal_event::{CountByteSize, TaggedEventsSent}, - json_size::JsonSize, - request_metadata::{GetEventCountTags, GroupedCountByteSize, MetaDescriptive, RequestMetadata}, -}; pub use vector_config::configurable_component; pub use vector_core::{ config::{telemetry, AcknowledgementsConfig, Input}, @@ -21,6 +15,12 @@ pub use vector_core::{ tls::TlsSettings, ByteSizeOf, EstimatedJsonEncodedSizeOf, }; +pub use vector_lib::{ + finalization::{EventFinalizers, EventStatus, Finalizable}, + internal_event::{CountByteSize, TaggedEventsSent}, + json_size::JsonSize, + request_metadata::{GetEventCountTags, GroupedCountByteSize, MetaDescriptive, RequestMetadata}, +}; pub use vector_stream::{BatcherSettings, DriverResponse}; pub use crate::{ diff --git a/src/sinks/prometheus/exporter.rs b/src/sinks/prometheus/exporter.rs index 63a882e8dfa98..f71ad1c42fa85 100644 --- a/src/sinks/prometheus/exporter.rs +++ b/src/sinks/prometheus/exporter.rs @@ -608,14 +608,14 @@ mod tests { use indoc::indoc; use similar_asserts::assert_eq; use tokio::{sync::oneshot::error::TryRecvError, time}; - use vector_common::{ - finalization::{BatchNotifier, BatchStatus}, - sensitive_string::SensitiveString, - }; use vector_core::{ event::{MetricTags, StatisticKind}, metric_tags, samples, }; + use vector_lib::{ + finalization::{BatchNotifier, BatchStatus}, + sensitive_string::SensitiveString, + }; use super::*; use crate::{ diff --git a/src/sinks/prometheus/mod.rs b/src/sinks/prometheus/mod.rs index 2012397547ba9..dc1b3f1991db8 100644 --- a/src/sinks/prometheus/mod.rs +++ b/src/sinks/prometheus/mod.rs @@ -1,6 +1,6 @@ -use vector_common::sensitive_string::SensitiveString; #[cfg(test)] use vector_core::event::Metric; +use vector_lib::sensitive_string::SensitiveString; mod collector; pub(crate) mod exporter; diff --git a/src/sinks/prometheus/remote_write/sink.rs b/src/sinks/prometheus/remote_write/sink.rs index 1551f846ea92b..14545d58c4b57 100644 --- a/src/sinks/prometheus/remote_write/sink.rs +++ b/src/sinks/prometheus/remote_write/sink.rs @@ -1,7 +1,7 @@ use std::fmt; -use vector_common::byte_size_of::ByteSizeOf; use vector_core::event::Metric; +use vector_lib::byte_size_of::ByteSizeOf; use vector_stream::batcher::{data::BatchData, limiter::ByteSizeOfItemSize}; use crate::sinks::{prelude::*, util::buffer::metrics::MetricSet}; diff --git a/src/sinks/pulsar/config.rs b/src/sinks/pulsar/config.rs index ab53a350f32b5..71ea7c6efb521 100644 --- a/src/sinks/pulsar/config.rs +++ b/src/sinks/pulsar/config.rs @@ -17,8 +17,8 @@ use pulsar::{ }; use pulsar::{error::AuthenticationError, OperationRetryOptions}; use snafu::ResultExt; -use vector_common::sensitive_string::SensitiveString; use vector_core::config::DataType; +use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; /// Configuration for the `pulsar` sink. diff --git a/src/sinks/pulsar/encoder.rs b/src/sinks/pulsar/encoder.rs index e324c4b0ea376..fcd60dd2a4248 100644 --- a/src/sinks/pulsar/encoder.rs +++ b/src/sinks/pulsar/encoder.rs @@ -6,8 +6,8 @@ use crate::{ use bytes::BytesMut; use std::io; use tokio_util::codec::Encoder as _; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; #[derive(Clone, Debug)] pub(super) struct PulsarEncoder { diff --git a/src/sinks/redis/tests.rs b/src/sinks/redis/tests.rs index c9d148b4d823d..5b0bcc6a33a69 100644 --- a/src/sinks/redis/tests.rs +++ b/src/sinks/redis/tests.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use codecs::{JsonSerializerConfig, TextSerializerConfig}; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::event::LogEvent; +use vector_lib::request_metadata::GroupedCountByteSize; use super::{config::RedisSinkConfig, request_builder::encode_event}; use crate::{ diff --git a/src/sinks/s3_common/service.rs b/src/sinks/s3_common/service.rs index a13ebdfb001b1..d29bde4ea0c07 100644 --- a/src/sinks/s3_common/service.rs +++ b/src/sinks/s3_common/service.rs @@ -11,8 +11,8 @@ use futures::future::BoxFuture; use md5::Digest; use tower::Service; use tracing::Instrument; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_core::event::{EventFinalizers, EventStatus, Finalizable}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use super::config::S3Options; diff --git a/src/sinks/sematext/logs.rs b/src/sinks/sematext/logs.rs index e5ba64f7e9524..4c791b01c0568 100644 --- a/src/sinks/sematext/logs.rs +++ b/src/sinks/sematext/logs.rs @@ -1,8 +1,8 @@ use async_trait::async_trait; use futures::stream::{BoxStream, StreamExt}; use indoc::indoc; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use vrl::event_path; use super::Region; diff --git a/src/sinks/sematext/metrics.rs b/src/sinks/sematext/metrics.rs index 3e09630d556f6..2a5d20f3ca22c 100644 --- a/src/sinks/sematext/metrics.rs +++ b/src/sinks/sematext/metrics.rs @@ -6,9 +6,9 @@ use http::{StatusCode, Uri}; use hyper::{Body, Request}; use indoc::indoc; use tower::Service; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::{ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::sensitive_string::SensitiveString; use super::Region; use crate::{ diff --git a/src/sinks/splunk_hec/common/request.rs b/src/sinks/splunk_hec/common/request.rs index f1fc2366b6b30..9338f3fc883ab 100644 --- a/src/sinks/splunk_hec/common/request.rs +++ b/src/sinks/splunk_hec/common/request.rs @@ -1,11 +1,11 @@ use std::sync::Arc; use bytes::Bytes; -use vector_common::request_metadata::{MetaDescriptive, RequestMetadata}; use vector_core::{ event::{EventFinalizers, Finalizable}, ByteSizeOf, }; +use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata}; use crate::sinks::util::ElementCount; diff --git a/src/sinks/splunk_hec/common/response.rs b/src/sinks/splunk_hec/common/response.rs index 413d0b7f5e7f1..eb5e61153975c 100644 --- a/src/sinks/splunk_hec/common/response.rs +++ b/src/sinks/splunk_hec/common/response.rs @@ -1,5 +1,5 @@ -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::event::EventStatus; +use vector_lib::request_metadata::GroupedCountByteSize; use vector_stream::DriverResponse; pub struct HecResponse { diff --git a/src/sinks/splunk_hec/common/service.rs b/src/sinks/splunk_hec/common/service.rs index ce9b324c10fcd..9e1c99af7eb8e 100644 --- a/src/sinks/splunk_hec/common/service.rs +++ b/src/sinks/splunk_hec/common/service.rs @@ -13,8 +13,8 @@ use tokio::sync::{mpsc, oneshot, OwnedSemaphorePermit, Semaphore}; use tokio_util::sync::PollSemaphore; use tower::Service; use uuid::Uuid; -use vector_common::request_metadata::MetaDescriptive; use vector_core::event::EventStatus; +use vector_lib::request_metadata::MetaDescriptive; use super::{ acknowledgements::{run_acknowledgements, HecClientAcknowledgementsConfig}, @@ -282,11 +282,11 @@ mod tests { use bytes::Bytes; use futures_util::{poll, stream::FuturesUnordered, StreamExt}; use tower::{util::BoxService, Service, ServiceExt}; - use vector_common::internal_event::CountByteSize; use vector_core::{ config::proxy::ProxyConfig, event::{EventFinalizers, EventStatus}, }; + use vector_lib::internal_event::CountByteSize; use wiremock::{ matchers::{header, header_exists, method, path}, Mock, MockServer, Request, Respond, ResponseTemplate, diff --git a/src/sinks/splunk_hec/logs/config.rs b/src/sinks/splunk_hec/logs/config.rs index ef056693bdc53..4d59ba1a20346 100644 --- a/src/sinks/splunk_hec/logs/config.rs +++ b/src/sinks/splunk_hec/logs/config.rs @@ -4,9 +4,9 @@ use codecs::TextSerializerConfig; use futures_util::FutureExt; use lookup::lookup_v2::{ConfigValuePath, OptionalValuePath}; use tower::ServiceBuilder; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::sink::VectorSink; +use vector_lib::sensitive_string::SensitiveString; use super::{encoder::HecLogsEncoder, request_builder::HecLogsRequestBuilder, sink::HecLogsSink}; use crate::sinks::splunk_hec::common::config_timestamp_key; diff --git a/src/sinks/splunk_hec/logs/encoder.rs b/src/sinks/splunk_hec/logs/encoder.rs index 0f0270ce28a42..70fc861da9c73 100644 --- a/src/sinks/splunk_hec/logs/encoder.rs +++ b/src/sinks/splunk_hec/logs/encoder.rs @@ -3,8 +3,8 @@ use std::borrow::Cow; use bytes::BytesMut; use serde::Serialize; use tokio_util::codec::Encoder as _; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use super::sink::HecProcessedEvent; use crate::{ diff --git a/src/sinks/splunk_hec/logs/request_builder.rs b/src/sinks/splunk_hec/logs/request_builder.rs index 0a6ea5cd57fb0..c03b13725f29a 100644 --- a/src/sinks/splunk_hec/logs/request_builder.rs +++ b/src/sinks/splunk_hec/logs/request_builder.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use bytes::Bytes; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::{EventFinalizers, Finalizable}; +use vector_lib::request_metadata::RequestMetadata; use super::{ encoder::HecLogsEncoder, diff --git a/src/sinks/splunk_hec/metrics/config.rs b/src/sinks/splunk_hec/metrics/config.rs index 96c1c645fb7ae..cf73e6102aea2 100644 --- a/src/sinks/splunk_hec/metrics/config.rs +++ b/src/sinks/splunk_hec/metrics/config.rs @@ -3,9 +3,9 @@ use std::sync::Arc; use futures_util::FutureExt; use lookup::lookup_v2::OptionalValuePath; use tower::ServiceBuilder; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::sink::VectorSink; +use vector_lib::sensitive_string::SensitiveString; use super::{request_builder::HecMetricsRequestBuilder, sink::HecMetricsSink}; use crate::{ diff --git a/src/sinks/splunk_hec/metrics/encoder.rs b/src/sinks/splunk_hec/metrics/encoder.rs index 5b0198825f9eb..d96a801a96242 100644 --- a/src/sinks/splunk_hec/metrics/encoder.rs +++ b/src/sinks/splunk_hec/metrics/encoder.rs @@ -1,8 +1,8 @@ use std::{collections::BTreeMap, iter}; use serde::Serialize; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use super::sink::HecProcessedEvent; use crate::{internal_events::SplunkEventEncodeError, sinks::util::encoding::Encoder}; diff --git a/src/sinks/splunk_hec/metrics/request_builder.rs b/src/sinks/splunk_hec/metrics/request_builder.rs index 46489da12c5ff..aa1cc9aef48a7 100644 --- a/src/sinks/splunk_hec/metrics/request_builder.rs +++ b/src/sinks/splunk_hec/metrics/request_builder.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use bytes::Bytes; -use vector_common::request_metadata::RequestMetadata; use vector_core::event::{EventFinalizers, Finalizable}; +use vector_lib::request_metadata::RequestMetadata; use super::{encoder::HecMetricsEncoder, sink::HecProcessedEvent}; use crate::sinks::{ diff --git a/src/sinks/statsd/config.rs b/src/sinks/statsd/config.rs index 6e0b88699687a..f580ee77abff4 100644 --- a/src/sinks/statsd/config.rs +++ b/src/sinks/statsd/config.rs @@ -1,12 +1,12 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use async_trait::async_trait; -use vector_common::internal_event::Protocol; use vector_config::{component::GenerateConfig, configurable_component}; use vector_core::{ config::{AcknowledgementsConfig, Input}, sink::VectorSink, }; +use vector_lib::internal_event::Protocol; use crate::{ config::{SinkConfig, SinkContext}, diff --git a/src/sinks/statsd/encoder.rs b/src/sinks/statsd/encoder.rs index c75661cb97a30..fe3464b6caa1c 100644 --- a/src/sinks/statsd/encoder.rs +++ b/src/sinks/statsd/encoder.rs @@ -241,7 +241,7 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(input, output.remove(0)); + vector_lib::assert_event_data_eq!(input, output.remove(0)); } #[cfg(feature = "sources-statsd")] @@ -271,7 +271,7 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(input, output.remove(0)); + vector_lib::assert_event_data_eq!(input, output.remove(0)); } #[cfg(feature = "sources-statsd")] @@ -286,7 +286,7 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(input, output.remove(0)); + vector_lib::assert_event_data_eq!(input, output.remove(0)); } #[cfg(feature = "sources-statsd")] @@ -314,7 +314,7 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(expected, output.remove(0)); + vector_lib::assert_event_data_eq!(expected, output.remove(0)); } #[cfg(feature = "sources-statsd")] @@ -351,8 +351,8 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(expected1, output.remove(0)); - vector_common::assert_event_data_eq!(expected2, output.remove(0)); + vector_lib::assert_event_data_eq!(expected1, output.remove(0)); + vector_lib::assert_event_data_eq!(expected2, output.remove(0)); } #[cfg(feature = "sources-statsd")] @@ -369,6 +369,6 @@ mod tests { let frame = encode_metric(&input); let mut output = parse_encoded_metrics(&frame); - vector_common::assert_event_data_eq!(input, output.remove(0)); + vector_lib::assert_event_data_eq!(input, output.remove(0)); } } diff --git a/src/sinks/statsd/request_builder.rs b/src/sinks/statsd/request_builder.rs index 08034cb101f5b..75aad1bdd2ce4 100644 --- a/src/sinks/statsd/request_builder.rs +++ b/src/sinks/statsd/request_builder.rs @@ -3,12 +3,12 @@ use std::convert::Infallible; use bytes::BytesMut; use snafu::Snafu; use tokio_util::codec::Encoder; -use vector_common::request_metadata::RequestMetadata; use vector_core::{ config::telemetry, event::{EventFinalizers, Finalizable, Metric}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::request_metadata::RequestMetadata; use super::{encoder::StatsdEncoder, service::StatsdRequest}; use crate::{ diff --git a/src/sinks/statsd/service.rs b/src/sinks/statsd/service.rs index f04ac83ad9f8f..fa555a441cc2f 100644 --- a/src/sinks/statsd/service.rs +++ b/src/sinks/statsd/service.rs @@ -2,7 +2,7 @@ use std::task::{Context, Poll}; use futures_util::future::BoxFuture; use tower::Service; -use vector_common::{ +use vector_lib::{ finalization::{EventFinalizers, EventStatus, Finalizable}, request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}, }; diff --git a/src/sinks/statsd/sink.rs b/src/sinks/statsd/sink.rs index 3b79f177022ea..9c6a24859529d 100644 --- a/src/sinks/statsd/sink.rs +++ b/src/sinks/statsd/sink.rs @@ -6,8 +6,8 @@ use futures_util::{ StreamExt, }; use tower::Service; -use vector_common::internal_event::Protocol; use vector_core::{event::Event, sink::StreamSink}; +use vector_lib::internal_event::Protocol; use vector_stream::{BatcherSettings, DriverResponse}; use crate::sinks::util::SinkBuilderExt; diff --git a/src/sinks/util/adaptive_concurrency/controller.rs b/src/sinks/util/adaptive_concurrency/controller.rs index 19615f7ba2742..8f14408e2bac6 100644 --- a/src/sinks/util/adaptive_concurrency/controller.rs +++ b/src/sinks/util/adaptive_concurrency/controller.rs @@ -6,7 +6,7 @@ use std::{ use tokio::sync::OwnedSemaphorePermit; use tower::timeout::error::Elapsed; -use vector_common::internal_event::{InternalEventHandle as _, Registered}; +use vector_lib::internal_event::{InternalEventHandle as _, Registered}; use super::{instant_now, semaphore::ShrinkableSemaphore, AdaptiveConcurrencySettings}; #[cfg(test)] diff --git a/src/sinks/util/adaptive_concurrency/tests.rs b/src/sinks/util/adaptive_concurrency/tests.rs index 9c2cd0272215a..6c56b63eaff4f 100644 --- a/src/sinks/util/adaptive_concurrency/tests.rs +++ b/src/sinks/util/adaptive_concurrency/tests.rs @@ -25,8 +25,8 @@ use serde::Deserialize; use snafu::Snafu; use tokio::time::{self, sleep, Duration, Instant}; use tower::Service; -use vector_common::json_size::JsonSize; use vector_config::configurable_component; +use vector_lib::json_size::JsonSize; use super::controller::ControllerStatistics; use crate::{ diff --git a/src/sinks/util/batch.rs b/src/sinks/util/batch.rs index f0a9a896b8131..be9ac6b21c220 100644 --- a/src/sinks/util/batch.rs +++ b/src/sinks/util/batch.rs @@ -3,8 +3,8 @@ use std::{marker::PhantomData, num::NonZeroUsize, time::Duration}; use derivative::Derivative; use serde_with::serde_as; use snafu::Snafu; -use vector_common::json_size::JsonSize; use vector_config::configurable_component; +use vector_lib::json_size::JsonSize; use vector_stream::BatcherSettings; use super::EncodedEvent; diff --git a/src/sinks/util/buffer/mod.rs b/src/sinks/util/buffer/mod.rs index f0ab3dd6af8fb..25760b345388e 100644 --- a/src/sinks/util/buffer/mod.rs +++ b/src/sinks/util/buffer/mod.rs @@ -170,7 +170,7 @@ mod test { use bytes::{Buf, BytesMut}; use futures::{future, stream, SinkExt, StreamExt}; use tokio::time::Duration; - use vector_common::json_size::JsonSize; + use vector_lib::json_size::JsonSize; use super::{Buffer, Compression}; use crate::sinks::util::{BatchSettings, BatchSink, EncodedEvent}; diff --git a/src/sinks/util/encoding.rs b/src/sinks/util/encoding.rs index c5083ed601311..340183e547253 100644 --- a/src/sinks/util/encoding.rs +++ b/src/sinks/util/encoding.rs @@ -4,8 +4,8 @@ use bytes::BytesMut; use codecs::encoding::Framer; use itertools::{Itertools, Position}; use tokio_util::codec::Encoder as _; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use crate::{codecs::Transformer, event::Event, internal_events::EncoderWriteError}; @@ -150,8 +150,8 @@ mod tests { CharacterDelimitedEncoder, JsonSerializerConfig, NewlineDelimitedEncoder, TextSerializerConfig, }; - use vector_common::{internal_event::CountByteSize, json_size::JsonSize}; use vector_core::event::LogEvent; + use vector_lib::{internal_event::CountByteSize, json_size::JsonSize}; use vrl::value::Value; use super::*; diff --git a/src/sinks/util/metadata.rs b/src/sinks/util/metadata.rs index b9418c128244a..6a3a77403ae4f 100644 --- a/src/sinks/util/metadata.rs +++ b/src/sinks/util/metadata.rs @@ -1,7 +1,7 @@ use std::num::NonZeroUsize; -use vector_common::request_metadata::{GetEventCountTags, GroupedCountByteSize, RequestMetadata}; use vector_core::{config, ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::{GetEventCountTags, GroupedCountByteSize, RequestMetadata}; use super::request_builder::EncodeResult; diff --git a/src/sinks/util/mod.rs b/src/sinks/util/mod.rs index f5c09b97f380f..f0a233b7037e9 100644 --- a/src/sinks/util/mod.rs +++ b/src/sinks/util/mod.rs @@ -52,7 +52,7 @@ pub use service::{ pub use sink::{BatchSink, PartitionBatchSink, StreamSink}; use snafu::Snafu; pub use uri::UriSerde; -use vector_common::json_size::JsonSize; +use vector_lib::json_size::JsonSize; use crate::event::EventFinalizers; diff --git a/src/sinks/util/processed_event.rs b/src/sinks/util/processed_event.rs index 63b6ba8e1425b..46fd04a3cf7e4 100644 --- a/src/sinks/util/processed_event.rs +++ b/src/sinks/util/processed_event.rs @@ -1,11 +1,11 @@ use serde::Serialize; -use vector_common::{ - internal_event::TaggedEventsSent, json_size::JsonSize, request_metadata::GetEventCountTags, -}; use vector_core::{ event::{EventFinalizers, Finalizable, LogEvent, MaybeAsLogMut}, ByteSizeOf, EstimatedJsonEncodedSizeOf, }; +use vector_lib::{ + internal_event::TaggedEventsSent, json_size::JsonSize, request_metadata::GetEventCountTags, +}; /// An event alongside metadata from preprocessing. This is useful for sinks /// like Splunk HEC that process events prior to encoding. diff --git a/src/sinks/util/request_builder.rs b/src/sinks/util/request_builder.rs index 5ee5ea62423b3..2a553c0d5a529 100644 --- a/src/sinks/util/request_builder.rs +++ b/src/sinks/util/request_builder.rs @@ -1,7 +1,7 @@ use std::{io, num::NonZeroUsize}; use bytes::Bytes; -use vector_common::request_metadata::{GroupedCountByteSize, RequestMetadata}; +use vector_lib::request_metadata::{GroupedCountByteSize, RequestMetadata}; use super::{encoding::Encoder, metadata::RequestMetadataBuilder, Compression, Compressor}; diff --git a/src/sinks/util/service.rs b/src/sinks/util/service.rs index e9c1a2d61377e..18b14e5a74197 100644 --- a/src/sinks/util/service.rs +++ b/src/sinks/util/service.rs @@ -440,7 +440,7 @@ mod tests { use futures::{future, stream, FutureExt, SinkExt, StreamExt}; use tokio::time::Duration; - use vector_common::json_size::JsonSize; + use vector_lib::json_size::JsonSize; use super::*; use crate::sinks::util::{ diff --git a/src/sinks/util/sink.rs b/src/sinks/util/sink.rs index 2b318b4ef7ab1..b288eb20422fa 100644 --- a/src/sinks/util/sink.rs +++ b/src/sinks/util/sink.rs @@ -48,7 +48,7 @@ use tokio::{ }; use tower::{Service, ServiceBuilder}; use tracing::Instrument; -use vector_common::internal_event::{ +use vector_lib::internal_event::{ CallError, CountByteSize, EventsSent, InternalEventHandle as _, Output, }; // === StreamSink === @@ -576,7 +576,7 @@ mod tests { use bytes::Bytes; use futures::{future, stream, task::noop_waker_ref, SinkExt, StreamExt}; use tokio::{task::yield_now, time::Instant}; - use vector_common::{ + use vector_lib::{ finalization::{BatchNotifier, BatchStatus, EventFinalizer, EventFinalizers}, json_size::JsonSize, }; diff --git a/src/sinks/util/socket_bytes_sink.rs b/src/sinks/util/socket_bytes_sink.rs index 7d668c0201fb4..da453c0d155c7 100644 --- a/src/sinks/util/socket_bytes_sink.rs +++ b/src/sinks/util/socket_bytes_sink.rs @@ -10,7 +10,7 @@ use futures::Sink; use pin_project::{pin_project, pinned_drop}; use tokio::io::AsyncWrite; use tokio_util::codec::{BytesCodec, FramedWrite}; -use vector_common::{ +use vector_lib::{ finalization::{EventFinalizers, EventStatus}, json_size::JsonSize, }; diff --git a/src/sinks/util/tcp.rs b/src/sinks/util/tcp.rs index 1fd97fa744e99..b0372407f8890 100644 --- a/src/sinks/util/tcp.rs +++ b/src/sinks/util/tcp.rs @@ -17,9 +17,9 @@ use tokio::{ time::sleep, }; use tokio_util::codec::Encoder; -use vector_common::json_size::JsonSize; use vector_config::configurable_component; use vector_core::{ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::json_size::JsonSize; use crate::{ codecs::Transformer, diff --git a/src/sinks/util/udp.rs b/src/sinks/util/udp.rs index 4afc14871a979..1a31fb4d16569 100644 --- a/src/sinks/util/udp.rs +++ b/src/sinks/util/udp.rs @@ -10,11 +10,9 @@ use futures::{stream::BoxStream, FutureExt, StreamExt}; use snafu::{ResultExt, Snafu}; use tokio::{net::UdpSocket, time::sleep}; use tokio_util::codec::Encoder; -use vector_common::internal_event::{ - ByteSize, BytesSent, InternalEventHandle, Protocol, Registered, -}; use vector_config::configurable_component; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ByteSize, BytesSent, InternalEventHandle, Protocol, Registered}; use super::SinkBuildError; use crate::{ diff --git a/src/sinks/util/unix.rs b/src/sinks/util/unix.rs index c8a3a8b93603b..84c1b4746df83 100644 --- a/src/sinks/util/unix.rs +++ b/src/sinks/util/unix.rs @@ -6,9 +6,9 @@ use futures::{stream::BoxStream, SinkExt, StreamExt}; use snafu::{ResultExt, Snafu}; use tokio::{net::UnixStream, time::sleep}; use tokio_util::codec::Encoder; -use vector_common::json_size::JsonSize; use vector_config::configurable_component; use vector_core::{ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::json_size::JsonSize; use crate::{ codecs::Transformer, diff --git a/src/sinks/vector/service.rs b/src/sinks/vector/service.rs index 5e8b278866e02..87cd11fea3ec4 100644 --- a/src/sinks/vector/service.rs +++ b/src/sinks/vector/service.rs @@ -8,7 +8,7 @@ use hyper_proxy::ProxyConnector; use prost::Message; use tonic::{body::BoxBody, IntoRequest}; use tower::Service; -use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; +use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata}; use vector_stream::DriverResponse; use super::VectorSinkError; diff --git a/src/sinks/vector/sink.rs b/src/sinks/vector/sink.rs index 0375302b95b6c..89f8d93c90b2a 100644 --- a/src/sinks/vector/sink.rs +++ b/src/sinks/vector/sink.rs @@ -4,8 +4,8 @@ use async_trait::async_trait; use futures::{stream::BoxStream, StreamExt}; use prost::Message; use tower::Service; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::{config::telemetry, ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::request_metadata::GroupedCountByteSize; use vector_stream::{batcher::data::BatchReduce, BatcherSettings, DriverResponse}; use super::service::VectorRequest; diff --git a/src/sinks/webhdfs/test.rs b/src/sinks/webhdfs/test.rs index 7d4aa66e2e251..865980ae42b5b 100644 --- a/src/sinks/webhdfs/test.rs +++ b/src/sinks/webhdfs/test.rs @@ -1,7 +1,7 @@ use bytes::Bytes; use codecs::{encoding::Framer, JsonSerializerConfig, NewlineDelimitedEncoderConfig}; -use vector_common::request_metadata::GroupedCountByteSize; use vector_core::partition::Partitioner; +use vector_lib::request_metadata::GroupedCountByteSize; use super::config::WebHdfsConfig; use crate::{ diff --git a/src/source_sender/mod.rs b/src/source_sender/mod.rs index 97c4bfdedd83b..c13d56e96cabf 100644 --- a/src/source_sender/mod.rs +++ b/src/source_sender/mod.rs @@ -7,7 +7,6 @@ use futures::{Stream, StreamExt}; use metrics::{register_histogram, Histogram}; use tracing::Span; use vector_buffers::topology::channel::{self, LimitedReceiver, LimitedSender}; -use vector_common::internal_event::{ComponentEventsDropped, UNINTENTIONAL}; #[cfg(test)] use vector_core::event::{into_event_stream, EventStatus}; use vector_core::{ @@ -18,6 +17,7 @@ use vector_core::{ }, ByteSizeOf, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ComponentEventsDropped, UNINTENTIONAL}; use vrl::value::Value; mod errors; diff --git a/src/sources/amqp.rs b/src/sources/amqp.rs index 3b45a8cedd680..64dcbaebe87a2 100644 --- a/src/sources/amqp.rs +++ b/src/sources/amqp.rs @@ -24,16 +24,16 @@ use lookup::{lookup_v2::OptionalValuePath, metadata_path, owned_value_path, path use snafu::Snafu; use std::{io::Cursor, pin::Pin}; use tokio_util::codec::FramedRead; -use vector_common::{ - finalizer::UnorderedFinalizer, - internal_event::{CountByteSize, EventsReceived, InternalEventHandle as _}, -}; use vector_config::configurable_component; use vector_core::{ config::{log_schema, LegacyKey, LogNamespace, SourceAcknowledgementsConfig}, event::Event, EstimatedJsonEncodedSizeOf, }; +use vector_lib::{ + finalizer::UnorderedFinalizer, + internal_event::{CountByteSize, EventsReceived, InternalEventHandle as _}, +}; use vrl::value::Kind; #[derive(Debug, Snafu)] @@ -127,7 +127,7 @@ fn default_offset_key() -> OptionalValuePath { impl_generate_config_from_default!(AmqpSourceConfig); impl AmqpSourceConfig { - fn decoder(&self, log_namespace: LogNamespace) -> vector_common::Result { + fn decoder(&self, log_namespace: LogNamespace) -> vector_lib::Result { DecodingConfig::new(self.framing.clone(), self.decoding.clone(), log_namespace).build() } } diff --git a/src/sources/apache_metrics/parser.rs b/src/sources/apache_metrics/parser.rs index 754d0e7708793..a782b718d70a2 100644 --- a/src/sources/apache_metrics/parser.rs +++ b/src/sources/apache_metrics/parser.rs @@ -479,8 +479,8 @@ impl error::Error for ParseError { mod test { use chrono::{DateTime, Utc}; use similar_asserts::assert_eq; - use vector_common::assert_event_data_eq; use vector_core::metric_tags; + use vector_lib::assert_event_data_eq; use super::*; use crate::event::metric::{Metric, MetricKind, MetricValue}; diff --git a/src/sources/aws_ecs_metrics/mod.rs b/src/sources/aws_ecs_metrics/mod.rs index 09dc5f92c2b89..33f919ba084e3 100644 --- a/src/sources/aws_ecs_metrics/mod.rs +++ b/src/sources/aws_ecs_metrics/mod.rs @@ -5,9 +5,9 @@ use hyper::{Body, Client, Request}; use serde_with::serde_as; use tokio::time; use tokio_stream::wrappers::IntervalStream; -use vector_common::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vector_config::configurable_component; use vector_core::{config::LogNamespace, EstimatedJsonEncodedSizeOf}; +use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use crate::{ config::{GenerateConfig, SourceConfig, SourceContext, SourceOutput}, diff --git a/src/sources/aws_ecs_metrics/parser.rs b/src/sources/aws_ecs_metrics/parser.rs index 2d1bbf9def0b2..8dedf726d3458 100644 --- a/src/sources/aws_ecs_metrics/parser.rs +++ b/src/sources/aws_ecs_metrics/parser.rs @@ -560,8 +560,8 @@ pub(super) fn parse( #[cfg(test)] mod test { use chrono::{offset::TimeZone, DateTime, Timelike, Utc}; - use vector_common::assert_event_data_eq; use vector_core::metric_tags; + use vector_lib::assert_event_data_eq; use super::parse; use crate::event::metric::{Metric, MetricKind, MetricValue}; diff --git a/src/sources/aws_kinesis_firehose/filters.rs b/src/sources/aws_kinesis_firehose/filters.rs index b9d36a627aece..5c4e566913336 100644 --- a/src/sources/aws_kinesis_firehose/filters.rs +++ b/src/sources/aws_kinesis_firehose/filters.rs @@ -4,8 +4,8 @@ use bytes::{Buf, Bytes}; use chrono::Utc; use flate2::read::MultiGzDecoder; use snafu::ResultExt; -use vector_common::internal_event::{BytesReceived, Protocol}; use vector_core::config::LogNamespace; +use vector_lib::internal_event::{BytesReceived, Protocol}; use warp::{http::StatusCode, Filter}; use super::{ diff --git a/src/sources/aws_kinesis_firehose/handlers.rs b/src/sources/aws_kinesis_firehose/handlers.rs index 388e6187cd20f..af1e82a634ff0 100644 --- a/src/sources/aws_kinesis_firehose/handlers.rs +++ b/src/sources/aws_kinesis_firehose/handlers.rs @@ -9,17 +9,17 @@ use futures::StreamExt; use lookup::{metadata_path, path, PathPrefix}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; -use vector_common::{ - finalization::AddBatchNotifier, - internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Registered, - }, -}; use vector_core::{ config::{LegacyKey, LogNamespace}, event::BatchNotifier, EstimatedJsonEncodedSizeOf, }; +use vector_lib::{ + finalization::AddBatchNotifier, + internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Registered, + }, +}; use vrl::compiler::SecretTarget; use warp::reject; diff --git a/src/sources/aws_kinesis_firehose/mod.rs b/src/sources/aws_kinesis_firehose/mod.rs index add2787d48037..3ef3730d67b35 100644 --- a/src/sources/aws_kinesis_firehose/mod.rs +++ b/src/sources/aws_kinesis_firehose/mod.rs @@ -4,9 +4,9 @@ use codecs::decoding::{DeserializerConfig, FramingConfig}; use futures::FutureExt; use lookup::owned_value_path; use tracing::Span; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::config::{LegacyKey, LogNamespace}; +use vector_lib::sensitive_string::SensitiveString; use vrl::value::Kind; use warp::Filter; @@ -255,7 +255,7 @@ mod tests { use lookup::path; use similar_asserts::assert_eq; use tokio::time::{sleep, Duration}; - use vector_common::assert_event_data_eq; + use vector_lib::assert_event_data_eq; use vrl::value; use super::*; diff --git a/src/sources/aws_s3/sqs.rs b/src/sources/aws_s3/sqs.rs index a7f827c920b69..1a9154e6daffe 100644 --- a/src/sources/aws_s3/sqs.rs +++ b/src/sources/aws_s3/sqs.rs @@ -22,10 +22,10 @@ use snafu::{ResultExt, Snafu}; use tokio::{pin, select}; use tokio_util::codec::FramedRead; use tracing::Instrument; -use vector_common::internal_event::{ +use vector_config::configurable_component; +use vector_lib::internal_event::{ ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, }; -use vector_config::configurable_component; use crate::codecs::Decoder; use crate::event::{Event, LogEvent}; diff --git a/src/sources/aws_sqs/source.rs b/src/sources/aws_sqs/source.rs index 0f69b0740f8f1..28fc9dfc0cdef 100644 --- a/src/sources/aws_sqs/source.rs +++ b/src/sources/aws_sqs/source.rs @@ -8,9 +8,9 @@ use chrono::{DateTime, TimeZone, Utc}; use futures::{FutureExt, StreamExt}; use tokio::{pin, select}; use tracing_futures::Instrument; -use vector_common::finalizer::UnorderedFinalizer; -use vector_common::internal_event::{EventsReceived, Registered}; use vector_core::config::LogNamespace; +use vector_lib::finalizer::UnorderedFinalizer; +use vector_lib::internal_event::{EventsReceived, Registered}; use crate::{ codecs::Decoder, diff --git a/src/sources/datadog_agent/logs.rs b/src/sources/datadog_agent/logs.rs index b957487dcd3bc..47201917d986f 100644 --- a/src/sources/datadog_agent/logs.rs +++ b/src/sources/datadog_agent/logs.rs @@ -6,8 +6,8 @@ use codecs::StreamDecodingError; use http::StatusCode; use lookup::path; use tokio_util::codec::Decoder; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _}; use vector_core::{config::LegacyKey, EstimatedJsonEncodedSizeOf}; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; use warp::{filters::BoxedFilter, path as warp_path, path::FullPath, reply::Response, Filter}; use crate::{ diff --git a/src/sources/datadog_agent/metrics.rs b/src/sources/datadog_agent/metrics.rs index ee1c998c13ced..8912a2958e081 100644 --- a/src/sources/datadog_agent/metrics.rs +++ b/src/sources/datadog_agent/metrics.rs @@ -7,12 +7,12 @@ use prost::Message; use serde::{Deserialize, Serialize}; use warp::{filters::BoxedFilter, path, path::FullPath, reply::Response, Filter}; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use vector_core::{ event::{DatadogMetricOriginMetadata, EventMetadata}, metrics::AgentDDSketch, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use crate::{ common::datadog::{DatadogMetricType, DatadogSeriesMetric}, diff --git a/src/sources/datadog_agent/mod.rs b/src/sources/datadog_agent/mod.rs index becaf033a9bb1..d95920456b984 100644 --- a/src/sources/datadog_agent/mod.rs +++ b/src/sources/datadog_agent/mod.rs @@ -30,10 +30,10 @@ use regex::Regex; use serde::{Deserialize, Serialize}; use snafu::Snafu; use tracing::Span; -use vector_common::internal_event::{EventsReceived, Registered}; use vector_config::configurable_component; use vector_core::config::{LegacyKey, LogNamespace}; use vector_core::event::{BatchNotifier, BatchStatus}; +use vector_lib::internal_event::{EventsReceived, Registered}; use vrl::path::OwnedTargetPath; use vrl::value::Kind; use warp::{filters::BoxedFilter, reject::Rejection, reply::Response, Filter, Reply}; diff --git a/src/sources/datadog_agent/traces.rs b/src/sources/datadog_agent/traces.rs index c5daa9a4b2910..93f5be5208a69 100644 --- a/src/sources/datadog_agent/traces.rs +++ b/src/sources/datadog_agent/traces.rs @@ -9,8 +9,8 @@ use prost::Message; use vrl::event_path; use warp::{filters::BoxedFilter, path, path::FullPath, reply::Response, Filter, Rejection, Reply}; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _}; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; use crate::{ event::{Event, TraceEvent, Value}, diff --git a/src/sources/demo_logs.rs b/src/sources/demo_logs.rs index 1b391c553eb29..afe1eba364e60 100644 --- a/src/sources/demo_logs.rs +++ b/src/sources/demo_logs.rs @@ -12,14 +12,14 @@ use snafu::Snafu; use std::task::Poll; use tokio::time::{self, Duration}; use tokio_util::codec::FramedRead; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, -}; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, +}; use vrl::value::Kind; use crate::{ diff --git a/src/sources/dnstap/mod.rs b/src/sources/dnstap/mod.rs index c76fbc6f01450..aa57d66bcb635 100644 --- a/src/sources/dnstap/mod.rs +++ b/src/sources/dnstap/mod.rs @@ -3,10 +3,10 @@ use std::path::PathBuf; use base64::prelude::{Engine as _, BASE64_STANDARD}; use bytes::Bytes; use lookup::{owned_value_path, path, OwnedValuePath}; -use vector_common::internal_event::{ +use vector_config::configurable_component; +use vector_lib::internal_event::{ ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, }; -use vector_config::configurable_component; use vrl::path::PathPrefix; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/docker_logs/mod.rs b/src/sources/docker_logs/mod.rs index ba18aa07d012b..2cc85ec62724d 100644 --- a/src/sources/docker_logs/mod.rs +++ b/src/sources/docker_logs/mod.rs @@ -20,11 +20,11 @@ use once_cell::sync::Lazy; use serde_with::serde_as; use tokio::sync::mpsc; use tracing_futures::Instrument; -use vector_common::internal_event::{ - ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, -}; use vector_config::configurable_component; use vector_core::config::{LegacyKey, LogNamespace}; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, +}; use vrl::event_path; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/eventstoredb_metrics/mod.rs b/src/sources/eventstoredb_metrics/mod.rs index 7b15edff19035..2bd0e14c7f1a5 100644 --- a/src/sources/eventstoredb_metrics/mod.rs +++ b/src/sources/eventstoredb_metrics/mod.rs @@ -5,12 +5,12 @@ use http::Uri; use hyper::{Body, Request}; use serde_with::serde_as; use tokio_stream::wrappers::IntervalStream; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, -}; use vector_config::configurable_component; use vector_core::config::LogNamespace; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, +}; use self::types::Stats; use crate::{ diff --git a/src/sources/exec/mod.rs b/src/sources/exec/mod.rs index 1b43e05258d6b..567b7a6ff131b 100644 --- a/src/sources/exec/mod.rs +++ b/src/sources/exec/mod.rs @@ -21,9 +21,9 @@ use tokio::{ }; use tokio_stream::wrappers::IntervalStream; use tokio_util::codec::FramedRead; -use vector_common::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vector_config::configurable_component; use vector_core::{config::LegacyKey, EstimatedJsonEncodedSizeOf}; +use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vrl::path::OwnedValuePath; use vrl::value::Kind; diff --git a/src/sources/file.rs b/src/sources/file.rs index 6a4d2224db2d9..c59a1d947efa4 100644 --- a/src/sources/file.rs +++ b/src/sources/file.rs @@ -16,12 +16,12 @@ use serde_with::serde_as; use snafu::{ResultExt, Snafu}; use tokio::{sync::oneshot, task::spawn_blocking}; use tracing::{Instrument, Span}; -use vector_common::finalizer::OrderedFinalizer; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::finalizer::OrderedFinalizer; use vrl::value::Kind; use super::util::{EncodingConfig, MultilineConfig}; diff --git a/src/sources/file_descriptors/mod.rs b/src/sources/file_descriptors/mod.rs index 2d2ec2979c47e..24c5fec623860 100644 --- a/src/sources/file_descriptors/mod.rs +++ b/src/sources/file_descriptors/mod.rs @@ -10,15 +10,15 @@ use codecs::{ use futures::{channel::mpsc, executor, SinkExt, StreamExt}; use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use tokio_util::{codec::FramedRead, io::StreamReader}; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, -}; use vector_config::NamedComponent; use vector_core::{ config::{LegacyKey, LogNamespace}, event::Event, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, +}; use vrl::value::Kind; use crate::{ diff --git a/src/sources/fluent/mod.rs b/src/sources/fluent/mod.rs index d8d559cbefa1b..0e1ad42c08ce8 100644 --- a/src/sources/fluent/mod.rs +++ b/src/sources/fluent/mod.rs @@ -638,8 +638,8 @@ mod tests { time::{error::Elapsed, timeout, Duration}, }; use tokio_util::codec::Decoder; - use vector_common::assert_event_data_eq; use vector_core::{event::Value, schema::Definition}; + use vector_lib::assert_event_data_eq; use vrl::value::kind::Collection; use super::{message::FluentMessageOptions, *}; diff --git a/src/sources/gcp_pubsub.rs b/src/sources/gcp_pubsub.rs index 3f1e3b5f1f529..49a402f7e65ca 100644 --- a/src/sources/gcp_pubsub.rs +++ b/src/sources/gcp_pubsub.rs @@ -20,12 +20,12 @@ use tonic::{ transport::{Certificate, ClientTlsConfig, Endpoint, Identity}, Code, Request, Status, }; -use vector_common::internal_event::{ - ByteSize, BytesReceived, EventsReceived, InternalEventHandle as _, Protocol, Registered, -}; -use vector_common::{byte_size_of::ByteSizeOf, finalizer::UnorderedFinalizer}; use vector_config::configurable_component; use vector_core::config::{LegacyKey, LogNamespace}; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, EventsReceived, InternalEventHandle as _, Protocol, Registered, +}; +use vector_lib::{byte_size_of::ByteSizeOf, finalizer::UnorderedFinalizer}; use vrl::path; use vrl::value::{kind::Collection, Kind}; diff --git a/src/sources/host_metrics/mod.rs b/src/sources/host_metrics/mod.rs index 636169ccbf547..6f08abc45e01a 100644 --- a/src/sources/host_metrics/mod.rs +++ b/src/sources/host_metrics/mod.rs @@ -12,12 +12,12 @@ use heim::units::time::second; use serde_with::serde_as; use tokio::time; use tokio_stream::wrappers::IntervalStream; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, -}; use vector_config::configurable_component; use vector_core::config::LogNamespace; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, +}; use crate::{ config::{SourceConfig, SourceContext, SourceOutput}, diff --git a/src/sources/http_server.rs b/src/sources/http_server.rs index 8b5cfefcf57ae..479c02190f6da 100644 --- a/src/sources/http_server.rs +++ b/src/sources/http_server.rs @@ -52,7 +52,7 @@ impl GenerateConfig for HttpConfig { #[async_trait::async_trait] #[typetag::serde(name = "http")] impl SourceConfig for HttpConfig { - async fn build(&self, cx: SourceContext) -> vector_common::Result { + async fn build(&self, cx: SourceContext) -> vector_lib::Result { self.0.build(cx).await } diff --git a/src/sources/internal_metrics.rs b/src/sources/internal_metrics.rs index 6ae574436160a..fe15e09d57ec2 100644 --- a/src/sources/internal_metrics.rs +++ b/src/sources/internal_metrics.rs @@ -5,9 +5,9 @@ use lookup::lookup_v2::OptionalValuePath; use serde_with::serde_as; use tokio::time; use tokio_stream::wrappers::IntervalStream; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _}; use vector_config::configurable_component; use vector_core::{config::LogNamespace, ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; use crate::{ config::{log_schema, SourceConfig, SourceContext, SourceOutput}, diff --git a/src/sources/journald.rs b/src/sources/journald.rs index 2d7c7fd5b49d7..a9d4fb7e9fa8a 100644 --- a/src/sources/journald.rs +++ b/src/sources/journald.rs @@ -28,18 +28,18 @@ use tokio::{ time::sleep, }; use tokio_util::codec::FramedRead; -use vector_common::{ - finalizer::OrderedFinalizer, - internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, - }, -}; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, schema::Definition, EstimatedJsonEncodedSizeOf, }; +use vector_lib::{ + finalizer::OrderedFinalizer, + internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, + }, +}; use vrl::event_path; use vrl::value::{kind::Collection, Kind, Value}; diff --git a/src/sources/kafka.rs b/src/sources/kafka.rs index 6bcba0de51682..e8d5bdf019cfc 100644 --- a/src/sources/kafka.rs +++ b/src/sources/kafka.rs @@ -42,12 +42,12 @@ use tokio::{ }; use tokio_util::codec::FramedRead; -use vector_common::finalizer::OrderedFinalizer; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::finalizer::OrderedFinalizer; use vrl::value::{kind::Collection, Kind}; use crate::{ diff --git a/src/sources/kubernetes_logs/mod.rs b/src/sources/kubernetes_logs/mod.rs index 6bd20e9b77c93..9d5632a24aa76 100644 --- a/src/sources/kubernetes_logs/mod.rs +++ b/src/sources/kubernetes_logs/mod.rs @@ -26,12 +26,12 @@ use kube::{ use lifecycle::Lifecycle; use lookup::{lookup_v2::OptionalTargetPath, owned_value_path, path, OwnedTargetPath}; use serde_with::serde_as; -use vector_common::{ +use vector_config::configurable_component; +use vector_core::{config::LegacyKey, config::LogNamespace, EstimatedJsonEncodedSizeOf}; +use vector_lib::{ internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}, TimeZone, }; -use vector_config::configurable_component; -use vector_core::{config::LegacyKey, config::LogNamespace, EstimatedJsonEncodedSizeOf}; use vrl::value::{kind::Collection, Kind}; use crate::sources::kubernetes_logs::partial_events_merger::merge_partial_events; diff --git a/src/sources/kubernetes_logs/parser/cri.rs b/src/sources/kubernetes_logs/parser/cri.rs index a1c8f5dd24f16..044c5a0463c9b 100644 --- a/src/sources/kubernetes_logs/parser/cri.rs +++ b/src/sources/kubernetes_logs/parser/cri.rs @@ -1,8 +1,8 @@ use chrono::{DateTime, Utc}; use derivative::Derivative; use lookup::path; -use vector_common::conversion; use vector_core::config::{log_schema, LegacyKey, LogNamespace}; +use vector_lib::conversion; use crate::sources::kubernetes_logs::transform_utils::get_message_path; use crate::{ diff --git a/src/sources/nats.rs b/src/sources/nats.rs index a6fb139759fef..d6654846e23df 100644 --- a/src/sources/nats.rs +++ b/src/sources/nats.rs @@ -4,14 +4,14 @@ use futures::{pin_mut, StreamExt}; use lookup::{lookup_v2::OptionalValuePath, owned_value_path}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, EventsReceived, InternalEventHandle as _, Protocol, -}; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, EventsReceived, InternalEventHandle as _, Protocol, +}; use vrl::value::Kind; use crate::{ diff --git a/src/sources/opentelemetry/grpc.rs b/src/sources/opentelemetry/grpc.rs index 9916043520a3a..06c400626ea6b 100644 --- a/src/sources/opentelemetry/grpc.rs +++ b/src/sources/opentelemetry/grpc.rs @@ -3,12 +3,12 @@ use opentelemetry_proto::proto::collector::logs::v1::{ logs_service_server::LogsService, ExportLogsServiceRequest, ExportLogsServiceResponse, }; use tonic::{Request, Response, Status}; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use vector_core::{ config::LogNamespace, event::{BatchNotifier, BatchStatus, BatchStatusReceiver, Event}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use crate::{ internal_events::{EventsReceived, StreamClosedError}, diff --git a/src/sources/opentelemetry/http.rs b/src/sources/opentelemetry/http.rs index be7ebef83ef7a..8d914fb046281 100644 --- a/src/sources/opentelemetry/http.rs +++ b/src/sources/opentelemetry/http.rs @@ -9,14 +9,14 @@ use opentelemetry_proto::proto::collector::logs::v1::{ use prost::Message; use snafu::Snafu; use tracing::Span; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Registered, -}; use vector_core::{ config::LogNamespace, event::{BatchNotifier, BatchStatus}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Registered, +}; use warp::{filters::BoxedFilter, reject::Rejection, reply::Response, Filter, Reply}; use crate::{ diff --git a/src/sources/opentelemetry/mod.rs b/src/sources/opentelemetry/mod.rs index caeffa87e46d8..24624ac470efb 100644 --- a/src/sources/opentelemetry/mod.rs +++ b/src/sources/opentelemetry/mod.rs @@ -18,12 +18,12 @@ use opentelemetry_proto::convert::{ }; use opentelemetry_proto::proto::collector::logs::v1::logs_service_server::LogsServiceServer; -use vector_common::internal_event::{BytesReceived, EventsReceived, Protocol}; use vector_config::configurable_component; use vector_core::{ config::{log_schema, LegacyKey, LogNamespace}, schema::Definition, }; +use vector_lib::internal_event::{BytesReceived, EventsReceived, Protocol}; use vrl::value::{kind::Collection, Kind}; use self::{ diff --git a/src/sources/postgresql_metrics.rs b/src/sources/postgresql_metrics.rs index 25fefe02d7d57..64bef39a5eaa4 100644 --- a/src/sources/postgresql_metrics.rs +++ b/src/sources/postgresql_metrics.rs @@ -25,13 +25,13 @@ use tokio_postgres::{ Client, Config, Error as PgError, NoTls, Row, }; use tokio_stream::wrappers::IntervalStream; -use vector_common::{ - internal_event::{CountByteSize, InternalEventHandle as _, Registered}, - json_size::JsonSize, -}; use vector_config::configurable_component; use vector_core::config::LogNamespace; use vector_core::{metric_tags, ByteSizeOf, EstimatedJsonEncodedSizeOf}; +use vector_lib::{ + internal_event::{CountByteSize, InternalEventHandle as _, Registered}, + json_size::JsonSize, +}; use crate::{ config::{SourceConfig, SourceContext, SourceOutput}, diff --git a/src/sources/prometheus/parser.rs b/src/sources/prometheus/parser.rs index 36c5d8dc57ed3..4fe8ea4e3131c 100644 --- a/src/sources/prometheus/parser.rs +++ b/src/sources/prometheus/parser.rs @@ -137,8 +137,8 @@ mod test { use chrono::{TimeZone, Timelike, Utc}; use once_cell::sync::Lazy; use similar_asserts::assert_eq; - use vector_common::assert_event_data_eq; use vector_core::metric_tags; + use vector_lib::assert_event_data_eq; use super::*; use crate::event::metric::{Metric, MetricKind, MetricValue}; diff --git a/src/sources/prometheus/remote_write.rs b/src/sources/prometheus/remote_write.rs index 9a2e4356975b6..dcec68ade1e30 100644 --- a/src/sources/prometheus/remote_write.rs +++ b/src/sources/prometheus/remote_write.rs @@ -220,7 +220,7 @@ mod test { // put them back into order before comparing. output.sort_unstable_by_key(|event| event.as_metric().name().to_owned()); - vector_common::assert_event_data_eq!(events, output); + vector_lib::assert_event_data_eq!(events, output); } fn make_events() -> Vec { @@ -330,7 +330,7 @@ mod test { ) .await; - vector_common::assert_event_data_eq!(expected, output); + vector_lib::assert_event_data_eq!(expected, output); } } diff --git a/src/sources/redis/mod.rs b/src/sources/redis/mod.rs index 9dd343211c9ea..568a84701268c 100644 --- a/src/sources/redis/mod.rs +++ b/src/sources/redis/mod.rs @@ -8,14 +8,14 @@ use futures::StreamExt; use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath}; use snafu::{ResultExt, Snafu}; use tokio_util::codec::FramedRead; -use vector_common::internal_event::{ - ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, -}; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + ByteSize, BytesReceived, CountByteSize, InternalEventHandle as _, Protocol, Registered, +}; use vrl::value::Kind; use crate::{ diff --git a/src/sources/socket/udp.rs b/src/sources/socket/udp.rs index a2793a6bae0cd..4add14a1694e8 100644 --- a/src/sources/socket/udp.rs +++ b/src/sources/socket/udp.rs @@ -8,12 +8,12 @@ use futures::StreamExt; use listenfd::ListenFd; use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path}; use tokio_util::codec::FramedRead; -use vector_common::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use crate::{ codecs::Decoder, diff --git a/src/sources/socket/unix.rs b/src/sources/socket/unix.rs index 4d09e128a2c94..52a0b362dd6c2 100644 --- a/src/sources/socket/unix.rs +++ b/src/sources/socket/unix.rs @@ -4,9 +4,9 @@ use bytes::Bytes; use chrono::Utc; use codecs::decoding::{DeserializerConfig, FramingConfig}; use lookup::{lookup_v2::OptionalValuePath, path}; -use vector_common::shutdown::ShutdownSignal; use vector_config::configurable_component; use vector_core::config::{LegacyKey, LogNamespace}; +use vector_lib::shutdown::ShutdownSignal; use crate::{ codecs::Decoder, diff --git a/src/sources/splunk_hec/acknowledgements.rs b/src/sources/splunk_hec/acknowledgements.rs index 68a4980e0969b..644bd2eecea03 100644 --- a/src/sources/splunk_hec/acknowledgements.rs +++ b/src/sources/splunk_hec/acknowledgements.rs @@ -12,8 +12,8 @@ use futures::StreamExt; use roaring::RoaringTreemap; use serde::{Deserialize, Serialize}; use tokio::time::interval; -use vector_common::{finalization::BatchStatusReceiver, finalizer::UnorderedFinalizer}; use vector_config::configurable_component; +use vector_lib::{finalization::BatchStatusReceiver, finalizer::UnorderedFinalizer}; use warp::Rejection; use super::ApiError; diff --git a/src/sources/splunk_hec/mod.rs b/src/sources/splunk_hec/mod.rs index ac597caf2be06..1326cb48a234b 100644 --- a/src/sources/splunk_hec/mod.rs +++ b/src/sources/splunk_hec/mod.rs @@ -16,8 +16,6 @@ use serde::Serialize; use serde_json::{de::Read as JsonRead, Deserializer, Value as JsonValue}; use snafu::Snafu; use tracing::Span; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; use vector_core::{ config::{LegacyKey, LogNamespace}, @@ -25,6 +23,8 @@ use vector_core::{ schema::meaning, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; +use vector_lib::sensitive_string::SensitiveString; use vrl::value::{kind::Collection, Kind}; use warp::{filters::BoxedFilter, path, reject::Rejection, reply::Response, Filter, Reply}; @@ -1213,8 +1213,8 @@ mod tests { use futures_util::Stream; use reqwest::{RequestBuilder, Response}; use serde::Deserialize; - use vector_common::sensitive_string::SensitiveString; use vector_core::{event::EventStatus, schema::Definition}; + use vector_lib::sensitive_string::SensitiveString; use vrl::path::PathPrefix; use super::*; diff --git a/src/sources/statsd/mod.rs b/src/sources/statsd/mod.rs index e483578780c0b..df9227a3be956 100644 --- a/src/sources/statsd/mod.rs +++ b/src/sources/statsd/mod.rs @@ -13,9 +13,9 @@ use listenfd::ListenFd; use serde_with::serde_as; use smallvec::{smallvec, SmallVec}; use tokio_util::udp::UdpFramed; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use vector_config::configurable_component; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _, Registered}; use self::parser::ParseError; use super::util::net::{try_bind_udp_socket, SocketListenAddr, TcpNullAcker, TcpSource}; diff --git a/src/sources/statsd/parser.rs b/src/sources/statsd/parser.rs index a21a6e128dd53..8696726177dc2 100644 --- a/src/sources/statsd/parser.rs +++ b/src/sources/statsd/parser.rs @@ -197,7 +197,7 @@ impl fmt::Display for ParseError { } } -vector_common::impl_event_data_eq!(ParseError); +vector_lib::impl_event_data_eq!(ParseError); impl error::Error for ParseError {} @@ -215,8 +215,8 @@ impl From for ParseError { #[cfg(test)] mod test { - use vector_common::assert_event_data_eq; use vector_core::{event::metric::TagValue, metric_tags}; + use vector_lib::assert_event_data_eq; use super::{parse, sanitize_key, sanitize_sampling}; use crate::event::metric::{Metric, MetricKind, MetricValue, StatisticKind}; diff --git a/src/sources/syslog.rs b/src/sources/syslog.rs index 1418d77730d6f..7ab6c5586fa3b 100644 --- a/src/sources/syslog.rs +++ b/src/sources/syslog.rs @@ -448,8 +448,8 @@ mod test { use serde::Deserialize; use tokio::time::{sleep, Duration, Instant}; use tokio_util::codec::BytesCodec; - use vector_common::assert_event_data_eq; use vector_core::{config::ComponentKey, schema::Definition}; + use vector_lib::assert_event_data_eq; use vrl::value::{kind::Collection, Kind, Value}; use super::*; diff --git a/src/sources/util/grpc/decompression.rs b/src/sources/util/grpc/decompression.rs index bf23e1761b179..d57d773471574 100644 --- a/src/sources/util/grpc/decompression.rs +++ b/src/sources/util/grpc/decompression.rs @@ -18,7 +18,7 @@ use std::future::Future; use tokio::{pin, select}; use tonic::{body::BoxBody, metadata::AsciiMetadataValue, Status}; use tower::{Layer, Service}; -use vector_common::internal_event::{ +use vector_lib::internal_event::{ ByteSize, BytesReceived, InternalEventHandle as _, Protocol, Registered, }; diff --git a/src/sources/util/http/auth.rs b/src/sources/util/http/auth.rs index a75788cf42c04..4b3f47ca5bd10 100644 --- a/src/sources/util/http/auth.rs +++ b/src/sources/util/http/auth.rs @@ -1,8 +1,8 @@ use std::convert::TryFrom; use headers::{Authorization, HeaderMapExt}; -use vector_common::sensitive_string::SensitiveString; use vector_config::configurable_component; +use vector_lib::sensitive_string::SensitiveString; use warp::http::HeaderMap; #[cfg(any( diff --git a/src/sources/util/http_client.rs b/src/sources/util/http_client.rs index 25678a90ae344..2ec764f47b859 100644 --- a/src/sources/util/http_client.rs +++ b/src/sources/util/http_client.rs @@ -15,7 +15,7 @@ use hyper::{Body, Request}; use std::time::{Duration, Instant}; use std::{collections::HashMap, future::ready}; use tokio_stream::wrappers::IntervalStream; -use vector_common::json_size::JsonSize; +use vector_lib::json_size::JsonSize; use crate::{ http::{Auth, HttpClient}, @@ -27,8 +27,8 @@ use crate::{ tls::TlsSettings, SourceSender, }; -use vector_common::shutdown::ShutdownSignal; use vector_core::{config::proxy::ProxyConfig, event::Event, EstimatedJsonEncodedSizeOf}; +use vector_lib::shutdown::ShutdownSignal; /// Contains the inputs generic to any http client. pub(crate) struct GenericHttpClientInputs { diff --git a/src/sources/util/message_decoding.rs b/src/sources/util/message_decoding.rs index 379f8c1b09583..b1fdece0264a2 100644 --- a/src/sources/util/message_decoding.rs +++ b/src/sources/util/message_decoding.rs @@ -5,10 +5,10 @@ use chrono::{DateTime, Utc}; use codecs::StreamDecodingError; use lookup::{metadata_path, path, PathPrefix}; use tokio_util::codec::Decoder as _; -use vector_common::internal_event::{ +use vector_core::{config::LogNamespace, EstimatedJsonEncodedSizeOf}; +use vector_lib::internal_event::{ CountByteSize, EventsReceived, InternalEventHandle as _, Registered, }; -use vector_core::{config::LogNamespace, EstimatedJsonEncodedSizeOf}; use crate::{codecs::Decoder, config::log_schema, event::BatchNotifier, event::Event}; diff --git a/src/sources/util/net/tcp/mod.rs b/src/sources/util/net/tcp/mod.rs index a31ba249a172d..d72b8dd27d878 100644 --- a/src/sources/util/net/tcp/mod.rs +++ b/src/sources/util/net/tcp/mod.rs @@ -17,11 +17,11 @@ use tokio::{ }; use tokio_util::codec::{Decoder, FramedRead}; use tracing::Instrument; -use vector_common::finalization::AddBatchNotifier; use vector_core::{ config::{LegacyKey, LogNamespace, SourceAcknowledgementsConfig}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::finalization::AddBatchNotifier; use vrl::value::Value; use self::request_limiter::RequestLimiter; diff --git a/src/sources/util/unix_datagram.rs b/src/sources/util/unix_datagram.rs index aa5c957cad060..f452dddf334d1 100644 --- a/src/sources/util/unix_datagram.rs +++ b/src/sources/util/unix_datagram.rs @@ -6,8 +6,8 @@ use futures::StreamExt; use tokio::net::UnixDatagram; use tokio_util::codec::FramedRead; use tracing::field; -use vector_common::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use crate::{ codecs::Decoder, diff --git a/src/sources/util/unix_stream.rs b/src/sources/util/unix_stream.rs index 3748ae005be16..9a035b835d58e 100644 --- a/src/sources/util/unix_stream.rs +++ b/src/sources/util/unix_stream.rs @@ -11,8 +11,8 @@ use tokio::{ use tokio_stream::wrappers::UnixListenerStream; use tokio_util::codec::FramedRead; use tracing::{field, Instrument}; -use vector_common::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use vector_core::EstimatedJsonEncodedSizeOf; +use vector_lib::internal_event::{ByteSize, BytesReceived, InternalEventHandle as _, Protocol}; use super::AfterReadExt; use crate::{ diff --git a/src/sources/vector/mod.rs b/src/sources/vector/mod.rs index 7c680b4f9a49d..45fdd5113e7dd 100644 --- a/src/sources/vector/mod.rs +++ b/src/sources/vector/mod.rs @@ -5,13 +5,13 @@ use chrono::Utc; use codecs::NativeDeserializerConfig; use futures::TryFutureExt; use tonic::{Request, Response, Status}; -use vector_common::internal_event::{CountByteSize, InternalEventHandle as _}; use vector_config::configurable_component; use vector_core::{ config::LogNamespace, event::{BatchNotifier, BatchStatus, BatchStatusReceiver, Event}, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{CountByteSize, InternalEventHandle as _}; use crate::{ config::{ @@ -281,8 +281,8 @@ mod tests { sinks::vector::VectorConfig as SinkConfig, test_util, SourceSender, }; - use vector_common::assert_event_data_eq; use vector_core::config::log_schema; + use vector_lib::assert_event_data_eq; async fn run_test(vector_source_config_str: &str, addr: SocketAddr) { let config = format!(r#"address = "{}""#, addr); diff --git a/src/test_util/mock/sinks/basic.rs b/src/test_util/mock/sinks/basic.rs index a7463aace4f14..abd7faefe7824 100644 --- a/src/test_util/mock/sinks/basic.rs +++ b/src/test_util/mock/sinks/basic.rs @@ -2,13 +2,13 @@ use async_trait::async_trait; use futures_util::{stream::BoxStream, FutureExt, StreamExt}; use snafu::Snafu; use tokio::sync::oneshot; -use vector_common::finalization::Finalizable; use vector_config::configurable_component; use vector_core::{ config::{AcknowledgementsConfig, Input}, event::Event, sink::{StreamSink, VectorSink}, }; +use vector_lib::finalization::Finalizable; use crate::{ config::{SinkConfig, SinkContext}, diff --git a/src/topology/builder.rs b/src/topology/builder.rs index 9215848d6c224..a9659e6e84a1f 100644 --- a/src/topology/builder.rs +++ b/src/topology/builder.rs @@ -16,9 +16,6 @@ use tokio::{ time::{timeout, Duration}, }; use tracing::Instrument; -use vector_common::internal_event::{ - self, CountByteSize, EventsSent, InternalEventHandle as _, Registered, -}; use vector_core::config::LogNamespace; use vector_core::transform::update_runtime_schema_definition; use vector_core::{ @@ -32,6 +29,9 @@ use vector_core::{ schema::Definition, EstimatedJsonEncodedSizeOf, }; +use vector_lib::internal_event::{ + self, CountByteSize, EventsSent, InternalEventHandle as _, Registered, +}; use super::{ fanout::{self, Fanout}, diff --git a/src/topology/running.rs b/src/topology/running.rs index bb300dd7e5652..51b7fe5d519fd 100644 --- a/src/topology/running.rs +++ b/src/topology/running.rs @@ -13,7 +13,7 @@ use tokio::{ }; use tracing::Instrument; use vector_buffers::topology::channel::BufferSender; -use vector_common::trigger::DisabledTrigger; +use vector_lib::trigger::DisabledTrigger; use super::{TapOutput, TapResource}; use crate::{ diff --git a/src/topology/test/compliance.rs b/src/topology/test/compliance.rs index 8f4602aa1bba3..001fbbc422643 100644 --- a/src/topology/test/compliance.rs +++ b/src/topology/test/compliance.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use tokio::sync::oneshot::{channel, Receiver}; -use vector_common::config::ComponentKey; use vector_core::config::OutputId; use vector_core::event::{Event, EventArray, EventContainer, LogEvent}; +use vector_lib::config::ComponentKey; use crate::config::schema::Definition; use crate::{ diff --git a/src/topology/test/mod.rs b/src/topology/test/mod.rs index 5519c173b3345..ce2e3a96dda7d 100644 --- a/src/topology/test/mod.rs +++ b/src/topology/test/mod.rs @@ -27,8 +27,8 @@ use tokio::{ time::{sleep, Duration}, }; use vector_buffers::{BufferConfig, BufferType, WhenFull}; -use vector_common::config::ComponentKey; use vector_core::config::OutputId; +use vector_lib::config::ComponentKey; mod backpressure; mod compliance; diff --git a/src/transforms/aggregate.rs b/src/transforms/aggregate.rs index 797666d892883..bea73ed8dae0f 100644 --- a/src/transforms/aggregate.rs +++ b/src/transforms/aggregate.rs @@ -155,7 +155,7 @@ mod tests { use futures::stream; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; - use vector_common::config::ComponentKey; + use vector_lib::config::ComponentKey; use vrl::value::Kind; use super::*; diff --git a/src/transforms/aws_ec2_metadata.rs b/src/transforms/aws_ec2_metadata.rs index b79fbafccf7a4..0353ba846a97d 100644 --- a/src/transforms/aws_ec2_metadata.rs +++ b/src/transforms/aws_ec2_metadata.rs @@ -761,7 +761,7 @@ mod integration_tests { transforms::test::create_topology, }; use std::collections::BTreeMap; - use vector_common::assert_event_data_eq; + use vector_lib::assert_event_data_eq; use vrl::value::Value; use warp::Filter; diff --git a/src/transforms/dedupe.rs b/src/transforms/dedupe.rs index f0e31cd77f5b1..a24e2c81cea0d 100644 --- a/src/transforms/dedupe.rs +++ b/src/transforms/dedupe.rs @@ -298,8 +298,8 @@ mod tests { use lookup::lookup_v2::ConfigTargetPath; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; - use vector_common::config::ComponentKey; use vector_core::config::OutputId; + use vector_lib::config::ComponentKey; use crate::config::schema::Definition; use crate::{ diff --git a/src/transforms/filter.rs b/src/transforms/filter.rs index e14f0c7347ab7..7a195b3be1e68 100644 --- a/src/transforms/filter.rs +++ b/src/transforms/filter.rs @@ -1,6 +1,6 @@ -use vector_common::internal_event::{Count, InternalEventHandle as _, Registered}; use vector_config::configurable_component; use vector_core::config::{clone_input_definitions, LogNamespace}; +use vector_lib::internal_event::{Count, InternalEventHandle as _, Registered}; use crate::{ conditions::{AnyCondition, Condition}, @@ -100,8 +100,8 @@ mod test { use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; - use vector_common::config::ComponentKey; use vector_core::event::{Metric, MetricKind, MetricValue}; + use vector_lib::config::ComponentKey; use super::*; use crate::config::schema::Definition; diff --git a/src/transforms/log_to_metric.rs b/src/transforms/log_to_metric.rs index f6ba686e09de2..8bc0ed531a5e1 100644 --- a/src/transforms/log_to_metric.rs +++ b/src/transforms/log_to_metric.rs @@ -436,8 +436,8 @@ mod tests { use std::time::Duration; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; - use vector_common::config::ComponentKey; use vector_core::metric_tags; + use vector_lib::config::ComponentKey; #[test] fn generate_config() { diff --git a/src/transforms/metric_to_log.rs b/src/transforms/metric_to_log.rs index 40fd26fe2b932..a36ee54dea5d3 100644 --- a/src/transforms/metric_to_log.rs +++ b/src/transforms/metric_to_log.rs @@ -3,9 +3,9 @@ use codecs::MetricTagValues; use lookup::{event_path, owned_value_path, path, PathPrefix}; use serde_json::Value; use std::collections::{BTreeMap, BTreeSet}; -use vector_common::TimeZone; use vector_config::configurable_component; use vector_core::config::LogNamespace; +use vector_lib::TimeZone; use vrl::path::OwnedValuePath; use vrl::value::kind::Collection; use vrl::value::Kind; @@ -353,8 +353,8 @@ mod tests { use similar_asserts::assert_eq; use tokio::sync::mpsc; use tokio_stream::wrappers::ReceiverStream; - use vector_common::config::ComponentKey; use vector_core::{event::EventMetadata, metric_tags}; + use vector_lib::config::ComponentKey; use super::*; use crate::event::{ diff --git a/src/transforms/remap.rs b/src/transforms/remap.rs index dad1e54d95c62..ef5aa18b0c518 100644 --- a/src/transforms/remap.rs +++ b/src/transforms/remap.rs @@ -9,11 +9,11 @@ use std::{ use codecs::MetricTagValues; use lookup::{metadata_path, owned_value_path, PathPrefix}; use snafu::{ResultExt, Snafu}; -use vector_common::TimeZone; use vector_config::configurable_component; use vector_core::compile_vrl; use vector_core::config::LogNamespace; use vector_core::schema::Definition; +use vector_lib::TimeZone; use vector_vrl_functions::set_semantic_meaning::MeaningList; use vrl::compiler::runtime::{Runtime, Terminate}; use vrl::compiler::state::ExternalEnv; diff --git a/src/transforms/tag_cardinality_limit/tests.rs b/src/transforms/tag_cardinality_limit/tests.rs index 54c8b0bc4ac2f..67018e329e561 100644 --- a/src/transforms/tag_cardinality_limit/tests.rs +++ b/src/transforms/tag_cardinality_limit/tests.rs @@ -1,9 +1,9 @@ use std::sync::Arc; -use vector_common::config::ComponentKey; use vector_core::config::OutputId; use vector_core::event::EventMetadata; use vector_core::metric_tags; +use vector_lib::config::ComponentKey; use super::*; use crate::config::schema::Definition; diff --git a/src/types.rs b/src/types.rs index e8aee6d9b3698..4dff0fa98505c 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,4 +1,4 @@ #![allow(missing_docs)] -pub use vector_common::conversion::{ +pub use vector_lib::conversion::{ parse_check_conversion_map, parse_conversion_map, Conversion, Error, };