-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Forked at: d67fc4c Parent branch: origin/master
Can you please explain on what your idea here is? I don't see the connection to the ticket and what we spoke about. |
Yes it's more related to paritytech/cumulus#154 actually. This change already prefixes the logs with the node name. Example here on substrate:
On cumulus we will get the node name of the parachain and the relaychain depending on which node is the log. We could also customize this instead of using the node name (it's not done but it's doable easily if you want). The way this is done is by using a span from I still need to figure out for separating the telemetry. |
This should be an optional feature and we actually want to have And why are still some lines without any prefix in your example output? Regarding telemetry, as I said, we should pass this object around like prometheus. |
Yes, I don't see any blocker for that. No worry.
Some are definitely outside the span (the span is created in client/service/src/builder.rs Some I'm not sure I'm investigating.
Tbh I'm still not 100% to understand how telemetry works. I'm still investigating. |
We just call a macro that aggregates the data and sends it as json to the server. But that is not important at all. Important is that we replace the singleton with an instance that is passed everywhere and we pass this instance to these macros. But this is clearly now part of another pr! |
This reverts commit 9055ec2. dtolnay/trybuild#53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some last changes and than we are ready.
client/cli/proc-macro/src/lib.rs
Outdated
use quote::quote; | ||
use syn::{Error, Expr, Ident, ItemFn}; | ||
|
||
/// Macro that inserts a tracing span with the node name at the beginning of the function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says something different than the body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the doc. Should be more consistent
client/cli/proc-macro/src/lib.rs
Outdated
/// | ||
/// # Implementation notes | ||
/// | ||
/// If there are multiple spans with a node name, only the latest will be shown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// If there are multiple spans with a node name, only the latest will be shown. | |
/// If there are multiple spans with a log prefix, only the latest will be shown. |
Or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
client/cli/proc-macro/src/lib.rs
Outdated
/// | ||
/// ```ignore | ||
/// Builds a new service for a light client. | ||
/// #[sc_cli::substrate_cli_node_name("light")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
client/cli/proc-macro/src/lib.rs
Outdated
(quote! { | ||
#(#attrs)* | ||
#vis #sig { | ||
let span = #crate_name::tracing::info_span!("substrate-node", name = #name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this span name not be a constant in sc-cli? And it should be renamed to substrate-log-prefix
or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardly because I can't import the const from sc-cli (sc-cli-proc-macro is a dependency of sc-cli). And I'm not too fan to put it in the the proc macro crate... but if you want think it's better I will do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wait, you're right. I see. nevermind!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
BOT MERGE |
Checks failed; merge aborted. |
geezus |
bot merge --force |
bot merge force |
Trying merge. |
Related to paritytech/cumulus#149
polkadot companion: paritytech/polkadot#1825