mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Fix telemetry span not entering properly & enter span in sc-cli (#7951)
* WIP * WIP * Test * bug fix * WIP * Revert "WIP" This reverts commit 4e51e9adfdf0dc7cf37b562b60a0e83ca1d0b00d. * doc * Improve comment on why all spans are preserved * Added missing suggestion from previous PR * Use BoxFuture * Move TelemetrySpan creation to sc-cli, need to test... * Test code * Adapt user code * Revert "Test code" This reverts commit 333806b2fe1626efaa2691f9f44d0b4dd979bc36. * Update client/service/src/task_manager/mod.rs Co-authored-by: David <dvdplm@gmail.com> * Better & simpler solution Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
@@ -91,10 +91,7 @@ impl SpawnTaskHandle {
|
||||
metrics.tasks_ended.with_label_values(&[name, "finished"]).inc_by(0);
|
||||
}
|
||||
|
||||
let telemetry_span = self.telemetry_span.clone();
|
||||
let future = async move {
|
||||
let _telemetry_entered = telemetry_span.as_ref().map(|x| x.enter());
|
||||
|
||||
if let Some(metrics) = metrics {
|
||||
// Add some wrappers around `task`.
|
||||
let task = {
|
||||
@@ -127,7 +124,11 @@ impl SpawnTaskHandle {
|
||||
}
|
||||
};
|
||||
|
||||
let join_handle = self.executor.spawn(Box::pin(future.in_current_span()), task_type);
|
||||
let join_handle = {
|
||||
let _span = self.telemetry_span.as_ref().map(|s| s.enter());
|
||||
self.executor.spawn(Box::pin(future.in_current_span()), task_type)
|
||||
};
|
||||
|
||||
let mut task_notifier = self.task_notifier.clone();
|
||||
self.executor.spawn(
|
||||
Box::pin(async move {
|
||||
|
||||
Reference in New Issue
Block a user