-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: add --metrics [flag]
to forest
#3609
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.
The usage now would be --metrics false
and --metrics true
, while a possibility, would never be used. How about --disable-metrics
boolean? Or --no-metrics
.
@LesnyRumcajs It makes sense, using |
We should change both for consistency, but in separate PRs. |
@LesnyRumcajs Changed to |
fc564aa
to
69d2c91
Compare
if self.no_metrics { | ||
cfg.client.enable_metrics_endpoint = false; | ||
} else { | ||
cfg.client.enable_metrics_endpoint = true; | ||
if let Some(metrics_address) = self.metrics_address { | ||
cfg.client.metrics_address = metrics_address; | ||
} | ||
} |
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.
A bit of code-golf if you wish
if self.no_metrics { | |
cfg.client.enable_metrics_endpoint = false; | |
} else { | |
cfg.client.enable_metrics_endpoint = true; | |
if let Some(metrics_address) = self.metrics_address { | |
cfg.client.metrics_address = metrics_address; | |
} | |
} | |
cfg.client.enable_metrics_endpoint = !self.no_metrics; | |
cfg.client.metrics_address = self.metrics_address.unwrap_or(cfg.client.metrics_address); | |
Summary of changes
Adding an option to disable metrics endpoint (just like for RPC endpoint) to facilitate writing simple test for #3593
Changes introduced in this pull request:
--metrics [flag]
toforest
to control the availability of the Prometheus serverReference issue to close (if applicable)
Closes
Other information and links
Change checklist