mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
refactor(config): add independent toggles for enabling traces and metrics (#1020)
This commit is contained in:
@ -34,7 +34,7 @@ async fn main() -> ApplicationResult<()> {
|
||||
conf.validate()
|
||||
.expect("Failed to validate router configuration");
|
||||
|
||||
let _guard = logger::setup(&conf.log)?;
|
||||
let _guard = logger::setup(&conf.log);
|
||||
|
||||
logger::info!("Application started [{:?}] [{:?}]", conf.server, conf.log);
|
||||
|
||||
|
||||
@ -28,8 +28,7 @@ async fn main() -> CustomResult<(), errors::ProcessTrackerError> {
|
||||
redis_shutdown_signal_rx,
|
||||
tx.clone(),
|
||||
));
|
||||
let _guard =
|
||||
logger::setup(&state.conf.log).map_err(|_| errors::ProcessTrackerError::UnexpectedFlow)?;
|
||||
let _guard = logger::setup(&state.conf.log);
|
||||
|
||||
logger::debug!(startup_config=?state.conf);
|
||||
|
||||
|
||||
@ -4,12 +4,8 @@ pub mod logger {
|
||||
#[doc(inline)]
|
||||
pub use router_env::{log, logger::*};
|
||||
|
||||
// TODO (prom-monitoring): Ideally tracing/opentelemetry structs shouldn't be pushed out.
|
||||
// Return a custom error type instead of `opentelemetry::metrics::MetricsError`.
|
||||
/// Setup logging sub-system.
|
||||
pub fn setup(
|
||||
conf: &config::Log,
|
||||
) -> Result<TelemetryGuard, router_env::opentelemetry::metrics::MetricsError> {
|
||||
pub fn setup(conf: &config::Log) -> TelemetryGuard {
|
||||
router_env::setup(conf, router_env::service_name!(), ["actix_server"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user