mirror of
https://git.madhouse-project.org/algernon/iocaine.git
synced 2025-03-10 17:28:49 +01:00
Correctly initialize [server].bind
& [metrics].bind
Fixes #10. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
parent
2bfc4c81a8
commit
e34e81cf10
2 changed files with 25 additions and 2 deletions
|
@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
- Implemented a new metric, `iocaine_maze_depth`, a counter to track how deep the maze has been explored so far.
|
- Implemented a new metric, `iocaine_maze_depth`, a counter to track how deep the maze has been explored so far.
|
||||||
- When metrics are enabled, process metrics such as CPU seconds used, memory usage, etc, are also emitted.
|
- When metrics are enabled, process metrics such as CPU seconds used, memory usage, etc, are also emitted.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- The default bind address, both for the main service, and for metrics, are now correctly initialized with a default.
|
||||||
|
|
||||||
## [1.0.0] - 2025-03-01
|
## [1.0.0] - 2025-03-01
|
||||||
|
|
||||||
_Initial release._
|
_Initial release._
|
||||||
|
|
|
@ -19,13 +19,13 @@ pub struct Config {
|
||||||
pub metrics: MetricsConfig,
|
pub metrics: MetricsConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Default)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct ServerConfig {
|
pub struct ServerConfig {
|
||||||
#[serde(default = "ServerConfig::default_bind")]
|
#[serde(default = "ServerConfig::default_bind")]
|
||||||
pub bind: String,
|
pub bind: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Default)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct MetricsConfig {
|
pub struct MetricsConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub enable: bool,
|
pub enable: bool,
|
||||||
|
@ -43,6 +43,17 @@ impl MetricsConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for MetricsConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
enable: Default::default(),
|
||||||
|
labels: Default::default(),
|
||||||
|
bind: Self::default_bind(),
|
||||||
|
agent_group: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Deserialize, PartialEq)]
|
||||||
pub enum MetricsLabel {
|
pub enum MetricsLabel {
|
||||||
Host,
|
Host,
|
||||||
|
@ -63,6 +74,14 @@ impl ServerConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for ServerConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
bind: Self::default_bind(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct SourceConfig {
|
pub struct SourceConfig {
|
||||||
pub markov: Vec<String>,
|
pub markov: Vec<String>,
|
||||||
|
|
Loading…
Reference in a new issue