Skip to content

Commit

Permalink
Add estimator name to trace (#2439)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
MartinquaXD authored Feb 27, 2024
1 parent bb874d2 commit 9164d2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/shared/src/price_estimation/instrumented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use {
futures::future::FutureExt,
prometheus::{HistogramVec, IntCounterVec},
std::{sync::Arc, time::Instant},
tracing::Instrument,
};

/// An instrumented price estimator.
Expand Down Expand Up @@ -52,6 +53,7 @@ impl PriceEstimating for InstrumentedPriceEstimator {

estimate
}
.instrument(tracing::info_span!("estimator", name = &self.name,))
.boxed()
}
}
Expand Down

0 comments on commit 9164d2b

Please sign in to comment.