From 9164d2b5f875e7ad19bfd1263aeb07c1a9ff5b7d Mon Sep 17 00:00:00 2001 From: Martin Beckmann Date: Tue, 27 Feb 2024 09:24:23 +0100 Subject: [PATCH] Add estimator name to trace (#2439) # Description Currently it's a bit finicky to figure out which logs where emitted from which estimator in the orderbook/autopilot. This PR adds the estimator name to all logs emitted by an instrumented estimator. --- crates/shared/src/price_estimation/instrumented.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/shared/src/price_estimation/instrumented.rs b/crates/shared/src/price_estimation/instrumented.rs index 8b5be0b76b..4e2c1fb9d9 100644 --- a/crates/shared/src/price_estimation/instrumented.rs +++ b/crates/shared/src/price_estimation/instrumented.rs @@ -3,6 +3,7 @@ use { futures::future::FutureExt, prometheus::{HistogramVec, IntCounterVec}, std::{sync::Arc, time::Instant}, + tracing::Instrument, }; /// An instrumented price estimator. @@ -52,6 +53,7 @@ impl PriceEstimating for InstrumentedPriceEstimator { estimate } + .instrument(tracing::info_span!("estimator", name = &self.name,)) .boxed() } }