Skip to content

Commit

Permalink
allow disabling with env var
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jan 2, 2024
1 parent caf05c4 commit 8a079a0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/runtime/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::path::PathBuf;
use either::Either;
use risingwave_common::metrics::MetricsLayer;
use risingwave_common::util::deployment::Deployment;
use risingwave_common::util::env_var::env_var_is_true;
use risingwave_common::util::query_log::*;
use thiserror_ext::AsReport;
use tracing::level_filters::LevelFilter as Level;
Expand Down Expand Up @@ -59,10 +60,12 @@ impl LoggerSettings {
///
/// If env var `RW_TRACING_ENDPOINT` is not set, the meta address will be used
/// as the default tracing endpoint, which means that the embedded tracing
/// collector will be used.
/// collector will be used. This can be disabled by setting env var
/// `RW_DISABLE_EMBEDDED_TRACING` to `true`.
pub fn from_opts<O: risingwave_common::opts::Opts>(opts: &O) -> Self {
let mut settings = Self::new(O::name());
if settings.tracing_endpoint.is_none() // no explicit env var is set
if settings.tracing_endpoint.is_none() // no explicit endpoint
&& !env_var_is_true("RW_DISABLE_EMBEDDED_TRACING") // not disabled by env var
&& let Some(addr) = opts.meta_addr().exactly_one() // meta address is valid
&& !Deployment::current().is_ci()
// not in CI
Expand Down

0 comments on commit 8a079a0

Please sign in to comment.