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

code: Allow applications to dynamically adjust log level whenever consensus goes to round 1+ #802

Open
romac opened this issue Jan 23, 2025 · 3 comments
Assignees
Labels
code Code/implementation related observability Metrics and observability
Milestone

Comments

@romac
Copy link
Member

romac commented Jan 23, 2025

No description provided.

@romac romac added code Code/implementation related observability Metrics and observability labels Jan 23, 2025
@romac romac added this to the Phase 5 milestone Jan 23, 2025
@adizere
Copy link
Member

adizere commented Jan 23, 2025

The requirement seems to be:

  • if round > 0, then node operators should be able to witness more observable/verbose logs

Probably there are other situations where this is relevant, eg upon rejecting a proposal or upon various timeouts. But let's focus on the round > 0 case first.

I wonder if there's simpler ways to achieve this without dynamically adjusting log levels, eg having a span that wraps the code that handles round > 0 logic, ensuring that logs within that span have differentiated logging treatment?

@romac
Copy link
Member Author

romac commented Jan 23, 2025

We already log some messages as warnings when a timeout occurs and we move to round > 0.

But the idea was to get all subsequent logs at debug or info level, and for this we need to change the log level dynamically, which is totally supported by tracing-subscriber. We just need a way to let the application know that it should so, since it is the app and not consensus which installs the subscriber that manages the log level.

@romac
Copy link
Member Author

romac commented Jan 23, 2025

I just realized that consensus already sends a HostMsg::StartedRound(height, round, proposer) message to the host whenever we move to a new round, so for this case, it would only be a matter of changing the log level whenever round > 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code/implementation related observability Metrics and observability
Projects
None yet
Development

No branches or pull requests

3 participants