Skip to content

Commit aca3a29

Browse files
authored
feat(dev): decouple syslog source and codec features (vectordotdev#18381)
This commit adds a new `codecs-syslog` feature to Vector mapped to the `codecs/syslog` package feature. This allows for code requiring the `syslog` codec to not depend on the `syslog` source anymore and instead depend on the `syslog` codec directly. For example, it is now possible to compile any source with `syslog` codec support using `codecs-syslog` without having to compile the `syslog` source with it. Signed-off-by: Hugo Hromic <[email protected]>
1 parent 2a4235c commit aca3a29

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ gcp = ["dep:base64", "dep:goauth", "dep:smpl_jwt"]
476476
enrichment-tables = ["enrichment-tables-geoip"]
477477
enrichment-tables-geoip = ["dep:maxminddb"]
478478

479+
# Codecs
480+
codecs-syslog = ["codecs/syslog"]
481+
479482
# Sources
480483
sources = ["sources-logs", "sources-metrics"]
481484
sources-logs = [
@@ -559,7 +562,7 @@ sources-socket = ["sources-utils-net", "tokio-util/net"]
559562
sources-splunk_hec = ["dep:roaring"]
560563
sources-statsd = ["sources-utils-net", "tokio-util/net"]
561564
sources-stdin = ["tokio-util/io"]
562-
sources-syslog = ["codecs/syslog", "sources-utils-net", "tokio-util/net"]
565+
sources-syslog = ["codecs-syslog", "sources-utils-net", "tokio-util/net"]
563566
sources-utils-http = ["dep:snap", "sources-utils-http-auth", "sources-utils-http-encoding", "sources-utils-http-error", "sources-utils-http-prelude"]
564567
sources-utils-http-auth = ["sources-utils-http-error"]
565568
sources-utils-http-encoding = ["dep:snap", "sources-utils-http-error"]

src/components/validation/resources/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fn deserializer_config_to_serializer(config: &DeserializerConfig) -> encoding::S
146146
// TODO: We need to create an Avro serializer because, certainly, for any source decoding
147147
// the data as Avro, we can't possibly send anything else without the source just
148148
// immediately barfing.
149-
#[cfg(feature = "sources-syslog")]
149+
#[cfg(feature = "codecs-syslog")]
150150
DeserializerConfig::Syslog { .. } => SerializerConfig::Logfmt,
151151
DeserializerConfig::Native => SerializerConfig::Native,
152152
DeserializerConfig::NativeJson { .. } => SerializerConfig::NativeJson,

src/sources/datadog_agent/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ fn test_config_outputs() {
16581658
]),
16591659
},
16601660
),
1661-
#[cfg(feature = "sources-syslog")]
1661+
#[cfg(feature = "codecs-syslog")]
16621662
(
16631663
"syslog / single output",
16641664
TestCase {
@@ -1733,7 +1733,7 @@ fn test_config_outputs() {
17331733
)]),
17341734
},
17351735
),
1736-
#[cfg(feature = "sources-syslog")]
1736+
#[cfg(feature = "codecs-syslog")]
17371737
(
17381738
"syslog / multiple output",
17391739
TestCase {

0 commit comments

Comments
 (0)