Unverified Commit e28bcbd2 authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

adjust span names (#2135)

* adjust span names

* fix compile
parent f714f5f4
Pipeline #117543 passed with stages
in 25 minutes and 37 seconds
...@@ -76,7 +76,7 @@ async fn get_core_availability( ...@@ -76,7 +76,7 @@ async fn get_core_availability(
validator_idx: ValidatorIndex, validator_idx: ValidatorIndex,
sender: &Mutex<&mut mpsc::Sender<FromJobCommand>>, sender: &Mutex<&mut mpsc::Sender<FromJobCommand>>,
) -> Result<bool, Error> { ) -> Result<bool, Error> {
let span = jaeger::hash_span(&relay_parent, "core_availability"); let span = jaeger::hash_span(&relay_parent, "core-availability");
if let CoreState::Occupied(core) = core { if let CoreState::Occupied(core) = core {
tracing::trace!(target: LOG_TARGET, para_id = %core.para_id, "Getting core availability"); tracing::trace!(target: LOG_TARGET, para_id = %core.para_id, "Getting core availability");
...@@ -144,7 +144,6 @@ async fn get_availability_cores( ...@@ -144,7 +144,6 @@ async fn get_availability_cores(
relay_parent: Hash, relay_parent: Hash,
sender: &mut mpsc::Sender<FromJobCommand>, sender: &mut mpsc::Sender<FromJobCommand>,
) -> Result<Vec<CoreState>, Error> { ) -> Result<Vec<CoreState>, Error> {
let _span = jaeger::hash_span(&relay_parent, "get availability cores");
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
sender sender
.send(AllMessages::from(RuntimeApiMessage::Request(relay_parent, RuntimeApiRequest::AvailabilityCores(tx))).into()) .send(AllMessages::from(RuntimeApiMessage::Request(relay_parent, RuntimeApiRequest::AvailabilityCores(tx))).into())
...@@ -160,14 +159,18 @@ async fn get_availability_cores( ...@@ -160,14 +159,18 @@ async fn get_availability_cores(
/// - for each core, concurrently determine chunk availability (see `get_core_availability`) /// - for each core, concurrently determine chunk availability (see `get_core_availability`)
/// - return the bitfield if there were no errors at any point in this process /// - return the bitfield if there were no errors at any point in this process
/// (otherwise, it's prone to false negatives) /// (otherwise, it's prone to false negatives)
#[tracing::instrument(level = "trace", skip(sender), fields(subsystem = LOG_TARGET))] #[tracing::instrument(level = "trace", skip(sender, span), fields(subsystem = LOG_TARGET))]
async fn construct_availability_bitfield( async fn construct_availability_bitfield(
relay_parent: Hash, relay_parent: Hash,
span: &jaeger::JaegerSpan,
validator_idx: ValidatorIndex, validator_idx: ValidatorIndex,
sender: &mut mpsc::Sender<FromJobCommand>, sender: &mut mpsc::Sender<FromJobCommand>,
) -> Result<AvailabilityBitfield, Error> { ) -> Result<AvailabilityBitfield, Error> {
// get the set of availability cores from the runtime // get the set of availability cores from the runtime
let availability_cores = get_availability_cores(relay_parent, sender).await?; let availability_cores = {
let _span = span.child("get-availability-cores");
get_availability_cores(relay_parent, sender).await?
};
// Wrap the sender in a Mutex to share it between the futures. // Wrap the sender in a Mutex to share it between the futures.
// //
...@@ -274,7 +277,12 @@ impl JobTrait for BitfieldSigningJob { ...@@ -274,7 +277,12 @@ impl JobTrait for BitfieldSigningJob {
let _span = span.child("availablity"); let _span = span.child("availablity");
let bitfield = let bitfield =
match construct_availability_bitfield(relay_parent, validator.index(), &mut sender).await match construct_availability_bitfield(
relay_parent,
&span,
validator.index(),
&mut sender,
).await
{ {
Err(Error::Runtime(runtime_err)) => { Err(Error::Runtime(runtime_err)) => {
// Don't take down the node on runtime API errors. // Don't take down the node on runtime API errors.
...@@ -338,7 +346,12 @@ mod tests { ...@@ -338,7 +346,12 @@ mod tests {
let relay_parent = Hash::default(); let relay_parent = Hash::default();
let validator_index = 1u32; let validator_index = 1u32;
let future = construct_availability_bitfield(relay_parent, validator_index, &mut sender).fuse(); let future = construct_availability_bitfield(
relay_parent,
&jaeger::JaegerSpan::Disabled,
validator_index,
&mut sender,
).fuse();
pin_mut!(future); pin_mut!(future);
loop { loop {
......
...@@ -102,7 +102,7 @@ impl JobTrait for CandidateSelectionJob { ...@@ -102,7 +102,7 @@ impl JobTrait for CandidateSelectionJob {
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>> { ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>> {
let span = jaeger::hash_span(&relay_parent, "candidate-selection:run"); let span = jaeger::hash_span(&relay_parent, "candidate-selection:run");
async move { async move {
let _span = span.child("query runtime"); let _span = span.child("query-runtime");
let (groups, cores) = futures::try_join!( let (groups, cores) = futures::try_join!(
try_runtime_api!(request_validator_groups(relay_parent, &mut sender).await), try_runtime_api!(request_validator_groups(relay_parent, &mut sender).await),
try_runtime_api!(request_from_runtime( try_runtime_api!(request_from_runtime(
...@@ -116,7 +116,7 @@ impl JobTrait for CandidateSelectionJob { ...@@ -116,7 +116,7 @@ impl JobTrait for CandidateSelectionJob {
let cores = try_runtime_api!(cores); let cores = try_runtime_api!(cores);
drop(_span); drop(_span);
let _span = span.child("find assignment"); let _span = span.child("find-assignment");
let n_cores = cores.len(); let n_cores = cores.len();
...@@ -171,7 +171,7 @@ impl CandidateSelectionJob { ...@@ -171,7 +171,7 @@ impl CandidateSelectionJob {
} }
async fn run_loop(&mut self, span: &jaeger::JaegerSpan) -> Result<(), Error> { async fn run_loop(&mut self, span: &jaeger::JaegerSpan) -> Result<(), Error> {
let span = span.child("run loop"); let span = span.child("run-loop");
loop { loop {
match self.receiver.next().await { match self.receiver.next().await {
Some(CandidateSelectionMessage::Collation( Some(CandidateSelectionMessage::Collation(
...@@ -179,14 +179,14 @@ impl CandidateSelectionJob { ...@@ -179,14 +179,14 @@ impl CandidateSelectionJob {
para_id, para_id,
collator_id, collator_id,
)) => { )) => {
let _span = span.child("handle collation"); let _span = span.child("handle-collation");
self.handle_collation(relay_parent, para_id, collator_id).await; self.handle_collation(relay_parent, para_id, collator_id).await;
} }
Some(CandidateSelectionMessage::Invalid( Some(CandidateSelectionMessage::Invalid(
_, _,
candidate_receipt, candidate_receipt,
)) => { )) => {
let _span = span.child("handle invalid"); let _span = span.child("handle-invalid");
self.handle_invalid(candidate_receipt).await; self.handle_invalid(candidate_receipt).await;
} }
None => break, None => break,
......
...@@ -197,7 +197,7 @@ where ...@@ -197,7 +197,7 @@ where
) -> Self::Proposal { ) -> Self::Proposal {
async move { async move {
let span = jaeger::hash_span(&self.parent_header_hash, "propose"); let span = jaeger::hash_span(&self.parent_header_hash, "propose");
let _span = span.child("get provisioner"); let _span = span.child("get-provisioner");
let provisioner_data = match self.get_provisioner_data().await { let provisioner_data = match self.get_provisioner_data().await {
Ok(pd) => pd, Ok(pd) => pd,
...@@ -214,7 +214,7 @@ where ...@@ -214,7 +214,7 @@ where
&provisioner_data, &provisioner_data,
)?; )?;
let _span = span.child("authorship propose"); let _span = span.child("authorship-propose");
self.inner self.inner
.propose(inherent_data, inherent_digests, max_duration, record_proof) .propose(inherent_data, inherent_digests, max_duration, record_proof)
.await .await
......
...@@ -155,7 +155,7 @@ impl JobTrait for ProvisioningJob { ...@@ -155,7 +155,7 @@ impl JobTrait for ProvisioningJob {
sender, sender,
receiver, receiver,
); );
let span = jaeger::hash_span(&relay_parent, "provisioner"); let span = jaeger::hash_span(&relay_parent, "provisioner");
// it isn't necessary to break run_loop into its own function, // it isn't necessary to break run_loop into its own function,
...@@ -194,7 +194,7 @@ impl ProvisioningJob { ...@@ -194,7 +194,7 @@ impl ProvisioningJob {
futures::select! { futures::select! {
msg = self.receiver.next().fuse() => match msg { msg = self.receiver.next().fuse() => match msg {
Some(RequestInherentData(_, return_sender)) => { Some(RequestInherentData(_, return_sender)) => {
let _span = span.child("req inherent data"); let _span = span.child("req-inherent-data");
let _timer = self.metrics.time_request_inherent_data(); let _timer = self.metrics.time_request_inherent_data();
if self.inherent_after.is_ready() { if self.inherent_after.is_ready() {
...@@ -204,11 +204,11 @@ impl ProvisioningJob { ...@@ -204,11 +204,11 @@ impl ProvisioningJob {
} }
} }
Some(RequestBlockAuthorshipData(_, sender)) => { Some(RequestBlockAuthorshipData(_, sender)) => {
let _span = span.child("req block authorship"); let _span = span.child("req-block-authorship");
self.provisionable_data_channels.push(sender) self.provisionable_data_channels.push(sender)
} }
Some(ProvisionableData(_, data)) => { Some(ProvisionableData(_, data)) => {
let _span = span.child("provisionable data"); let _span = span.child("provisionable-data");
let _timer = self.metrics.time_provisionable_data(); let _timer = self.metrics.time_provisionable_data();
let mut bad_indices = Vec::new(); let mut bad_indices = Vec::new();
...@@ -246,7 +246,7 @@ impl ProvisioningJob { ...@@ -246,7 +246,7 @@ impl ProvisioningJob {
None => break, None => break,
}, },
_ = self.inherent_after.ready().fuse() => { _ = self.inherent_after.ready().fuse() => {
let _span = span.child("send inherent data"); let _span = span.child("send-inherent-data");
let return_senders = std::mem::take(&mut self.awaiting_inherent); let return_senders = std::mem::take(&mut self.awaiting_inherent);
if !return_senders.is_empty() { if !return_senders.is_empty() {
self.send_inherent_data(return_senders).await; self.send_inherent_data(return_senders).await;
......
...@@ -310,7 +310,7 @@ async fn relay_message<Context>( ...@@ -310,7 +310,7 @@ async fn relay_message<Context>(
where where
Context: SubsystemContext<Message = BitfieldDistributionMessage>, Context: SubsystemContext<Message = BitfieldDistributionMessage>,
{ {
let span = jaeger::hash_span(&message.relay_parent, "relay_msg"); let span = jaeger::hash_span(&message.relay_parent, "relay-msg");
let _span = span.child("provisionable"); let _span = span.child("provisionable");
// notify the overseer about a new and valid signed bitfield // notify the overseer about a new and valid signed bitfield
...@@ -327,7 +327,7 @@ where ...@@ -327,7 +327,7 @@ where
drop(_span); drop(_span);
let _span = span.child("interested peers"); let _span = span.child("interested-peers");
// pass on the bitfield distribution to all interested peers // pass on the bitfield distribution to all interested peers
let interested_peers = peer_views let interested_peers = peer_views
.iter() .iter()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment