From df018e158545b87a3a0c1b4e9da89f0e3a998cdf Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 9 Apr 2025 21:14:12 +0200 Subject: [PATCH 1/5] chore: Bump stackable-operator and use re-exports --- Cargo.lock | 24 +++--- Cargo.nix | 77 ++++++++++++------- Cargo.toml | 4 +- crate-hashes.json | 14 ++-- rust/operator-binary/Cargo.toml | 2 - .../operator-binary/src/crd/authentication.rs | 2 +- rust/operator-binary/src/crd/mod.rs | 2 +- rust/operator-binary/src/crd/tls.rs | 6 +- rust/operator-binary/src/main.rs | 10 ++- 9 files changed, 81 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8fb94d50..ba5a2f3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1482,7 +1482,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "darling", "regex", @@ -2589,8 +2589,8 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stackable-operator" -version = "0.90.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#ea063b4595caa20c82d37c595487c76476c9ab10" +version = "0.91.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "chrono", "clap", @@ -2614,6 +2614,8 @@ dependencies = [ "snafu 0.8.5", "stackable-operator-derive", "stackable-shared", + "stackable-telemetry", + "stackable-versioned", "strum", "tokio", "tracing", @@ -2625,7 +2627,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#ea063b4595caa20c82d37c595487c76476c9ab10" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "darling", "proc-macro2", @@ -2636,7 +2638,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#ea063b4595caa20c82d37c595487c76476c9ab10" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "kube", "semver", @@ -2647,10 +2649,11 @@ dependencies = [ [[package]] name = "stackable-telemetry" -version = "0.4.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-telemetry-0.4.0#52bdee5749e217005025d07f33c7020931c31d91" +version = "0.5.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "axum 0.8.3", + "clap", "futures-util", "opentelemetry", "opentelemetry-appender-tracing", @@ -2658,6 +2661,7 @@ dependencies = [ "opentelemetry_sdk", "pin-project", "snafu 0.8.5", + "strum", "tokio", "tower 0.5.2", "tracing", @@ -2669,7 +2673,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.7.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "stackable-versioned-macros", ] @@ -2677,7 +2681,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.7.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14" dependencies = [ "convert_case", "darling", @@ -2709,8 +2713,6 @@ dependencies = [ "serde_yaml", "snafu 0.8.5", "stackable-operator", - "stackable-telemetry", - "stackable-versioned", "strum", "tokio", "tokio-zookeeper", diff --git a/Cargo.nix b/Cargo.nix index 591f531b..25c05f5a 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4665,12 +4665,12 @@ rec { "k8s-version" = rec { crateName = "k8s-version"; version = "0.1.2"; - edition = "2021"; + edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8"; - sha256 = "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; libName = "k8s_version"; authors = [ @@ -8436,13 +8436,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.90.0"; + version = "0.91.1"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "ea063b4595caa20c82d37c595487c76476c9ab10"; - sha256 = "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; libName = "stackable_operator"; authors = [ @@ -8547,6 +8547,16 @@ rec { name = "stackable-shared"; packageId = "stackable-shared"; } + { + name = "stackable-telemetry"; + packageId = "stackable-telemetry"; + features = [ "clap" ]; + } + { + name = "stackable-versioned"; + packageId = "stackable-versioned"; + features = [ "k8s" ]; + } { name = "strum"; packageId = "strum"; @@ -8577,8 +8587,11 @@ rec { } ]; features = { + "default" = [ "telemetry" "versioned" ]; + "full" = [ "time" "telemetry" "versioned" ]; "time" = [ "dep:time" ]; }; + resolvedDefaultFeatures = [ "default" "telemetry" "versioned" ]; }; "stackable-operator-derive" = rec { crateName = "stackable-operator-derive"; @@ -8587,8 +8600,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "ea063b4595caa20c82d37c595487c76476c9ab10"; - sha256 = "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -8622,8 +8635,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "ea063b4595caa20c82d37c595487c76476c9ab10"; - sha256 = "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; libName = "stackable_shared"; authors = [ @@ -8658,13 +8671,13 @@ rec { }; "stackable-telemetry" = rec { crateName = "stackable-telemetry"; - version = "0.4.0"; + version = "0.5.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "52bdee5749e217005025d07f33c7020931c31d91"; - sha256 = "0hcm64fb2ngyalq8rci5lrr881prg023pq9cd1sfr79iynbr6a26"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; libName = "stackable_telemetry"; authors = [ @@ -8675,6 +8688,12 @@ rec { name = "axum"; packageId = "axum 0.8.3"; } + { + name = "clap"; + packageId = "clap"; + optional = true; + features = [ "derive" "cargo" "env" ]; + } { name = "futures-util"; packageId = "futures-util"; @@ -8706,6 +8725,11 @@ rec { name = "snafu"; packageId = "snafu 0.8.5"; } + { + name = "strum"; + packageId = "strum"; + features = [ "derive" ]; + } { name = "tokio"; packageId = "tokio"; @@ -8745,17 +8769,20 @@ rec { packageId = "tracing-opentelemetry"; } ]; - + features = { + "clap" = [ "dep:clap" ]; + }; + resolvedDefaultFeatures = [ "clap" ]; }; "stackable-versioned" = rec { crateName = "stackable-versioned"; version = "0.7.1"; - edition = "2021"; + edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8"; - sha256 = "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; libName = "stackable_versioned"; authors = [ @@ -8776,12 +8803,12 @@ rec { "stackable-versioned-macros" = rec { crateName = "stackable-versioned-macros"; version = "0.7.1"; - edition = "2021"; + edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6c4b022dcdaec09a0c0ecb420a41bb180d4edbf8"; - sha256 = "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi"; + rev = "0f9b6f9669051e9c4f29e6e882acf3eff3ac3f14"; + sha256 = "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -8916,15 +8943,7 @@ rec { { name = "stackable-operator"; packageId = "stackable-operator"; - } - { - name = "stackable-telemetry"; - packageId = "stackable-telemetry"; - } - { - name = "stackable-versioned"; - packageId = "stackable-versioned"; - features = [ "k8s" ]; + features = [ "telemetry" "versioned" ]; } { name = "strum"; diff --git a/Cargo.toml b/Cargo.toml index 4e17ae88..4d139533 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,7 @@ repository = "https://github.com/stackabletech/zookeeper-operator" [workspace.dependencies] product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.90.0" } -stackable-telemetry = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-telemetry-0.4.0" } -stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.7.1" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.91.1" } anyhow = "1.0" built = { version = "0.7", features = ["chrono", "git2"] } diff --git a/crate-hashes.json b/crate-hashes.json index c8a9703a..e4629311 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,10 +1,10 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#stackable-operator-derive@0.3.1": "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#stackable-operator@0.90.0": "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.90.0#stackable-shared@0.0.1": "0fclvpxhchykqd7bl8hscr4v06mbs2v5vjp0xv27nvqr94j63xs2", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-telemetry-0.4.0#stackable-telemetry@0.4.0": "0hcm64fb2ngyalq8rci5lrr881prg023pq9cd1sfr79iynbr6a26", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#k8s-version@0.1.2": "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#stackable-versioned-macros@0.7.1": "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.7.1#stackable-versioned@0.7.1": "16klfwx3kz3ys7afwjicfj8msws9a718izx09jspwwpff3rl6wsi", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#k8s-version@0.1.2": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-operator-derive@0.3.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-operator@0.91.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-shared@0.0.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-telemetry@0.5.0": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-versioned-macros@0.7.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-versioned@0.7.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" } \ No newline at end of file diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 79aa6c43..efafbb3b 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -12,8 +12,6 @@ build = "build.rs" [dependencies] product-config.workspace = true stackable-operator.workspace = true -stackable-telemetry.workspace = true -stackable-versioned.workspace = true anyhow.workspace = true clap.workspace = true diff --git a/rust/operator-binary/src/crd/authentication.rs b/rust/operator-binary/src/crd/authentication.rs index c7bafc8d..e9071205 100644 --- a/rust/operator-binary/src/crd/authentication.rs +++ b/rust/operator-binary/src/crd/authentication.rs @@ -4,8 +4,8 @@ use stackable_operator::{ client::Client, commons::authentication::{AuthenticationClass, AuthenticationClassProvider}, schemars::{self, JsonSchema}, + versioned::versioned, }; -use stackable_versioned::versioned; use crate::crd::ObjectRef; diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 6b468346..532a95d2 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -30,8 +30,8 @@ use stackable_operator::{ status::condition::{ClusterCondition, HasStatusCondition}, time::Duration, utils::cluster_info::KubernetesClusterInfo, + versioned::versioned, }; -use stackable_versioned::versioned; use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; use crate::crd::affinity::get_affinity; diff --git a/rust/operator-binary/src/crd/tls.rs b/rust/operator-binary/src/crd/tls.rs index 50e769fe..459b7151 100644 --- a/rust/operator-binary/src/crd/tls.rs +++ b/rust/operator-binary/src/crd/tls.rs @@ -1,6 +1,8 @@ use serde::{Deserialize, Serialize}; -use stackable_operator::schemars::{self, JsonSchema}; -use stackable_versioned::versioned; +use stackable_operator::{ + schemars::{self, JsonSchema}, + versioned::versioned, +}; const TLS_DEFAULT_SECRET_CLASS: &str = "tls"; diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 547092fe..56323a5d 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,11 +1,11 @@ -use std::{ops::Deref as _, sync::Arc}; +use std::sync::Arc; use clap::Parser; use crd::{APP_NAME, OPERATOR_NAME, ZookeeperCluster, ZookeeperZnode, v1alpha1}; use futures::{StreamExt, pin_mut}; use stackable_operator::{ YamlSchema, - cli::{Command, ProductOperatorRun, RollingPeriod}, + cli::{Command, ProductOperatorRun}, k8s_openapi::api::{ apps::v1::StatefulSet, core::v1::{ConfigMap, Endpoints, Service}, @@ -22,8 +22,11 @@ use stackable_operator::{ }, logging::controller::report_controller_reconciled, shared::yaml::SerializeOptions, + telemetry::{ + Tracing, + tracing::{RollingPeriod, settings::Settings}, + }, }; -use stackable_telemetry::{Tracing, tracing::settings::Settings}; use tracing::level_filters::LevelFilter; use crate::{zk_controller::ZK_FULL_CONTROLLER_NAME, znode_controller::ZNODE_FULL_CONTROLLER_NAME}; @@ -83,7 +86,6 @@ async fn main() -> anyhow::Result<()> { let rotation_period = telemetry_arguments .rolling_logs_period .unwrap_or(RollingPeriod::Never) - .deref() .clone(); Settings::builder() From d465d3341dcb73e200a9ccfd23bb1006f0a04fa2 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 9 Apr 2025 21:19:30 +0200 Subject: [PATCH 2/5] feat!: Use `Tracing::pre_configured` from stackable-telemetry BREAKING: The console log level, file log level and directory variables have been changed --- crate-hashes.json | 2 +- rust/operator-binary/src/main.rs | 51 +++++--------------------------- 2 files changed, 8 insertions(+), 45 deletions(-) diff --git a/crate-hashes.json b/crate-hashes.json index e4629311..330394f5 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -7,4 +7,4 @@ "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-versioned-macros@0.7.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.91.1#stackable-versioned@0.7.1": "11zqwlwvfigca7lfsdch1wqd3vl694hff1avf6rhiawpnassj2cw", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" -} \ No newline at end of file +} diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 56323a5d..37229c6d 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -22,12 +22,8 @@ use stackable_operator::{ }, logging::controller::report_controller_reconciled, shared::yaml::SerializeOptions, - telemetry::{ - Tracing, - tracing::{RollingPeriod, settings::Settings}, - }, + telemetry::Tracing, }; -use tracing::level_filters::LevelFilter; use crate::{zk_controller::ZK_FULL_CONTROLLER_NAME, znode_controller::ZNODE_FULL_CONTROLLER_NAME}; @@ -45,9 +41,6 @@ mod built_info { include!(concat!(env!("OUT_DIR"), "/built.rs")); } -// TODO (@NickLarsenNZ): Change the variable to `CONSOLE_LOG` -pub const ENV_VAR_CONSOLE_LOG: &str = "ZOOKEEPER_OPERATOR_LOG"; - #[derive(clap::Parser)] #[clap(about, author)] struct Opts { @@ -71,42 +64,12 @@ async fn main() -> anyhow::Result<()> { telemetry_arguments, cluster_info_opts, }) => { - let _tracing_guard = Tracing::builder() - .service_name("zookeeper-operator") - .with_console_output(( - ENV_VAR_CONSOLE_LOG, - LevelFilter::INFO, - !telemetry_arguments.no_console_output, - )) - // NOTE (@NickLarsenNZ): Before stackable-telemetry was used, the log directory was - // set via an env: `ZOOKEEPER_OPERATOR_LOG_DIRECTORY`. - // See: https://github.com/stackabletech/operator-rs/blob/f035997fca85a54238c8de895389cc50b4d421e2/crates/stackable-operator/src/logging/mod.rs#L40 - // Now it will be `ROLLING_LOGS` (or via `--rolling-logs `). - .with_file_output(telemetry_arguments.rolling_logs.map(|log_directory| { - let rotation_period = telemetry_arguments - .rolling_logs_period - .unwrap_or(RollingPeriod::Never) - .clone(); - - Settings::builder() - .with_environment_variable(ENV_VAR_CONSOLE_LOG) - .with_default_level(LevelFilter::INFO) - .file_log_settings_builder(log_directory, "tracing-rs.json") - .with_rotation_period(rotation_period) - .build() - })) - .with_otlp_log_exporter(( - "OTLP_LOG", - LevelFilter::DEBUG, - telemetry_arguments.otlp_logs, - )) - .with_otlp_trace_exporter(( - "OTLP_TRACE", - LevelFilter::DEBUG, - telemetry_arguments.otlp_traces, - )) - .build() - .init()?; + // NOTE (@NickLarsenNZ): Before stackable-telemetry was used: + // - The console log level was set by `ZOOKEEPER_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured). + // - The file log level was set by `ZOOKEEPER_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured). + // - The file log directory was set by `ZOOKEEPER_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs `). + let _tracing_guard = + Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?; tracing::info!( built_info.pkg_version = built_info::PKG_VERSION, From 1c8e5fb5e4e75bb68a60b11ea63182adaf316e3e Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 9 Apr 2025 21:22:48 +0200 Subject: [PATCH 3/5] chore: Update changelog --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42e31fa4..7ff3d516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,11 @@ All notable changes to this project will be documented in this file. ### Changed -- Replace stackable-operator `initialize_logging` with stackable-telemetry `Tracing` ([#927]). - - BREAKING: The file log directory was set by `ZOOKEEPER_OPERATOR_LOG_DIRECTORY`, - and is now set by `ROLLING_LOGS` (or via `--rolling-logs `). +- BREAKING: Replace stackable-operator `initialize_logging` with stackable-telemetry `Tracing` ([#927], [#934]). + - The console log level was set by `ZOOKEEPER_OPERATOR_LOG`, and is now set by `CONSOLE_LOG`. + - The file log level was set by `ZOOKEEPER_OPERATOR_LOG`, and is now set by `FILE_LOG`. + - The file log directory was set by `ZOOKEEPER_OPERATOR_LOG_DIRECTORY`, and is now set + by `ROLLING_LOGS_DIR` (or via `--rolling-logs `). - Replace stackable-operator `print_startup_string` with `tracing::info!` with fields. - BREAKING: Inject the vector aggregator address into the vector config using the env var `VECTOR_AGGREGATOR_ADDRESS` instead of having the operator write it to the vector config ([#933]). @@ -18,8 +20,9 @@ All notable changes to this project will be documented in this file. - Use `json` file extension for log files ([#932]). [#927]: https://github.com/stackabletech/zookeeper-operator/pull/927 -[#933]: https://github.com/stackabletech/zookeeper-operator/pull/XXX +[#933]: https://github.com/stackabletech/zookeeper-operator/pull/934 [#932]: https://github.com/stackabletech/zookeeper-operator/pull/932 +[#934]: https://github.com/stackabletech/zookeeper-operator/pull/xxx ## [25.3.0] - 2025-03-21 From 0ab6a5c743639cb79d69163f8c6e5180c0a3e761 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 9 Apr 2025 21:26:25 +0200 Subject: [PATCH 4/5] chore: cargo update && make regenerate-nix --- Cargo.lock | 8 ++++---- Cargo.nix | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba5a2f3b..2f6f428c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,9 +276,9 @@ dependencies = [ [[package]] name = "backon" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970d91570c01a8a5959b36ad7dd1c30642df24b6b3068710066f6809f7033bb7" +checksum = "fd0b50b1b78dbadd44ab18b3c794e496f3a139abb9fbc27d9c94c4eebbb96496" dependencies = [ "fastrand", "gloo-timers", @@ -3650,9 +3650,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "xml-rs" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "yoke" diff --git a/Cargo.nix b/Cargo.nix index 25c05f5a..9fb61cc1 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -948,9 +948,9 @@ rec { }; "backon" = rec { crateName = "backon"; - version = "1.4.1"; + version = "1.5.0"; edition = "2021"; - sha256 = "1drv0gvhjs3g0q88f1mknqjdyhh6qg8pvb9nkfasba011ibr23cp"; + sha256 = "15k4p6xyxi4lkiyw5yxrmcws3wwnwjacgcqqmd2dvfldnyqm02zx"; dependencies = [ { name = "fastrand"; @@ -12757,10 +12757,10 @@ rec { }; "xml-rs" = rec { crateName = "xml-rs"; - version = "0.8.25"; + version = "0.8.26"; edition = "2021"; crateBin = []; - sha256 = "1i73ajf6scni5bi1a51r19xykgrambdx5fkks0fyg5jqqbml1ff5"; + sha256 = "1nkbzksai36pvx3ag1fn9b5cffwb1ldl66aglwcip42nkdnyfb56"; libName = "xml"; authors = [ "Vladimir Matveev " From 8840c09b80fad7cdf0571ce6788604613f2563cc Mon Sep 17 00:00:00 2001 From: Nick <10092581+NickLarsenNZ@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:23:34 +0200 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Techassi --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ff3d516..db9b58bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file. [#927]: https://github.com/stackabletech/zookeeper-operator/pull/927 [#933]: https://github.com/stackabletech/zookeeper-operator/pull/934 [#932]: https://github.com/stackabletech/zookeeper-operator/pull/932 -[#934]: https://github.com/stackabletech/zookeeper-operator/pull/xxx +[#934]: https://github.com/stackabletech/zookeeper-operator/pull/934 ## [25.3.0] - 2025-03-21