Skip to content

Commit 75fcbe3

Browse files
committed
feat(vector sink): add multiple endpoint strategies
1 parent 5d41252 commit 75fcbe3

5 files changed

Lines changed: 846 additions & 29 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
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.
2+
3+
authors: fpytloun

src/sinks/util/service/health.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const UNHEALTHY_AMOUNT_OF_ERRORS: usize = 5;
2929
/// Options for determining the health of an endpoint.
3030
#[serde_as]
3131
#[configurable_component]
32-
#[derive(Clone, Debug, Default)]
32+
#[derive(Clone, Debug)]
3333
#[serde(rename_all = "snake_case")]
3434
pub struct HealthConfig {
3535
/// Initial delay between attempts to reactivate endpoints once they become unhealthy.
@@ -46,6 +46,15 @@ pub struct HealthConfig {
4646
pub retry_max_duration_secs: Duration,
4747
}
4848

49+
impl Default for HealthConfig {
50+
fn default() -> Self {
51+
Self {
52+
retry_initial_backoff_secs: default_retry_initial_backoff_secs(),
53+
retry_max_duration_secs: default_retry_max_duration_secs(),
54+
}
55+
}
56+
}
57+
4958
const fn default_retry_initial_backoff_secs() -> u64 {
5059
RETRY_INITIAL_BACKOFF_SECONDS_DEFAULT
5160
}
@@ -329,4 +338,12 @@ mod tests {
329338
counters.inc_healthy();
330339
assert!(counters.healthy(snapshot).is_ok());
331340
}
341+
342+
#[test]
343+
fn default_health_config_matches_documented_defaults() {
344+
let config = HealthConfig::default();
345+
346+
assert_eq!(config.retry_initial_backoff_secs, 1);
347+
assert_eq!(config.retry_max_duration_secs, Duration::from_secs(3_600));
348+
}
332349
}

0 commit comments

Comments
 (0)