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
+13 -13
View File
@@ -129,7 +129,7 @@ impl CollationGenerationSubsystem {
)
.await
{
tracing::warn!(target: LOG_TARGET, err = ?err, "failed to handle new activations");
gum::warn!(target: LOG_TARGET, err = ?err, "failed to handle new activations");
}
}
@@ -140,7 +140,7 @@ impl CollationGenerationSubsystem {
msg: CollationGenerationMessage::Initialize(config),
}) => {
if self.config.is_some() {
tracing::error!(target: LOG_TARGET, "double initialization");
gum::error!(target: LOG_TARGET, "double initialization");
} else {
self.config = Some(Arc::new(config));
}
@@ -148,7 +148,7 @@ impl CollationGenerationSubsystem {
},
Ok(FromOverseer::Signal(OverseerSignal::BlockFinalized(..))) => false,
Err(err) => {
tracing::error!(
gum::error!(
target: LOG_TARGET,
err = ?err,
"error receiving message from subsystem context: {:?}",
@@ -207,7 +207,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
(scheduled_core, OccupiedCoreAssumption::Free),
CoreState::Occupied(_occupied_core) => {
// TODO: https://github.com/paritytech/polkadot/issues/1573
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
core_idx = %core_idx,
relay_parent = ?relay_parent,
@@ -216,7 +216,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
continue
},
CoreState::Free => {
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
core_idx = %core_idx,
"core is free. Keep going.",
@@ -226,7 +226,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
};
if scheduled_core.para_id != config.para_id {
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
core_idx = %core_idx,
relay_parent = ?relay_parent,
@@ -252,7 +252,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
{
Some(v) => v,
None => {
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
core_idx = %core_idx,
relay_parent = ?relay_parent,
@@ -274,7 +274,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
{
Some(v) => v,
None => {
tracing::trace!(
gum::trace!(
target: LOG_TARGET,
core_idx = %core_idx,
relay_parent = ?relay_parent,
@@ -298,7 +298,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
match (task_config.collator)(relay_parent, &validation_data).await {
Some(collation) => collation.into_inner(),
None => {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
para_id = %scheduled_core.para_id,
"collator returned no collation on collate",
@@ -318,7 +318,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
// As such, honest collators never produce an uncompressed PoV which starts with
// a compression magic number, which would lead validators to reject the collation.
if encoded_size > validation_data.max_pov_size as usize {
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
para_id = %scheduled_core.para_id,
size = encoded_size,
@@ -346,7 +346,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
match erasure_root(n_validators, validation_data, pov.clone()) {
Ok(erasure_root) => erasure_root,
Err(err) => {
tracing::error!(
gum::error!(
target: LOG_TARGET,
para_id = %scheduled_core.para_id,
err = ?err,
@@ -380,7 +380,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
},
};
tracing::debug!(
gum::debug!(
target: LOG_TARGET,
candidate_hash = ?ccr.hash(),
?pov_hash,
@@ -396,7 +396,7 @@ async fn handle_new_activations<Context: SubsystemContext>(
))
.await
{
tracing::warn!(
gum::warn!(
target: LOG_TARGET,
para_id = %scheduled_core.para_id,
err = ?err,