This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure about the naming, can we not also just name it
rpc_metrics
?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.
It's just to not interfere with the current setups. Node operators probably enable
rpc
target to get stats on rpc method call usage but likely don't care about the response payload in most cases, which can get quite big in size (and expensive to store) and is mostly useful in development environments to just debug. Separating both targets one can choose the granularity.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.
you can already get this with
RUST_LOG="jsonrpsee=trace"
(except the transport label) that log is super-noisy but shouldn't matter for development environments.in addition jsonrpsee actually has separate tracing spans for each RPC method call to filter out stuff but it doesn't play well with the logger in substrate, I should probably fix that at some point.
however we truncate logs bigger 4096 characters currently, so I guess it could be useful
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.
People should not get metrics by parsing logs. They should use prometheus. Let's change the target name. If people are requiring better metrics, they should open issues and say what they need.