Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ All notable changes to this project will be documented in this file.
- Support the annotation `secrets.stackable.tech/backend.autotls.cert.domain-components-in-subject-dn`
in the `SecretOperatorVolumeSourceBuilder` ([#1209]).

### Fixed

- Strip ANSI escape codes (e.g. colors) from captured shell stdout/stderr in the generated Vector
agent config, so they no longer show up as garbled text in log aggregators such as OpenSearch ([#1237]).

[#1209]: https://github.com/stackabletech/operator-rs/pull/1209
[#1237]: https://github.com/stackabletech/operator-rs/pull/1237

## [0.113.0] - 2026-06-22

Expand Down
7 changes: 7 additions & 0 deletions crates/stackable-operator/src/product_logging/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@ transforms:
source: |
.logger = "ROOT"
.level = "INFO"
# Containers capture raw stdout, which can contain ANSI escape codes (colors) emitted by the
# tools they run (e.g. containerdebug, cert-tools). These codes are unreadable in log
# aggregators such as OpenSearch, so we strip them here. On failure (e.g. non-string message)
# we keep the original message untouched.
.message = strip_ansi_escape_codes(.message) ?? .message

processed_files_stderr:
inputs:
Expand All @@ -932,6 +937,8 @@ transforms:
source: |
.logger = "ROOT"
.level = "ERROR"
# See above for why we strip ANSI escape codes.
.message = strip_ansi_escape_codes(.message) ?? .message

processed_files_log4j:
inputs:
Expand Down
9 changes: 9 additions & 0 deletions crates/stackable-telemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Fixed

- Revert [#1183], so we again default to ANSI escape sequences, which can be turned off using
`NO_COLOR=1`.
This way we keep colored logs for human consumption.
Instead we adopted the Vector config, so that the Vector sidecar strips ANSI codes ([#1237]).

[#1237]: https://github.com/stackabletech/operator-rs/pull/1237

## [0.6.4] - 2026-06-03

Note: There are only dependency bumps in this release
Expand Down
12 changes: 3 additions & 9 deletions crates/stackable-telemetry/src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//!
//! To get started, see [`Tracing`].

use std::{io::IsTerminal, ops::Not, path::PathBuf};
use std::{ops::Not, path::PathBuf};

use opentelemetry::trace::TracerProvider;
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
Expand Down Expand Up @@ -436,21 +436,15 @@ impl Tracing {

// NOTE (@NickLarsenNZ): There is no elegant way to build the layer depending on formats because the types
// returned from each subscriber "modifier" function is different (sometimes with different generics).
// tracing-subscriber does not auto-detect whether stdout is a terminal
// (https://github.com/tokio-rs/tracing/issues/1160), so we check explicitly.
let use_ansi = std::io::stdout().is_terminal();

match log_format {
Format::Plain => {
let console_output_layer = tracing_subscriber::fmt::layer()
.with_ansi(use_ansi)
.with_filter(env_filter_layer);
let console_output_layer =
tracing_subscriber::fmt::layer().with_filter(env_filter_layer);
layers.push(console_output_layer.boxed());
}
Format::Json => {
let console_output_layer = tracing_subscriber::fmt::layer()
.json()
.with_ansi(use_ansi)
.with_filter(env_filter_layer);
layers.push(console_output_layer.boxed());
}
Expand Down
Loading