|
108 | 108 | //! |
109 | 109 | use std::{ |
110 | 110 | ffi::OsStr, |
111 | | - ops::Deref, |
112 | 111 | path::{Path, PathBuf}, |
113 | 112 | }; |
114 | 113 |
|
115 | 114 | use clap::Args; |
116 | 115 | use product_config::ProductConfigManager; |
117 | 116 | use snafu::{ResultExt, Snafu}; |
| 117 | +use stackable_telemetry::tracing::TelemetryOptions; |
118 | 118 |
|
119 | 119 | use crate::{namespace::WatchNamespace, utils::cluster_info::KubernetesClusterInfoOpts}; |
120 | 120 |
|
@@ -219,7 +219,7 @@ pub struct ProductOperatorRun { |
219 | 219 | pub watch_namespace: WatchNamespace, |
220 | 220 |
|
221 | 221 | #[command(flatten)] |
222 | | - pub telemetry_arguments: TelemetryArguments, |
| 222 | + pub telemetry_arguments: TelemetryOptions, |
223 | 223 |
|
224 | 224 | #[command(flatten)] |
225 | 225 | pub cluster_info_opts: KubernetesClusterInfoOpts, |
@@ -280,50 +280,6 @@ impl ProductConfigPath { |
280 | 280 | } |
281 | 281 | } |
282 | 282 |
|
283 | | -#[derive(Debug, Default, PartialEq, Eq, Args)] |
284 | | -pub struct TelemetryArguments { |
285 | | - /// Disable console output. |
286 | | - #[arg(long, env)] |
287 | | - pub no_console_output: bool, |
288 | | - |
289 | | - /// Enable logging to rolling files located in the specified DIRECTORY. |
290 | | - #[arg(long, env, value_name = "DIRECTORY", group = "rolling_logs_group")] |
291 | | - pub rolling_logs: Option<PathBuf>, |
292 | | - |
293 | | - /// Time PERIOD after which log files are rolled over. |
294 | | - #[arg(long, env, value_name = "PERIOD", requires = "rolling_logs_group")] |
295 | | - pub rolling_logs_period: Option<RollingPeriod>, |
296 | | - |
297 | | - /// Enable exporting traces via OTLP. |
298 | | - #[arg(long, env)] |
299 | | - pub otlp_traces: bool, |
300 | | - |
301 | | - /// Enable exporting logs via OTLP. |
302 | | - #[arg(long, env)] |
303 | | - pub otlp_logs: bool, |
304 | | -} |
305 | | - |
306 | | -#[derive(Clone, Debug, PartialEq, Eq, strum::Display, strum::EnumString, clap::ValueEnum)] |
307 | | -pub enum RollingPeriod { |
308 | | - Minutely, |
309 | | - Hourly, |
310 | | - Daily, |
311 | | - Never, |
312 | | -} |
313 | | - |
314 | | -impl Deref for RollingPeriod { |
315 | | - type Target = tracing_appender::rolling::Rotation; |
316 | | - |
317 | | - fn deref(&self) -> &Self::Target { |
318 | | - match self { |
319 | | - RollingPeriod::Minutely => &tracing_appender::rolling::Rotation::MINUTELY, |
320 | | - RollingPeriod::Hourly => &tracing_appender::rolling::Rotation::HOURLY, |
321 | | - RollingPeriod::Daily => &tracing_appender::rolling::Rotation::DAILY, |
322 | | - RollingPeriod::Never => &tracing_appender::rolling::Rotation::NEVER, |
323 | | - } |
324 | | - } |
325 | | -} |
326 | | - |
327 | 283 | #[cfg(test)] |
328 | 284 | mod tests { |
329 | 285 | use std::{env, fs::File}; |
|
0 commit comments