-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up and improve logs #2544
Conversation
e3833d0
to
32cf498
Compare
b87e949
to
6e9061e
Compare
Many CLI have a debug log which contains all the options given, but not all of them have this log. |
Agreed! |
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.
Let's add some more docs, but other than that, looks good to me 🙂
relayer/src/supervisor.rs
Outdated
@@ -700,8 +681,54 @@ fn process_batch<Chain: ChainHandle>( | |||
Ok(()) | |||
} | |||
|
|||
fn send_telemetry<Src, Dst>(src: &Src, dst: &Dst, events: &[IbcEvent], path: &Packet) |
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 we document this function? Some questions that I think would be helpful for the docs to answer:
- Do the metrics get sent to both the source and destination? Only one of them? In which situations?
- A brief description of each of the metrics that are sent based on the
IbcEvent
variant in thematch
.
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.
The idea for these metrics is the following:
- These metrics count the number of
SendPacket
,WriteAcknowledgement
andTimeoutPacket
events observed by the supervisor. - In order to make it easier to see the duality
SendPacket
/WriteAcknowledgement
orSendPacket
/TimeoutPacket
, theWriteAcknowledgement
andTimeoutPacket
will have the destination chain labelled as the source as these events are being "sent back" to the chain which submitted the correspondingSendPacket
event.
So a SendPacket
event from ibc-0
will increment the send_packet_events{chain="ibc-0",channel="channel-0",counterparty="ibc-1",port="transfer"}
and the returning WriteAcknowledgment
event will increment the acknowledgement_events{chain="ibc-0",channel="channel-0",counterparty="ibc-1",port="transfer”}
.
But I realise that this might cause confusion. I can update it to label the chain
and counterparty
to be the submitting and receiving chains for the isolated events. Meaning the new send/acknowledgement/timeout events metrics label would have:
chain
is always the chain that submits the eventcounterparty
is always the chain that will receive the packet generated from the event
Instead of being the submitting and receiving chain for the whole transfer. Current send/acknowledgement/timeout events metrics label is:
chain
being the chain that sends theSendPacket
event and receives the correspondingWriteAcknowledgment
,TimeoutPacket
eventscounterparty
being the chain that receives theSendPacket
event and sends theWriteAcknowledgment
,TimeoutPacket
events
What do you think?
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.
chain is always the chain that submits the event
counterparty is always the chain that will receive the packet generated from the event
I agree that labeling these in absolute terms, instead of relative terms, is probably a bit easier to parse 🙂
…rics in the supervisor
* Instrument more functions using `tracing` * Use error level everywhere * Bit more cleanup * Instrument more functions under the `chain::cosmos` module * Removed debug log which outputs the options passed to CLIs * Cleanup imports * Remove `Serialize` bound on `ChainHandle` * Remove `Serialize` instances on `ChainHandle` imps * Preserve current tracing span across the runtime boundary * Remove ad-hoc Display and Debug impl for client and channel events * Improve spawning logs * Better span for some workers * Extract telemetry code into its own function * Few more improvements * Tighter Display impl for account-related newtypes * Add `Display` impl for `version::Specs` * Fix clippy warning * Cleanup `From` instace for `PathIdentifiers` * Fixed bugs from merge. Clippy and cargo fmt * Emit JSON to stdout * More instrumentation in `relay_path` * replaced {:#?} by {:?} * Updated metrics for events and added comment for method recording metrics in the supervisor * Replace all the Debug with Display fmt for 'info!', 'warn!' and 'error!' logs * Fixed issues following merge with master. Added comment * Updated std::time to core::time in modules pretty.rs file * Removed line returns in info logs * Add changelog entry Co-authored-by: Luca Joss <luca@informal.systems> Co-authored-by: ali <ali.benabdallah@epfl.ch> Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com>
See: #1538
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.