embedded_td/config/
prometheus.rs

1use super::define_build_mode_setter;
2
3#[derive(Debug, Clone)]
4pub struct PrometheusConfig {
5    /// Address to listen for Prometheus collector(s) connections
6    pub prometheus_listen_addr: String,
7
8    /// Maximum number of simultaneous connections.
9    /// If you want to accept a larger number than the default, make sure
10    /// you increase your OS limits.
11    /// 0 - unlimited.
12    pub max_open_connections: u64,
13
14    /// Instrumentation namespace
15    pub namespace: String,
16}
17
18impl Default for PrometheusConfig {
19    fn default() -> Self {
20        Self {
21            prometheus_listen_addr: String::from(":26660"),
22            max_open_connections: 3,
23            namespace: String::from("tendermint"),
24        }
25    }
26}
27
28impl PrometheusConfig {
29    define_build_mode_setter!(prometheus_listen_addr, str);
30
31    define_build_mode_setter!(max_open_connections, u64);
32
33    define_build_mode_setter!(namespace, str);
34}