observability: tracing gum, automatically cross ref traceID (#5079)

* add some gum

* bump expander

* gum

* fix all remaining issues

* last fixup

* Update node/gum/proc-macro/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* change

* netowrk

* fixins

* chore

* allow optional fmt str + args, prep for expr as kv field

* tracing -> gum rename fallout

* restrict further

* allow multiple levels of field accesses

* another round of docs and a slip of the pen

* update ADR

* fixup lock fiel

* use target: instead of target=

* minors

* fix

* chore

* Update node/gum/README.md

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
This commit is contained in:
Bernhard Schuster
2022-03-15 12:05:16 +01:00
committed by GitHub
parent fa359fd1f7
commit d631f1dea8
130 changed files with 1708 additions and 808 deletions
+15 -20
View File
@@ -185,7 +185,7 @@ async fn handle_pvf_check(
outcome: PreCheckOutcome,
validation_code_hash: ValidationCodeHash,
) {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
?validation_code_hash,
"Received pre-check result: {:?}",
@@ -200,7 +200,7 @@ async fn handle_pvf_check(
//
// Returning here will leave the PVF in the view dangling. Since it is there, no new
// pre-checking request will be sent.
tracing::info!(
gum::info!(
target: LOG_TARGET,
?validation_code_hash,
"Pre-check failed, abstaining from voting",
@@ -212,7 +212,7 @@ async fn handle_pvf_check(
match state.view.on_judgement(validation_code_hash, judgement) {
Ok(()) => (),
Err(()) => {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
?validation_code_hash,
"received judgement for an unknown (or removed) PVF hash",
@@ -254,7 +254,7 @@ async fn handle_from_overseer(
) -> Option<Conclude> {
match from_overseer {
FromOverseer::Signal(OverseerSignal::Conclude) => {
tracing::info!(target: LOG_TARGET, "Received `Conclude` signal, exiting");
gum::info!(target: LOG_TARGET, "Received `Conclude` signal, exiting");
Some(Conclude)
},
FromOverseer::Signal(OverseerSignal::BlockFinalized(_, _)) => {
@@ -360,7 +360,7 @@ async fn examine_activation(
leaf_hash: Hash,
leaf_number: BlockNumber,
) -> Option<ActivationEffect> {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
"Examining activation of leaf {:?} ({})",
leaf_hash,
@@ -370,7 +370,7 @@ async fn examine_activation(
let pending_pvfs = match runtime_api::pvfs_require_precheck(sender, leaf_hash).await {
Err(runtime_api::RuntimeRequestError::NotSupported) => return None,
Err(_) => {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
relay_parent = ?leaf_hash,
"cannot fetch PVFs that require pre-checking from runtime API",
@@ -398,7 +398,7 @@ async fn examine_activation(
None
},
Err(e) => {
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
relay_parent = ?leaf_hash,
"cannot fetch session index from runtime API: {:?}",
@@ -421,7 +421,7 @@ async fn check_signing_credentials(
let validators = match runtime_api::validators(sender, leaf).await {
Ok(v) => v,
Err(e) => {
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
relay_parent = ?leaf,
"error occured during requesting validators: {:?}",
@@ -453,7 +453,7 @@ async fn sign_and_submit_pvf_check_statement(
judgement: Judgement,
validation_code_hash: ValidationCodeHash,
) {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
?validation_code_hash,
?relay_parent,
@@ -464,7 +464,7 @@ async fn sign_and_submit_pvf_check_statement(
metrics.on_vote_submission_started();
if voted.contains(&validation_code_hash) {
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
relay_parent = ?relay_parent,
?validation_code_hash,
@@ -491,7 +491,7 @@ async fn sign_and_submit_pvf_check_statement(
{
Ok(Some(signature)) => signature,
Ok(None) => {
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
?relay_parent,
validator_index = ?credentials.validator_index,
@@ -501,7 +501,7 @@ async fn sign_and_submit_pvf_check_statement(
return
},
Err(e) => {
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
?relay_parent,
validator_index = ?credentials.validator_index,
@@ -518,7 +518,7 @@ async fn sign_and_submit_pvf_check_statement(
metrics.on_vote_submitted();
},
Err(e) => {
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
?relay_parent,
?validation_code_hash,
@@ -540,12 +540,7 @@ async fn initiate_precheck(
validation_code_hash: ValidationCodeHash,
metrics: &Metrics,
) {
tracing::debug!(
target: LOG_TARGET,
?validation_code_hash,
?relay_parent,
"initiating a precheck",
);
gum::debug!(target: LOG_TARGET, ?validation_code_hash, ?relay_parent, "initiating a precheck",);
let (tx, rx) = oneshot::channel();
sender
@@ -563,7 +558,7 @@ async fn initiate_precheck(
// Pre-checking request dropped before replying. That can happen in case the
// overseer is shutting down. Our part of shutdown will be handled by the
// overseer conclude signal. Log it here just in case.
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
?validation_code_hash,
?relay_parent,