feat/jaeger: more spans, more stages (#2477)

* feat/jaeger: more spans, more stages

Stage numbers are still arbitrarily picked.

* feat/jaeger: additional spans

* chore/spellcheck: improve the dictionary

* fix/jaeger JaegerSpan -> jaeger::Span
This commit is contained in:
Bernhard Schuster
2021-02-19 15:19:43 +01:00
committed by GitHub
parent a5defa7c7f
commit 49c6aa9a76
22 changed files with 249 additions and 143 deletions
@@ -45,7 +45,7 @@ use polkadot_subsystem::messages::{
NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, NetworkBridgeEvent
};
use polkadot_subsystem::{
jaeger, errors::{ChainApiError, RuntimeApiError}, PerLeafSpan,
jaeger, errors::{ChainApiError, RuntimeApiError}, PerLeafSpan, Stage,
ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, SubsystemContext, SubsystemError,
};
use std::collections::{HashMap, HashSet};
@@ -166,7 +166,7 @@ struct PerCandidate {
live_in: HashSet<Hash>,
/// A Jaeger span relating to this candidate.
span: jaeger::JaegerSpan,
span: jaeger::Span,
}
impl PerCandidate {
@@ -185,7 +185,7 @@ impl PerCandidate {
fn drop_span_after_own_availability(&mut self) {
if let Some(validator_index) = self.validator_index {
if self.message_vault.contains_key(&validator_index) {
self.span = jaeger::JaegerSpan::Disabled;
self.span = jaeger::Span::Disabled;
}
}
}
@@ -251,7 +251,7 @@ impl ProtocolState {
span: if validator_index.is_some() {
jaeger::candidate_hash_span(&receipt_hash, "pending-availability")
} else {
jaeger::JaegerSpan::Disabled
jaeger::Span::Disabled
},
})
} else {
@@ -262,7 +262,10 @@ impl ProtocolState {
};
// Create some span that will make it able to switch between the candidate and relay parent span.
let span = per_relay_parent.span.child_with_candidate("live-candidate", &receipt_hash);
let span = per_relay_parent.span.child_builder("live-candidate")
.with_candidate(&receipt_hash)
.with_stage(Stage::AvailabilityDistribution)
.build();
candidate_entry.span.add_follows_from(&span);
candidate_entry.live_in.insert(relay_parent);
}