Skip to content
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

Standardize logging in ZetaClient #1902

Open
Tracked by #2015
CharlieMc0 opened this issue Mar 15, 2024 · 1 comment
Open
Tracked by #2015

Standardize logging in ZetaClient #1902

CharlieMc0 opened this issue Mar 15, 2024 · 1 comment
Labels
monitoring zetaclient Issues related to ZetaClient

Comments

@CharlieMc0
Copy link
Member

Describe the Issue
A clear and concise description of what the issue is.

Our log messages are often free-form strings that are difficult to parse at scale. There a number of values that are commonly used different parts of the code and they should be logged and specific metadata. Such as inbound or outbound tx, chain_id, etc.
The cosmos SDK already appends useful metadata in some cases but none of the custom modules or zetaclient do.

Examples (from zetaclient):

[OK] RPC status: latest block num 19441604, timestamp 2024-03-15 16:41:59 +0000 UTC ( 14s ago), suggested gas price 43756052117

This could be

{
"type":"rpc_status", 
"status":"ok",
"timestamp":"2024-03-15 16:41:59 +0000 UTC", 
"suggested_gas_price":"43756052117",
"chain_id":"5",
 }

fail to send signature to peer 16Uiu2HAkuaNDfW7s89tmiFA25YwVKWRh7Y2f7a7dACUcW8atnadT
If peer were a field we could easily track errors on a per peer basis.

{
"error":"fail to send signature to peer", 
"peer":"16Uiu2HAkuaNDfW7s89tmiFA25YwVKWRh7Y2f7a7dACUcW8atnadT", 
}

leader(zetapub1addwnpepqvzlntzltvpm22ved5gjtn9nzqfz5fun38el4r64njc979rwanxlgq4u3p8) is not reachable
Becomes

{
"error":"leader is not reachable", 
"leader":"zetapub1addwnpepqvzlntzltvpm22ved5gjtn9nzqfz5fun38el4r64njc979rwanxlgq4u3p8", 
}

Benefits

  • Ability to better trace all logs related to a specific transactions or event type
  • Can attribute events to specific operators or nodes
  • Easier for developers to know what to include in the log and how to format it.

Example that @ws4charlie already implemented: #1790 (comment)

Expected Outcome
A consistent approach to logging that makes it easy to parse and trace logs at scale.

@lumtis lumtis added the zetaclient Issues related to ZetaClient label Mar 21, 2024
@lumtis lumtis changed the title improve logging Standardize logging in ZetaClient May 2, 2024
@CharlieMc0
Copy link
Member Author

observeInTX: lasstScanned heights for chain 56 ZetaSent 39505941 ERC20Deposited 39505941 TssRecvd 39505941
As it is written it should move to debug and fix the typo in lasstScanned.

A new log should be emitted when when the three values don't match and go as a warning or error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monitoring zetaclient Issues related to ZetaClient
Projects
None yet
Development

No branches or pull requests

2 participants