From 29e5b96b90a6eb4536349e128e84effee3787410 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 5 Nov 2026 15:02:34 +0100 Subject: [PATCH] feat: Collect the containerdebug logs --- CHANGELOG.md | 7 + .../pages/usage-guide/log_aggregation.adoc | 8 + .../src/controller/build/command.rs | 1 + .../build/properties/product_logging/mod.rs | 2 + .../product_logging/vector-test.yaml | 279 ++++++++++++++++++ .../properties/product_logging/vector.yaml | 87 ++++++ .../controller/build/resource/statefulset.rs | 44 ++- .../trino-vector-aggregator-values.yaml.j2 | 98 ++++-- 8 files changed, 493 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82dbf1072..840b65c09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ All notable changes to this project will be documented in this file. - Add `/ready` endpoint to the operator Deployment, which reports the CRD installation status ([#949]). - Coordinators now have a default affinity to the OPA Pods when OPA authorization is configured ([#924]). - Add support for 483 ([#956]). +- The logs of the `containerdebug` process are now collected by the Vector agent and forwarded to + the Vector aggregator ([#970]). ### Changed @@ -62,6 +64,10 @@ All notable changes to this project will be documented in this file. when predicting the coordinator pods. Kubernetes runs a single pod for a `StatefulSet` with `replicas: null`, but counting it as zero left `discovery.uri` out of `config.properties` altogether, so no pod could find the coordinator ([#945]). +- The `containerdebug` process writes its log file again. The operator set + `CONTAINERDEBUG_LOG_DIRECTORY`, which containerdebug stopped reading in its version 0.2.0 when it + moved to `stackable-telemetry`; the directory is now set via `FILE_LOG_DIRECTORY`. The file is + rotated hourly and at most two files are kept, because rotation is opt-in ([#970]). ### Removed @@ -91,6 +97,7 @@ All notable changes to this project will be documented in this file. [#961]: https://github.com/stackabletech/trino-operator/pull/961 [#963]: https://github.com/stackabletech/trino-operator/pull/963 [#966]: https://github.com/stackabletech/trino-operator/pull/966 +[#970]: https://github.com/stackabletech/trino-operator/pull/970 ## [26.7.0] - 2026-07-21 diff --git a/docs/modules/trino/pages/usage-guide/log_aggregation.adoc b/docs/modules/trino/pages/usage-guide/log_aggregation.adoc index 951fddec8..7cf32e613 100644 --- a/docs/modules/trino/pages/usage-guide/log_aggregation.adoc +++ b/docs/modules/trino/pages/usage-guide/log_aggregation.adoc @@ -22,4 +22,12 @@ spec: Currently, the logs are collected only for `server.log`. Logging for `http-request.log` is disabled by default. +NOTE: The logs of the xref:concepts:observability/containerdebug.adoc[`containerdebug` process] are collected as well. +They are labelled `container: containerdebug`, although no such Kubernetes container exists. +The process runs in the background of the `trino` container. +The label comes from `/stackable/log/containerdebug`, the directory which the operator sets with the `FILE_LOG_DIRECTORY` environment variable and from which the Vector agent derives the container name. +Overriding `FILE_LOG_DIRECTORY` with `envOverrides` therefore changes how these logs are aggregated. +The agent only collects files one level below `/stackable/log`, so a sibling directory such as `/stackable/log/trino` relabels the events instead of dropping them, while any deeper or shallower path stops the aggregation. +A path outside `/stackable/log` also leaves the size-capped log volume. + Further information on how to configure logging, can be found in xref:concepts:logging.adoc[]. diff --git a/rust/operator-binary/src/controller/build/command.rs b/rust/operator-binary/src/controller/build/command.rs index 79a81a833..ff819fa99 100644 --- a/rust/operator-binary/src/controller/build/command.rs +++ b/rust/operator-binary/src/controller/build/command.rs @@ -151,6 +151,7 @@ pub fn container_trino_args( {COMMON_BASH_TRAP_FUNCTIONS} {remove_vector_shutdown_file_command} prepare_signal_handlers +mkdir --parents \"$FILE_LOG_DIRECTORY\" containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop & bin/launcher run --etc-dir={RW_CONFIG_DIR_NAME} & wait_for_termination $! diff --git a/rust/operator-binary/src/controller/build/properties/product_logging/mod.rs b/rust/operator-binary/src/controller/build/properties/product_logging/mod.rs index 59950da6d..002676464 100644 --- a/rust/operator-binary/src/controller/build/properties/product_logging/mod.rs +++ b/rust/operator-binary/src/controller/build/properties/product_logging/mod.rs @@ -22,6 +22,8 @@ mod tests { assert!(!content.is_empty()); // The airlift source must be present (Trino's main log format) ... assert!(content.contains("files_airlift")); + assert!(content.contains("files_tracing_rs")); + assert!(content.contains("*.tracing-rs.json")); // ... while the aggregator sink must reference the injected address. assert!(content.contains("${VECTOR_AGGREGATOR_ADDRESS}")); } diff --git a/rust/operator-binary/src/controller/build/properties/product_logging/vector-test.yaml b/rust/operator-binary/src/controller/build/properties/product_logging/vector-test.yaml index fb50158e1..c22957f25 100644 --- a/rust/operator-binary/src/controller/build/properties/product_logging/vector-test.yaml +++ b/rust/operator-binary/src/controller/build/properties/product_logging/vector-test.yaml @@ -99,6 +99,285 @@ tests: "timestamp": t'2024-01-01T00:00:00.123456789Z' } + assert_eq!(expected_log_event, .) + - name: Test tracing-rs log + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"timestamp":"2026-11-02T14:49:28.028922Z","level":"INFO","fields":{"message":"found disk","disk.name":"overlay"},"target":"containerdebug::system_information::disk"}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "containerdebug::system_information::disk", + "message": "found disk\n\ndisk.name=overlay", + "timestamp": t'2026-11-02T14:49:28.028922Z', + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + - name: Test unparsable tracing-rs log + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{ unparsable' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "errors": [ + .errors[0] + ], + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "", + "message": "{ unparsable", + "timestamp": .timestamp, + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + + # The remainder of the message contains character offsets into + # the VRL source, so only the stable prefix is asserted. + assert!(starts_with!(.errors[0], "JSON not parsable: ")) + - name: Test tracing-rs log which is not a JSON object + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: 'false' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "errors": [ + "Parsed event is not a JSON object." + ], + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "", + "message": "false", + "timestamp": .timestamp, + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + - name: Test tracing-rs log with invalid fields + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"timestamp":"unparsable","level":"INVALID","fields":"none","target":null}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "errors": [ + .errors[0], + "Logger/target not found.", + "Level \"INVALID\" unknown, using \"INFO\" instead.", + "Fields are not an object." + ], + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "", + "message": "{\"timestamp\":\"unparsable\",\"level\":\"INVALID\",\"fields\":\"none\",\"target\":null}", + "timestamp": .timestamp, + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + + # The remainder of the message contains character offsets into + # the VRL source, so only the stable prefix is asserted. + assert!(starts_with!(.errors[0], "Timestamp not parsable, using current time instead: ")) + - name: Test tracing-rs log without a timestamp + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"level":"INFO","fields":{"message":"found disk"},"target":"containerdebug::system_information::disk"}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "errors": [ + "Timestamp not found, using current time instead." + ], + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "containerdebug::system_information::disk", + "message": "found disk", + "timestamp": .timestamp, + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + + # The current time is used and not the timestamp which the file + # source attached to the event. The latter reaches the transform + # as a string, whereas now() yields a timestamp. + assert!(is_timestamp(.timestamp)) + - name: Test tracing-rs log without a message but with other fields + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"timestamp":"2026-11-02T14:49:28.028922Z","level":"INFO","fields":{"disk.name":"overlay"},"target":"containerdebug::system_information::disk"}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "containerdebug::system_information::disk", + "message": "disk.name=overlay", + "timestamp": t'2026-11-02T14:49:28.028922Z', + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + - name: Test tracing-rs log with a message which is not a string + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"timestamp":"2026-11-02T14:49:28.028922Z","level":"INFO","fields":{"message":42,"disk.name":"overlay"},"target":"containerdebug::system_information::disk"}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "containerdebug::system_information::disk", + "message": "disk.name=overlay\nmessage=42", + "timestamp": t'2026-11-02T14:49:28.028922Z', + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + + assert_eq!(expected_log_event, .) + - name: Test tracing-rs log without any fields + inputs: + - type: log + insert_at: processed_files_tracing_rs + log_fields: + file: /stackable/log/containerdebug/containerdebug.2026-11-02-14.tracing-rs.json + message: '{"timestamp":"2026-11-02T14:49:28.028922Z","level":"INFO","fields":{},"target":"containerdebug::system_information::disk"}' + pod: trino-coordinator-default-0 + source_type: file + timestamp: 2026-11-02T14:49:29.473487331Z + outputs: + - extract_from: extended_logs + expected_event_count: 1 + conditions: + - type: vrl + source: | + expected_log_event = { + "cluster": "trino", + "container": "containerdebug", + "errors": [ + "Message not found." + ], + "file": "containerdebug.2026-11-02-14.tracing-rs.json", + "level": "INFO", + "logger": "containerdebug::system_information::disk", + "message": "", + "timestamp": t'2026-11-02T14:49:28.028922Z', + "namespace": "default", + "pod": "trino-coordinator-default-0", + "role": "coordinator", + "roleGroup": "default" + } + assert_eq!(expected_log_event, .) - name: Test Vector internal logs inputs: diff --git a/rust/operator-binary/src/controller/build/properties/product_logging/vector.yaml b/rust/operator-binary/src/controller/build/properties/product_logging/vector.yaml index 591952d9b..cd44fa175 100644 --- a/rust/operator-binary/src/controller/build/properties/product_logging/vector.yaml +++ b/rust/operator-binary/src/controller/build/properties/product_logging/vector.yaml @@ -25,6 +25,12 @@ sources: include: - ${LOG_DIR}/*/*.airlift.json + # Reads the logs of the containerdebug process + files_tracing_rs: + type: file + include: + - ${LOG_DIR}/*/*.tracing-rs.json + transforms: processed_files_stdout: inputs: @@ -106,11 +112,92 @@ transforms: } # Extends the processed files with the fields "container" and "file" + # Transforms the tracing-rs JSON logs written by the containerdebug process + processed_files_tracing_rs: + inputs: + - files_tracing_rs + type: remap + source: | + raw_message = string!(.message) + + .timestamp = now() + .logger = "" + .level = "INFO" + .message = "" + .errors = [] + + parsed_event, err = parse_json(raw_message) + if err != null { + error = "JSON not parsable: " + err + .errors = push(.errors, error) + log(error, level: "warn") + .message = raw_message + } else if !is_object(parsed_event) { + error = "Parsed event is not a JSON object." + .errors = push(.errors, error) + log(error, level: "warn") + .message = raw_message + } else { + event = object!(parsed_event) + + timestamp_string, err = string(event.timestamp) + if err == null { + parsed_timestamp, err = parse_timestamp(timestamp_string, "%+") + if err == null { + .timestamp = parsed_timestamp + } else { + .errors = push(.errors, "Timestamp not parsable, using current time instead: " + err) + } + } else { + .errors = push(.errors, "Timestamp not found, using current time instead.") + } + + .logger, err = string(event.target) + if err != null || is_empty(.logger) { + .errors = push(.errors, "Logger/target not found.") + } + + level, err = string(event.level) + if err != null { + .errors = push(.errors, "Level not found, using \"" + .level + "\" instead.") + } else if !includes(["TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"], upcase(level)) { + .errors = push(.errors, "Level \"" + level + "\" unknown, using \"" + .level + "\" instead.") + } else { + .level = upcase(level) + } + + fields, err = object(event.fields) + if err == null { + message, err = string(fields.message) + if err == null { + # The message is prepended to the other fields, so remove it from + # them. + del(fields.message) + } else { + # Keep an unusable message among the other fields instead of + # discarding its content. + message = "" + } + + other_fields = encode_key_value(fields, field_delimiter: "\n") + .message = join!(compact([message, other_fields]), "\n\n") + } else { + .errors = push(.errors, "Fields are not an object.") + # Fall back to the raw line, so that its content is not lost. + .message = raw_message + } + + if is_empty(.message) { + .errors = push(.errors, "Message not found.") + } + } + extended_logs_files: inputs: - processed_files_stdout - processed_files_stderr - processed_files_airlift + - processed_files_tracing_rs type: remap source: | del(.source_type) diff --git a/rust/operator-binary/src/controller/build/resource/statefulset.rs b/rust/operator-binary/src/controller/build/resource/statefulset.rs index 8ccc89c1c..ce25b9199 100644 --- a/rust/operator-binary/src/controller/build/resource/statefulset.rs +++ b/rust/operator-binary/src/controller/build/resource/statefulset.rs @@ -2,6 +2,7 @@ use std::str::FromStr; +use const_format::concatcp; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_operator::{ builder::{ @@ -64,12 +65,14 @@ use crate::{ }, }; -// The env var the `containerdebug` process (running in the background of the `trino` -// container) logs its tracing information to. See `command::container_trino_args()` for how -// the process is called. -stackable_operator::constant!( - CONTAINERDEBUG_LOG_DIRECTORY: EnvVarName = "CONTAINERDEBUG_LOG_DIRECTORY" -); +// Let the `containerdebug` process (running in the background of the `trino` container) write its +// tracing information to a file. See `command::container_trino_args()` for how the process is +// called. These are the generic `stackable-telemetry` variables and apply to the whole Trino +// container, so any other telemetry-based process in it would log into the same directory and the +// Vector agent would label its events with `container: containerdebug`. +stackable_operator::constant!(FILE_LOG_DIRECTORY: EnvVarName = "FILE_LOG_DIRECTORY"); +stackable_operator::constant!(FILE_LOG_MAX_FILES: EnvVarName = "FILE_LOG_MAX_FILES"); +stackable_operator::constant!(FILE_LOG_ROTATION_PERIOD: EnvVarName = "FILE_LOG_ROTATION_PERIOD"); // Typed names for the Pod's volumes, so each volume definition and its matching volume mounts // stay in sync. The Vector agent reads its `vector.yaml` from the rolegroup ConfigMap (mounted as @@ -201,10 +204,16 @@ pub fn build_rolegroup_statefulset( .context(AddCatalogEnvVarSnafu)?; } - env = env.with_value( - &CONTAINERDEBUG_LOG_DIRECTORY, - format!("{STACKABLE_LOG_DIR}/containerdebug"), - ); + env = env + // The directory must be exactly one level below the log directory, because the Vector + // agent derives the container name from that path segment. + .with_value( + &FILE_LOG_DIRECTORY, + concatcp!(STACKABLE_LOG_DIR, "/containerdebug"), + ) + // Rotation is opt-in, so without these the file would grow unbounded. + .with_value(&FILE_LOG_ROTATION_PERIOD, "hourly") + .with_value(&FILE_LOG_MAX_FILES, "2"); let requested_secret_lifetime = merged_config .requested_secret_lifetime @@ -267,6 +276,9 @@ pub fn build_rolegroup_statefulset( .context(AddVolumeSnafu)? .add_empty_dir_volume( &*LOG_VOLUME_NAME, + // Only the log files listed here are budgeted. The `containerdebug` files in this + // volume are rotated by time, not by size, so they have no budget; raising + // `FILE_LOG_LEVEL` via `envOverrides` can therefore evict the Pod. Some(product_logging::framework::calculate_log_volume_size_limit( &[MAX_TRINO_LOG_FILES_SIZE, MAX_PREPARE_LOG_FILE_SIZE], )), @@ -859,7 +871,9 @@ mod tests { #[test] fn test_constants() { // Test that dereferencing the constants does not panic. - let _ = *CONTAINERDEBUG_LOG_DIRECTORY; + let _ = *FILE_LOG_DIRECTORY; + let _ = *FILE_LOG_MAX_FILES; + let _ = *FILE_LOG_ROTATION_PERIOD; let _ = *CONFIG_VOLUME_NAME; let _ = *RW_CONFIG_VOLUME_NAME; let _ = *CATALOG_VOLUME_NAME; @@ -873,7 +887,7 @@ mod tests { } /// The user-supplied `envOverrides` must be merged in after all operator-set environment - /// variables, so that they can override any of them. `CONTAINERDEBUG_LOG_DIRECTORY` is used + /// variables, so that they can override any of them. `FILE_LOG_DIRECTORY` is used /// as the example here because it is set unconditionally by the operator. #[test] fn env_overrides_take_precedence_over_operator_set_env_vars() { @@ -882,7 +896,7 @@ mod tests { let mut role_group_config = cluster.coordinator_role_group_configs[&role_group_name].clone(); role_group_config.env_overrides = EnvVarSet::new().with_value( - &EnvVarName::from_str("CONTAINERDEBUG_LOG_DIRECTORY").expect("valid env var name"), + &EnvVarName::from_str_unsafe("FILE_LOG_DIRECTORY"), "/custom/log/dir", ); @@ -909,12 +923,12 @@ mod tests { let containerdebug: Vec<_> = env .iter() - .filter(|env_var| env_var.name == "CONTAINERDEBUG_LOG_DIRECTORY") + .filter(|env_var| env_var.name == "FILE_LOG_DIRECTORY") .collect(); assert_eq!( containerdebug.len(), 1, - "exactly one CONTAINERDEBUG_LOG_DIRECTORY entry must survive, got: {containerdebug:?}" + "exactly one FILE_LOG_DIRECTORY entry must survive, got: {containerdebug:?}" ); assert_eq!(containerdebug[0].value.as_deref(), Some("/custom/log/dir")); } diff --git a/tests/templates/kuttl/logging/trino-vector-aggregator-values.yaml.j2 b/tests/templates/kuttl/logging/trino-vector-aggregator-values.yaml.j2 index b3a248945..b1b488b9e 100644 --- a/tests/templates/kuttl/logging/trino-vector-aggregator-values.yaml.j2 +++ b/tests/templates/kuttl/logging/trino-vector-aggregator-values.yaml.j2 @@ -22,95 +22,139 @@ customConfig: transforms: validEvents: type: filter - inputs: [vector] + inputs: + - vector condition: is_null(.errors) + filteredAutomaticLogConfigCoordinatorContainerdebug: + type: filter + inputs: + - validEvents + condition: >- + .pod == "test-trino-coordinator-automatic-log-config-0" && + .container == "containerdebug" filteredAutomaticLogConfigCoordinatorTrino: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-automatic-log-config-0" && .container == "trino" filteredAutomaticLogConfigCoordinatorPwFileUpdater: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-automatic-log-config-0" && .container == "password-file-updater" filteredAutomaticLogConfigCoordinatorVector: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-automatic-log-config-0" && .container == "vector" filteredAutomaticLogConfigCoordinatorPrepare: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-automatic-log-config-0" && .container == "prepare" + filteredAutomaticLogConfigWorkerContainerdebug: + type: filter + inputs: + - validEvents + condition: >- + .pod == "test-trino-worker-automatic-log-config-0" && + .container == "containerdebug" filteredAutomaticLogConfigWorkerTrino: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-automatic-log-config-0" && .container == "trino" filteredAutomaticLogConfigWorkerVector: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-automatic-log-config-0" && .container == "vector" filteredAutomaticLogConfigWorkerPrepare: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-automatic-log-config-0" && .container == "prepare" + filteredCustomLogConfigCoordinatorContainerdebug: + type: filter + inputs: + - validEvents + condition: >- + .pod == "test-trino-coordinator-custom-log-config-0" && + .container == "containerdebug" filteredCustomLogConfigCoordinatorTrino: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-custom-log-config-0" && .container == "trino" filteredCustomLogConfigCoordinatorPwFileUpdater: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-custom-log-config-0" && .container == "password-file-updater" filteredCustomLogConfigCoordinatorVector: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-custom-log-config-0" && .container == "vector" filteredCustomLogConfigCoordinatorPrepare: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-coordinator-custom-log-config-0" && .container == "prepare" + filteredCustomLogConfigWorkerContainerdebug: + type: filter + inputs: + - validEvents + condition: >- + .pod == "test-trino-worker-custom-log-config-0" && + .container == "containerdebug" filteredCustomLogConfigWorkerTrino: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-custom-log-config-0" && .container == "trino" filteredCustomLogConfigWorkerVector: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-custom-log-config-0" && .container == "vector" filteredCustomLogConfigWorkerPrepare: type: filter - inputs: [validEvents] + inputs: + - validEvents condition: >- .pod == "test-trino-worker-custom-log-config-0" && .container == "prepare" filteredInvalidEvents: type: filter - inputs: [vector] + inputs: + - vector condition: |- .timestamp == from_unix_timestamp!(0) || is_null(.level) || @@ -118,11 +162,29 @@ customConfig: is_null(.message) sinks: test: - inputs: [filtered*] + inputs: + - filtered* type: blackhole + # Shows all events received from the agents. This sink is intentional and + # not a debugging leftover: if a "filtered*" transform gathers no event, + # then the assertion only reports a count, whereas this log shows which + # pod and container names actually arrived. A failure in CI cannot be + # reproduced by enabling this afterwards, so it is kept enabled at the + # price of the log volume. + stdout: + inputs: + - vector + type: console + encoding: + codec: json + buffer: + # Avoid back pressure from a stalling stdout. The test should not + # fail because of a sink which only aids debugging. + when_full: drop_newest {% if lookup('env', 'VECTOR_AGGREGATOR') %} aggregator: - inputs: [vector] + inputs: + - vector type: vector routing: endpoints: