-
Notifications
You must be signed in to change notification settings - Fork 745
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
add tracing metrics layer for dependency logging #4979
add tracing metrics layer for dependency logging #4979
Conversation
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.
Nice! Its great this wasn't such a pain.
One small comment.
I think we should enable this by default for WARN's and above. Am I right in understanding we wont get any metrics by default?
In a future PR we will remove the -l
switch all-together and just default log to files. So I think would be good to by default just log warn's and aboves in the metrics.
To be clear. I think in this PR we make a breaking change and remove the For the time being, this will destroy the ability to look at dependency logs. Until we have #4954 which should then log the dependency logs to individual files. I think we opt for useful metrics now and then file logging later. This should all be by default and the -l flag becomes deprecated. |
@AgeManning I gave a (honestly quick) look into having logs enabled but output disabled and configuring the writes is something I think belongs more in #4954 than here, it's otherwise a bit of lost work, plus defeats the purpose in some way until that work is completed. For instance, I do need to able to look into the logs from discv5 in the meantime to check what we are logging as warns to either expand the logged info, or downgrade the logs. Clearing the output prevents me to meaningfully see what's going on in discv5 in the context of LH until file logging is addressed. I pushed a middle ground commit that goes with your original suggestion:
|
let logger = Logger::root(drain.fuse(), o!()); | ||
let _scope_guard = slog_scope::set_global_logger(logger); | ||
slog_stdlog::init_with_level(debug_level).unwrap(); | ||
let log = Logger::root(drain.fuse(), o!()); |
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.
@AgeManning had to remove this to make the bootnode logging not panic. It seems to work alright, any idea why the rest of the lines were here?
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 think they needed to be there in order to get the logs out to display inside slog.
If you run a boot node, do we still get logs to the terminal?
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.
yeah I get them alright. Sample:
Dec 12 23:23:45.909 INFO Executing bootstrap query...
2023-12-12T23:23:45.909324Z INFO discv5::service: Discv5 Service started
2023-12-12T23:23:45.909386Z INFO discv5::service: Ip4
Dec 12 23:23:50.126 INFO Server metrics unreachable_nodes: 0, ipv6_and_ipv4_nodes: 0, ipv6_nodes: 0, ipv4_nodes: 18, requests/s: 0.00, active_sessions: 33, connected_peers: 18
first and last are slog ones, middle ones are tracing ones
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.
Looks good to me. Have reviewed also via #4988
@AgeManning please note #4988 needs a rebase, not all changes here are there. Can we merge this one in preparation for that one? I don't think 4988 is completely ready yet but would prefer to have them merged as two prs and not one |
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.
LGTM
Issue Addressed
discv5#213 and partially #4954
Proposed Changes
add a tracing subscriber that registers metrics for dependencies
Additional Info
discv5 logs warnings like craaazy 💀
sample output from the first seconds of running lh