Skip to content

Commit 36d738f

Browse files
committed
chore: Correct changelog entry
1 parent 8037e69 commit 36d738f

File tree

7 files changed

+39
-56
lines changed

7 files changed

+39
-56
lines changed

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Changed
66

77
- Replace stackable-operator `initialize_logging` with stackable-telemetry `Tracing` ([#601]).
8-
- BREAKING: The file log directory was set by `AIRFLOW_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR`
8+
- BREAKING: The file log directory was set by `AIRFLOW_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS`
99
(or via `--rolling-logs <DIRECTORY>`).
1010
- Replace stackable-operator `print_startup_string` with `tracing::info!` with fields.
1111

Diff for: Cargo.lock

+7-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ strum = { version = "0.27", features = ["derive"] }
3232
tokio = { version = "1.40", features = ["full"] }
3333
tracing = "0.1"
3434

35-
# [patch."https://github.com/stackabletech/operator-rs.git"]
36-
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
35+
[patch."https://github.com/stackabletech/operator-rs.git"]
36+
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/stackable-telemetry-tracing-default" }
37+
stackable-telemetry = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/stackable-telemetry-tracing-default" }
3738
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }

Diff for: deploy/helm/airflow-operator/values.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ tolerations: []
4242

4343
affinity: {}
4444

45+
# telemetry: {}
46+
telemetry:
47+
consoleLog:
48+
enabled: true # default
49+
format: Plain # default (later: json, logfmt)
50+
fileLog:
51+
enabled: true # if enabled, the directory will be set
52+
rollingPeriod: Hourly # defaults to Never
53+
otlpLog:
54+
enabled: true # defaults to false (configured via env vars)
55+
otlpTrace:
56+
enabled: true # defaults to false (configured via env vars)
57+
endpoint: "otel-gateway:4317" # defaults to localhost:4317?
58+
59+
60+
4561
# When running on a non-default Kubernetes cluster domain, the cluster domain can be configured here.
4662
# See the https://docs.stackable.tech/home/stable/guides/kubernetes-cluster-domain guide for details.
4763
# kubernetesClusterDomain: my-cluster.local

Diff for: rust/operator-binary/src/airflow_controller.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ fn build_logging_container(
11541154
.with_memory_request("128Mi")
11551155
.with_memory_limit("128Mi")
11561156
.build(),
1157+
"FIX ME",
11571158
)
11581159
.context(ConfigureLoggingSnafu)
11591160
}

Diff for: rust/operator-binary/src/main.rs

+9-43
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::{ops::Deref, sync::Arc};
1+
use std::sync::Arc;
22

33
use clap::Parser;
44
use futures::StreamExt;
55
use stackable_operator::{
66
YamlSchema,
7-
cli::{Command, ProductOperatorRun, RollingPeriod},
7+
cli::{Command, ProductOperatorRun},
88
commons::authentication::AuthenticationClass,
99
k8s_openapi::api::{apps::v1::StatefulSet, core::v1::Service},
1010
kube::{
@@ -20,8 +20,7 @@ use stackable_operator::{
2020
logging::controller::report_controller_reconciled,
2121
shared::yaml::SerializeOptions,
2222
};
23-
use stackable_telemetry::{Tracing, tracing::settings::Settings};
24-
use tracing::level_filters::LevelFilter;
23+
use stackable_telemetry::Tracing;
2524

2625
use crate::{
2726
airflow_controller::AIRFLOW_FULL_CONTROLLER_NAME,
@@ -66,45 +65,12 @@ async fn main() -> anyhow::Result<()> {
6665
telemetry_arguments,
6766
cluster_info_opts,
6867
}) => {
69-
let _tracing_guard = Tracing::builder()
70-
// TODO (@Techassi): This should be a constant
71-
.service_name("airflow-operator")
72-
.with_console_output((
73-
ENV_VAR_CONSOLE_LOG,
74-
LevelFilter::INFO,
75-
!telemetry_arguments.no_console_output,
76-
))
77-
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used, the log directory was
78-
// set via an env: `AIRFLOW_OPERATOR_LOG_DIRECTORY`.
79-
// See: https://github.com/stackabletech/operator-rs/blob/f035997fca85a54238c8de895389cc50b4d421e2/crates/stackable-operator/src/logging/mod.rs#L40
80-
// Now it will be `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
81-
.with_file_output(telemetry_arguments.rolling_logs.map(|log_directory| {
82-
let rotation_period = telemetry_arguments
83-
.rolling_logs_period
84-
.unwrap_or(RollingPeriod::Hourly)
85-
.deref()
86-
.clone();
87-
88-
Settings::builder()
89-
// TODO (@Techassi): Change to CONSOLE_LOG or FILE_LOG, create constant
90-
.with_environment_variable(ENV_VAR_CONSOLE_LOG)
91-
.with_default_level(LevelFilter::INFO)
92-
.file_log_settings_builder(log_directory, "tracing-rs.log")
93-
.with_rotation_period(rotation_period)
94-
.build()
95-
}))
96-
.with_otlp_log_exporter((
97-
"OTLP_LOG",
98-
LevelFilter::DEBUG,
99-
telemetry_arguments.otlp_logs,
100-
))
101-
.with_otlp_trace_exporter((
102-
"OTLP_TRACE",
103-
LevelFilter::DEBUG,
104-
telemetry_arguments.otlp_traces,
105-
))
106-
.build()
107-
.init()?;
68+
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
69+
// - The console log level was set by `AIRFLOW_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
70+
// - The file log level was (maybe?) set by `AIRFLOW_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
71+
// - The file log directory was set by `AIRFLOW_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
72+
let _tracing_guard =
73+
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
10874

10975
tracing::info!(
11076
built_info.pkg_version = built_info::PKG_VERSION,

Diff for: rust/operator-binary/src/product_logging.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub async fn resolve_vector_aggregator_address<T: Resource>(
7777
/// Extend the ConfigMap with logging and Vector configurations
7878
pub fn extend_config_map_with_log_config<C, K>(
7979
rolegroup: &RoleGroupRef<K>,
80-
vector_aggregator_address: Option<&str>,
80+
_vector_aggregator_address: Option<&str>,
8181
logging: &Logging<C>,
8282
main_container: &C,
8383
vector_container: &C,
@@ -107,11 +107,7 @@ where
107107
if logging.enable_vector_agent {
108108
cm_builder.add_data(
109109
product_logging::framework::VECTOR_CONFIG_FILE,
110-
product_logging::framework::create_vector_config(
111-
rolegroup,
112-
vector_aggregator_address.context(MissingVectorAggregatorAddressSnafu)?,
113-
vector_log_config,
114-
),
110+
product_logging::framework::create_vector_config(rolegroup, vector_log_config),
115111
);
116112
}
117113

0 commit comments

Comments
 (0)