Register child span within parent scope: network::service
@@ -293,12 +293,8 @@ impl FragmentService for NodeService {
let addr = subscriber.addr();
let parent_span = self.subscription_span(subscriber, "fragments");
let subscriber = Address::tcp(addr);
- let span = span!(
- parent: parent_span,
- Level::TRACE,
- "fragment_subscription",
- direction = "in"
- );
+ parent_span.in_scope(|| {
+ let span = span!(Level::TRACE, "fragment_subscription", direction = "in");
self.global_state.spawn(
subscription::process_fragments(
stream,
@@ -309,6 +305,7 @@ impl FragmentService for NodeService {
)
.instrument(span),
);
+ });
let outbound = self
.global_state
@@ -331,8 +328,8 @@ impl GossipService for NodeService {
let addr = subscriber.addr();
let parent_span = self.subscription_span(subscriber, "gossip");
let subscriber = Address::tcp(addr);
+ parent_span.in_scope(|| {
let span = span!(
- parent: parent_span,
Level::TRACE,
"fragment_subscription",
direction = "in"
@@ -347,6 +344,7 @@ impl GossipService for NodeService {
)
.instrument(span),
);
+ });
let outbound = self
.global_state
