-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Fix] Configure metrics compilation in root toml #3462
base: staging
Are you sure you want to change the base?
[Fix] Configure metrics compilation in root toml #3462
Conversation
Subcrates would previously enable metrics by default instead of exposing them as a feature.
@@ -56,7 +56,7 @@ name = "snarkos" | |||
path = "snarkos/main.rs" | |||
|
|||
[features] | |||
metrics = [ "snarkos-node-metrics", "snarkos-node/metrics" ] | |||
default = [ "snarkos-node-metrics", "snarkos-node/metrics", "snarkos-cli/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.
Adding snarkos-cli/metrics
here isn't strictly necessary for the feature to be compiled in (as they are additive across shared dependencies) but it is more complete.
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! Want to un-draft, and mention in the PR message as well the result of a sanity check: compile snarkOS, run a small local devnet using devnet.sh
and see if the /metrics
endpoint has non-zero outputs.
Done, sanity check sample output from the devnet prometheus metrics:
|
The
cli
crate currently enables metrics as a default feature, this PR moves the feature's configuration to the root level toml, enables it by default and introduces ametrics
feature oncli
. In addition,snarks-node-metrics
is made optional.Correct configuration can be verified with a reverse-search for the metrics crate by feature:
cargo tree -e features -i snarkos-node-metrics
(which should show matches, metrics being enabled by default)cargo tree -e features -i snarkos-node-metrics --no-default-features
(which should show no matches)Fixes #3379.
The last commit realigns the dependencies in the tcp crate, lmk if I should drop it or move it someplace else.
Edit: prometheus metric sanity check was also successful with a small devnet.