Backing and collator protocol traces including para-id (#2620)

* improve backing/provisioner spans

* span for collation requests

* add para_id to unbacked candidate spans

* differentiate validation-construction and find-assignment in selection

* better find-assignment spans

* organize unbacked-candidate spans directly under job root

* Update node/core/provisioner/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Robert Habermeier
2021-03-14 11:51:14 -05:00
committed by GitHub
parent bdb3256396
commit 94d50afd4e
5 changed files with 111 additions and 32 deletions
@@ -137,6 +137,9 @@ struct CollationRequest {
// The id of this request.
request_id: RequestId,
// A jaeger span corresponding to the lifetime of the request.
span: Option<jaeger::Span>,
}
impl CollationRequest {
@@ -147,11 +150,18 @@ impl CollationRequest {
received,
timeout,
request_id,
mut span,
} = self;
match received.timeout(timeout).await {
None => Timeout(request_id),
Some(_) => Received(request_id),
None => {
span.as_mut().map(|s| s.add_string_tag("success", "false"));
Timeout(request_id)
}
Some(_) => {
span.as_mut().map(|s| s.add_string_tag("success", "true"));
Received(request_id)
}
}
}
}
@@ -466,6 +476,11 @@ where
received: rx,
timeout: state.request_timeout,
request_id,
span: state.span_per_relay_parent.get(&relay_parent).map(|s| {
s.child_builder("collation-request")
.with_para_id(para_id)
.build()
}),
};
state.requested_collations.insert((relay_parent, para_id.clone(), peer_id.clone()), request_id);