From f09c0162f769588b73c899c0eea2fe9b90d39087 Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Wed, 25 Oct 2023 11:38:54 -0600 Subject: [PATCH] Feature flag fixes --- Cargo.lock | 1 - Cargo.toml | 10 +++++----- lib/vector-lib/Cargo.toml | 6 ++++++ lib/vector-lib/src/lib.rs | 10 +++++++--- src/sinks/prometheus/remote_write/sink.rs | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f94620fd92ae..2fa9f4baaf2f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9869,7 +9869,6 @@ dependencies = [ "vector-config", "vector-config-common", "vector-config-macros", - "vector-core", "vector-lib", "vector-lookup", "vector-stream", diff --git a/Cargo.toml b/Cargo.toml index fbea04057b55a..7dddc4e4b4ba6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -144,7 +144,7 @@ vector-buffers = { path = "lib/vector-buffers", default-features = false } vector-config = { path = "lib/vector-config" } vector-config-common = { path = "lib/vector-config-common" } vector-config-macros = { path = "lib/vector-config-macros" } -vector-lib = { path = "lib/vector-lib", default-features = false } +vector-lib = { path = "lib/vector-lib", default-features = false, features = ["vrl"] } vector-stream = { path = "lib/vector-stream" } vector-vrl-functions = { path = "lib/vector-vrl/functions" } loki-logproto = { path = "lib/loki-logproto", optional = true } @@ -376,7 +376,7 @@ test-generator = "0.3.1" tokio = { version = "1.33.0", features = ["test-util"] } tokio-test = "0.4.3" tower-test = "0.4.0" -vector-core = { path = "lib/vector-core", default-features = false, features = ["vrl", "test"] } +vector-lib = { path = "lib/vector-lib", default-features = false, features = ["vrl", "test"] } vrl = { version = "0.7.0", features = ["cli", "test", "test_framework", "arbitrary"] } wiremock = "0.5.19" @@ -437,7 +437,7 @@ api = [ "dep:async-graphql", "dep:async-graphql-warp", "dep:base64", - "vector-core/api", + "vector-lib/api", ] # API client @@ -446,7 +446,7 @@ api-client = [ "dep:num-format", "dep:number_prefix", "dep:ratatui", - "vector-core/api", + "vector-lib/api", "dep:vector-api-client", ] @@ -607,7 +607,7 @@ transforms-aws_ec2_metadata = ["dep:arc-swap"] transforms-dedupe = ["dep:lru"] transforms-filter = [] transforms-log_to_metric = [] -transforms-lua = ["dep:mlua", "vector-core/lua"] +transforms-lua = ["dep:mlua", "vector-lib/lua"] transforms-metric_to_log = [] transforms-pipelines = ["transforms-filter", "transforms-route"] transforms-reduce = [] diff --git a/lib/vector-lib/Cargo.toml b/lib/vector-lib/Cargo.toml index e7599be611507..a66408303abb5 100644 --- a/lib/vector-lib/Cargo.toml +++ b/lib/vector-lib/Cargo.toml @@ -8,3 +8,9 @@ publish = false [dependencies] vector-common = { path = "../vector-common", default-features = false } vector-core = { path = "../vector-core", default-features = false } + +[features] +api = ["vector-core/api"] +lua = ["vector-core/lua"] +test = ["vector-core/test"] +vrl = ["vector-core/vrl"] diff --git a/lib/vector-lib/src/lib.rs b/lib/vector-lib/src/lib.rs index f84ed491553d7..166bdac69c17a 100644 --- a/lib/vector-lib/src/lib.rs +++ b/lib/vector-lib/src/lib.rs @@ -4,10 +4,14 @@ pub use vector_common::{ registered_event, request_metadata, sensitive_string, shutdown, trigger, Error, Result, TimeZone, }; +#[cfg(feature = "vrl")] +pub use vector_core::compile_vrl; +#[cfg(feature = "test")] +pub use vector_core::event_test_util; pub use vector_core::{ - buckets, buffers, compile_vrl, default_data_dir, event, event_test_util, fanout, metric_tags, - metrics, partition, quantiles, samples, schema, serde, sink, source, tcp, tls, transform, - update_counter, EstimatedJsonEncodedSizeOf, + buckets, buffers, default_data_dir, event, fanout, metric_tags, metrics, partition, quantiles, + samples, schema, serde, sink, source, tcp, tls, transform, update_counter, + EstimatedJsonEncodedSizeOf, }; pub mod config { diff --git a/src/sinks/prometheus/remote_write/sink.rs b/src/sinks/prometheus/remote_write/sink.rs index 3c7d17ed6391f..fdff3b605db9c 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_lib::event::Metric; use vector_lib::byte_size_of::ByteSizeOf; +use vector_lib::event::Metric; use vector_stream::batcher::{data::BatchData, limiter::ByteSizeOfItemSize}; use crate::sinks::{prelude::*, util::buffer::metrics::MetricSet};