diff --git a/CHANGELOG.md b/CHANGELOG.md index c008e013..e81dbd80 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` ([#703]). - - BREAKING: The file log directory was set by `DRUID_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS` - (or via `--rolling-logs `). +- BREAKING: Replace stackable-operator `initialize_logging` with stackable-telemetry `Tracing` ([#703], [#710]). + - The console log level was set by `DRUID_OPERATOR_LOG`, and is now set by `CONSOLE_LOG`. + - The file log level was set by `DRUID_OPERATOR_LOG`, and is now set by `FILE_LOG`. + - The file log directory was set by `DRUID_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 ([#704]). @@ -21,6 +23,7 @@ All notable changes to this project will be documented in this file. [#703]: https://github.com/stackabletech/druid-operator/pull/703 [#704]: https://github.com/stackabletech/druid-operator/pull/704 [#709]: https://github.com/stackabletech/druid-operator/pull/709 +[#710]: https://github.com/stackabletech/druid-operator/pull/710 ## [25.3.0] - 2025-03-21 diff --git a/Cargo.lock b/Cargo.lock index fb4a89a9..9c90281d 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", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] @@ -1497,7 +1497,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", @@ -1707,9 +1707,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -2715,8 +2715,6 @@ dependencies = [ "serde_yaml", "snafu 0.8.5", "stackable-operator", - "stackable-telemetry", - "stackable-versioned", "strum", "tokio", "tracing", @@ -2724,8 +2722,8 @@ dependencies = [ [[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", @@ -2749,6 +2747,8 @@ dependencies = [ "snafu 0.8.5", "stackable-operator-derive", "stackable-shared", + "stackable-telemetry", + "stackable-versioned", "strum", "tokio", "tracing", @@ -2760,7 +2760,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", @@ -2771,7 +2771,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", @@ -2782,10 +2782,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", @@ -2793,6 +2794,7 @@ dependencies = [ "opentelemetry_sdk", "pin-project", "snafu 0.8.5", + "strum", "tokio", "tower 0.5.2", "tracing", @@ -2804,7 +2806,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", ] @@ -2812,7 +2814,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", @@ -3766,9 +3768,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 4ec69ec9..6d63f7d6 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"; @@ -1697,9 +1697,9 @@ rec { }; "crossbeam-channel" = rec { crateName = "crossbeam-channel"; - version = "0.5.14"; + version = "0.5.15"; edition = "2021"; - sha256 = "0wa41qybq5w8s70anb472myh4fid4aw6v65vws6wn528w9l6vfh6"; + sha256 = "1cicd9ins0fkpfgvz9vhz3m9rpkh6n8d3437c3wnfsdkd3wgif42"; libName = "crossbeam_channel"; dependencies = [ { @@ -4695,12 +4695,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 = [ @@ -5544,9 +5544,9 @@ rec { }; "miniz_oxide" = rec { crateName = "miniz_oxide"; - version = "0.8.7"; + version = "0.8.8"; edition = "2021"; - sha256 = "0c4lj692adnzw0h9j8l24d7imds3icpgdkk3b03zlhxf90zcww7z"; + sha256 = "0al9iy33flfgxawj789w2c8xxwg1n2r5vv6m6p5hl2fvd2vlgriv"; authors = [ "Frommi " "oyvindln " @@ -8794,15 +8794,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"; @@ -8840,13 +8832,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 = [ @@ -8951,6 +8943,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"; @@ -8981,8 +8983,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"; @@ -8991,8 +8996,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"; @@ -9026,8 +9031,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 = [ @@ -9062,13 +9067,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 = [ @@ -9079,6 +9084,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"; @@ -9110,6 +9121,11 @@ rec { name = "snafu"; packageId = "snafu 0.8.5"; } + { + name = "strum"; + packageId = "strum"; + features = [ "derive" ]; + } { name = "tokio"; packageId = "tokio"; @@ -9149,17 +9165,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 = [ @@ -9180,12 +9199,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"; @@ -13042,10 +13061,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 " diff --git a/Cargo.toml b/Cargo.toml index 3105e870..5bceea94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,7 @@ repository = "https://github.com/stackabletech/druid-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..330394f5 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 12a10b38..6bce1b1f 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -11,8 +11,6 @@ publish = false [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/mod.rs b/rust/operator-binary/src/crd/mod.rs index 435f1547..4292cde7 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -38,8 +38,8 @@ use stackable_operator::{ COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo, crds::raw_object_list_schema, }, + versioned::versioned, }; -use stackable_versioned::versioned; use strum::{Display, EnumDiscriminants, EnumIter, EnumString, IntoStaticStr}; use crate::crd::{ diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 92c4cafd..ada490c4 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 druid_controller::{DRUID_CONTROLLER_NAME, FULL_CONTROLLER_NAME}; use futures::StreamExt; use stackable_operator::{ YamlSchema, - cli::{Command, ProductOperatorRun, RollingPeriod}, + cli::{Command, ProductOperatorRun}, k8s_openapi::api::{ apps::v1::StatefulSet, core::v1::{ConfigMap, Service}, @@ -22,9 +22,8 @@ use stackable_operator::{ }, logging::controller::report_controller_reconciled, shared::yaml::SerializeOptions, + telemetry::Tracing, }; -use stackable_telemetry::{Tracing, tracing::settings::Settings}; -use tracing::level_filters::LevelFilter; use crate::crd::{DruidCluster, OPERATOR_NAME, v1alpha1}; @@ -42,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 = "DRUID_OPERATOR_LOG"; - #[derive(Parser)] #[clap(about, author)] struct Opts { @@ -64,45 +60,12 @@ async fn main() -> anyhow::Result<()> { telemetry_arguments, cluster_info_opts, }) => { - let _tracing_guard = Tracing::builder() - // TODO (@Techassi): This should be a constant - .service_name("druid-operator") - .with_console_output(( - ENV_VAR_CONSOLE_LOG, - LevelFilter::INFO, - !telemetry_arguments.no_console_output, - )) - // NOTE (@Techassi): Before stackable-telemetry was used, the log directory was - // set via an env: `DRUID_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::Hourly) - .deref() - .clone(); - - Settings::builder() - // TODO (@Techassi): Change to CONSOLE_LOG or FILE_LOG, create constant - .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 `DRUID_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured). + // - The file log level was set by `DRUID_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured). + // - The file log directory was set by `DRUID_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,