diff --git a/docs/DEPRECATIONS.md b/docs/DEPRECATIONS.md index ad3a1d683b6a2..b2e1faedd6996 100644 --- a/docs/DEPRECATIONS.md +++ b/docs/DEPRECATIONS.md @@ -16,8 +16,6 @@ For example: ## To be migrated -- file_metric_tag v0.36.0 The `internal_metrics.include_file_tag` should default to `false`. - ## To be removed - datadog_v1_metrics v0.35.0 Support for `v1` series endpoint in the `datadog_metrics` sink should be removed. diff --git a/src/internal_events/file.rs b/src/internal_events/file.rs index 15370ad9cdbd2..fc493a1a83c78 100644 --- a/src/internal_events/file.rs +++ b/src/internal_events/file.rs @@ -12,16 +12,14 @@ use vector_lib::internal_event::{error_stage, error_type}; /// Configuration of internal metrics for file-based components. #[configurable_component] -#[derive(Clone, Debug, PartialEq, Eq, Derivative)] -#[derivative(Default)] +#[derive(Clone, Debug, PartialEq, Eq, Default)] #[serde(deny_unknown_fields)] pub struct FileInternalMetricsConfig { /// Whether or not to include the "file" tag on the component's corresponding internal metrics. /// /// This is useful for distinguishing between different files while monitoring. However, the tag's - /// cardinality is unbounded. This defaults to true for now but will default to false in a future version. - #[serde(default = "crate::serde::default_true")] - #[derivative(Default(value = "true"))] + /// cardinality is unbounded. + #[serde(default = "crate::serde::default_false")] pub include_file_tag: bool, } diff --git a/src/sinks/file/mod.rs b/src/sinks/file/mod.rs index 5392ec57647ec..f7d94243ba35f 100644 --- a/src/sinks/file/mod.rs +++ b/src/sinks/file/mod.rs @@ -476,7 +476,9 @@ mod tests { compression: Compression::None, acknowledgements: Default::default(), timezone: Default::default(), - internal_metrics: Default::default(), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, }; let (input, _events) = random_lines_with_stream(100, 64, None); @@ -500,7 +502,9 @@ mod tests { compression: Compression::Gzip, acknowledgements: Default::default(), timezone: Default::default(), - internal_metrics: Default::default(), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, }; let (input, _) = random_lines_with_stream(100, 64, None); @@ -524,7 +528,9 @@ mod tests { compression: Compression::Zstd, acknowledgements: Default::default(), timezone: Default::default(), - internal_metrics: Default::default(), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, }; let (input, _) = random_lines_with_stream(100, 64, None); @@ -553,7 +559,9 @@ mod tests { compression: Compression::None, acknowledgements: Default::default(), timezone: Default::default(), - internal_metrics: Default::default(), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, }; let (mut input, _events) = random_events_with_stream(32, 8, None); @@ -633,7 +641,9 @@ mod tests { compression: Compression::None, acknowledgements: Default::default(), timezone: Default::default(), - internal_metrics: Default::default(), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, }; let (mut input, _events) = random_lines_with_stream(10, 64, None); diff --git a/src/sources/file.rs b/src/sources/file.rs index 11656e7319338..c8a670141a6a6 100644 --- a/src/sources/file.rs +++ b/src/sources/file.rs @@ -859,6 +859,9 @@ mod tests { }, data_dir: Some(dir.path().to_path_buf()), glob_minimum_cooldown_ms: Duration::from_millis(100), + internal_metrics: FileInternalMetricsConfig { + include_file_tag: true, + }, ..Default::default() } } diff --git a/website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md b/website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md index 2418624c1e34c..86c45d8a244de 100644 --- a/website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md +++ b/website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md @@ -12,10 +12,7 @@ badges: Vector's 0.35.0 release includes **breaking changes**: 1. [The Throttle transform's `events_discarded_total` internal metric is now opt-in](#events-discarded-total-opt-in) - -and **deprecations**: - -1. [Deprecation of `file` internal metric tag for file-based components](#deprecate-file-tag) +1. [The `file` internal metric tag is now opt-in for file-based components](#file-tag-opt-in) and **potentially impactful changes**: @@ -37,15 +34,12 @@ potentially unbounded cardinality. To view events discarded without the `key` tag, use the `component_discarded_events_total` internal metric. -### Deprecations - -#### Deprecation of `file` internal metric tag for file-based components {#deprecate-file-tag} +#### The `file` internal metric tag is now opt-in for file-based components {#file-tag-opt-in} File-based components (file source, Kubernetes logs source, file sink) now include a `internal_metrics.include_file_tag` config option that determines whether the `file` tag is included on the -component's corresponding internal metrics. This config option defaults to `true` for now to retain the -existing behavior. In the next release, the config option will be updated to default to `false`, as this -`tag` is likely to be of high cardinality. +component's corresponding internal metrics. This config option defaults to `false`, as this `tag` is likely to +be of high cardinality. ### Potentially impactful changes diff --git a/website/cue/reference/components/sinks/base/file.cue b/website/cue/reference/components/sinks/base/file.cue index 9d2085c704e2a..fe8952486a987 100644 --- a/website/cue/reference/components/sinks/base/file.cue +++ b/website/cue/reference/components/sinks/base/file.cue @@ -333,10 +333,10 @@ base: components: sinks: file: configuration: { Whether or not to include the "file" tag on the component's corresponding internal metrics. This is useful for distinguishing between different files while monitoring. However, the tag's - cardinality is unbounded. This defaults to true for now but will default to false in a future version. + cardinality is unbounded. """ required: false - type: bool: default: true + type: bool: default: false } } path: { diff --git a/website/cue/reference/components/sources/base/file.cue b/website/cue/reference/components/sources/base/file.cue index 6f105b7449fdd..b67a878d22ffc 100644 --- a/website/cue/reference/components/sources/base/file.cue +++ b/website/cue/reference/components/sources/base/file.cue @@ -213,10 +213,10 @@ base: components: sources: file: configuration: { Whether or not to include the "file" tag on the component's corresponding internal metrics. This is useful for distinguishing between different files while monitoring. However, the tag's - cardinality is unbounded. This defaults to true for now but will default to false in a future version. + cardinality is unbounded. """ required: false - type: bool: default: true + type: bool: default: false } } line_delimiter: { diff --git a/website/cue/reference/components/sources/base/kubernetes_logs.cue b/website/cue/reference/components/sources/base/kubernetes_logs.cue index 4b839e1ddc358..34b2516edf636 100644 --- a/website/cue/reference/components/sources/base/kubernetes_logs.cue +++ b/website/cue/reference/components/sources/base/kubernetes_logs.cue @@ -148,10 +148,10 @@ base: components: sources: kubernetes_logs: configuration: { Whether or not to include the "file" tag on the component's corresponding internal metrics. This is useful for distinguishing between different files while monitoring. However, the tag's - cardinality is unbounded. This defaults to true for now but will default to false in a future version. + cardinality is unbounded. """ required: false - type: bool: default: true + type: bool: default: false } } kube_config_file: {