mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Changed prometheus metrics feature as optional
This commit is contained in:
parent
0b6ca73790
commit
2b8f3c26ec
4 changed files with 95 additions and 35 deletions
|
@ -146,6 +146,10 @@ pub struct Opt {
|
|||
#[clap(long, env = "MEILI_LOG_LEVEL", default_value = "info")]
|
||||
pub log_level: String,
|
||||
|
||||
// Enables Prometheus metrics and /metrics route.
|
||||
#[clap(long, requires = "enable-metrics-route")]
|
||||
pub enable_metrics_route: bool,
|
||||
|
||||
#[serde(flatten)]
|
||||
#[clap(flatten)]
|
||||
pub indexer_options: IndexerOpts,
|
||||
|
@ -161,7 +165,7 @@ impl Opt {
|
|||
pub fn analytics(&self) -> bool {
|
||||
!self.no_analytics
|
||||
}
|
||||
|
||||
|
||||
pub fn get_ssl_config(&self) -> anyhow::Result<Option<rustls::ServerConfig>> {
|
||||
if let (Some(cert_path), Some(key_path)) = (&self.ssl_cert_path, &self.ssl_key_path) {
|
||||
let config = rustls::ServerConfig::builder().with_safe_defaults();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue