Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/vector_sink_multiple_backends.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add support for configuring multiple endpoints in the `vector` sink via the new `addresses` option, enabling built-in load balancing and failover across downstream Vector instances.

authors: fpytloun
19 changes: 18 additions & 1 deletion src/sinks/util/service/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const UNHEALTHY_AMOUNT_OF_ERRORS: usize = 5;
/// Options for determining the health of an endpoint.
#[serde_as]
#[configurable_component]
#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug)]
#[serde(rename_all = "snake_case")]
pub struct HealthConfig {
/// Initial delay between attempts to reactivate endpoints once they become unhealthy.
Expand All @@ -46,6 +46,15 @@ pub struct HealthConfig {
pub retry_max_duration_secs: Duration,
}

impl Default for HealthConfig {
fn default() -> Self {
Self {
retry_initial_backoff_secs: default_retry_initial_backoff_secs(),
retry_max_duration_secs: default_retry_max_duration_secs(),
}
}
}

const fn default_retry_initial_backoff_secs() -> u64 {
RETRY_INITIAL_BACKOFF_SECONDS_DEFAULT
}
Expand Down Expand Up @@ -329,4 +338,12 @@ mod tests {
counters.inc_healthy();
assert!(counters.healthy(snapshot).is_ok());
}

#[test]
fn default_health_config_matches_documented_defaults() {
let config = HealthConfig::default();

assert_eq!(config.retry_initial_backoff_secs, 1);
assert_eq!(config.retry_max_duration_secs, Duration::from_secs(3_600));
}
}
Loading
Loading