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(
validator_idx: ValidatorIndex,
sender: &Mutex<&mut mpsc::Sender<FromJobCommand>>,
) -> 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 {
tracing::trace!(target: LOG_TARGET, para_id = %core.para_id, "Getting core availability");
......@@ -144,7 +144,6 @@ async fn get_availability_cores(
relay_parent: Hash,
sender: &mut mpsc::Sender<FromJobCommand>,
) -> Result<Vec<CoreState>, Error> {
let _span = jaeger::hash_span(&relay_parent, "get availability cores");
let (tx, rx) = oneshot::channel();
sender
.send(AllMessages::from(RuntimeApiMessage::Request(relay_parent, RuntimeApiRequest::AvailabilityCores(tx))).into())
......@@ -160,14 +159,18 @@ async fn get_availability_cores(
/// - 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
/// (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(
relay_parent: Hash,
span: &jaeger::JaegerSpan,
validator_idx: ValidatorIndex,
sender: &mut mpsc::Sender<FromJobCommand>,
) -> Result<AvailabilityBitfield, Error> {
// 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.
//
......@@ -274,7 +277,12 @@ impl JobTrait for BitfieldSigningJob {
let _span = span.child("availablity");
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)) => {
// Don't take down the node on runtime API errors.
......@@ -338,7 +346,12 @@ mod tests {
let relay_parent = Hash::default();
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);
loop {
......
......@@ -102,7 +102,7 @@ impl JobTrait for CandidateSelectionJob {
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>> {
let span = jaeger::hash_span(&relay_parent, "candidate-selection:run");
async move {
let _span = span.child("query runtime");
let _span = span.child("query-runtime");
let (groups, cores) = futures::try_join!(
try_runtime_api!(request_validator_groups(relay_parent, &mut sender).await),
try_runtime_api!(request_from_runtime(
......@@ -116,7 +116,7 @@ impl JobTrait for CandidateSelectionJob {
let cores = try_runtime_api!(cores);
drop(_span);
let _span = span.child("find assignment");
let _span = span.child("find-assignment");
let n_cores = cores.len();
......@@ -171,7 +171,7 @@ impl CandidateSelectionJob {
}
async fn run_loop(&mut self, span: &jaeger::JaegerSpan) -> Result<(), Error> {
let span = span.child("run loop");
let span = span.child("run-loop");
loop {
match self.receiver.next().await {
Some(CandidateSelectionMessage::Collation(
......@@ -179,14 +179,14 @@ impl CandidateSelectionJob {
para_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;
}
Some(CandidateSelectionMessage::Invalid(
_,
candidate_receipt,
)) => {
let _span = span.child("handle invalid");
let _span = span.child("handle-invalid");
self.handle_invalid(candidate_receipt).await;
}
None => break,
......
......@@ -197,7 +197,7 @@ where
) -> Self::Proposal {
async move {
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 {
Ok(pd) => pd,
......@@ -214,7 +214,7 @@ where
&provisioner_data,
)?;
let _span = span.child("authorship propose");
let _span = span.child("authorship-propose");
self.inner
.propose(inherent_data, inherent_digests, max_duration, record_proof)
.await
......
......@@ -155,7 +155,7 @@ impl JobTrait for ProvisioningJob {
sender,
receiver,
);
let span = jaeger::hash_span(&relay_parent, "provisioner");
// it isn't necessary to break run_loop into its own function,
......@@ -194,7 +194,7 @@ impl ProvisioningJob {
futures::select! {
msg = self.receiver.next().fuse() => match msg {
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();
if self.inherent_after.is_ready() {
......@@ -204,11 +204,11 @@ impl ProvisioningJob {
}
}
Some(RequestBlockAuthorshipData(_, sender)) => {
let _span = span.child("req block authorship");
let _span = span.child("req-block-authorship");
self.provisionable_data_channels.push(sender)
}
Some(ProvisionableData(_, data)) => {
let _span = span.child("provisionable data");
let _span = span.child("provisionable-data");
let _timer = self.metrics.time_provisionable_data();
let mut bad_indices = Vec::new();
......@@ -246,7 +246,7 @@ impl ProvisioningJob {
None => break,
},
_ = 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);
if !return_senders.is_empty() {
self.send_inherent_data(return_senders).await;
......
......@@ -310,7 +310,7 @@ async fn relay_message<Context>(
where
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");
// notify the overseer about a new and valid signed bitfield
......@@ -327,7 +327,7 @@ where
drop(_span);
let _span = span.child("interested peers");
let _span = span.child("interested-peers");
// pass on the bitfield distribution to all interested peers
let interested_peers = peer_views
.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