Skip to content
Merged
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
9 changes: 9 additions & 0 deletions crates/health/example/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ flush_interval = "2s"
# attach them. OTLP exports parent logs normally and keeps diagnostics as
# latest-wins per endpoint while the drain is backed up.
include_diagnostics = false

# Include per-alert detail on health report records for this target. Health
# report records otherwise carry only alert and success counts. When enabled,
# each record with alerts gains a `health_report.alerts` attribute holding a
# JSON array of up to 64 alerts; a truncated record also carries
# `health_report.alerts.dropped` with the number omitted.
include_alert_details = false
#
# TLS-only target with an explicit CA bundle.
# The reload interval is optional and defaults to five minutes.
Expand All @@ -121,6 +128,7 @@ include_diagnostics = false
# batch_size = 1024
# flush_interval = "5s"
# include_diagnostics = true
# include_alert_details = true
#
# [sinks.otlp.targets.tls]
# ca_cert_path = "/var/run/secrets/central-otlp/ca.crt"
Expand All @@ -133,6 +141,7 @@ include_diagnostics = false
# batch_size = 1024
# flush_interval = "5s"
# include_diagnostics = true
# include_alert_details = true
#
# [sinks.otlp.targets.tls]
# ca_cert_path = "/var/run/secrets/central-otlp/ca.crt"
Expand Down
17 changes: 17 additions & 0 deletions crates/health/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,14 @@ pub struct OtlpTargetConfig {
/// up.
#[serde(default)]
pub include_diagnostics: bool,

/// Emit per-alert detail on health report log records sent to this target.
///
/// Disabled by default because alert messages are free-form and a fully
/// degraded endpoint can produce many of them. When enabled, health report
/// records carry a `health_report.alerts` attribute holding a JSON array.
#[serde(default)]
pub include_alert_details: bool,
}

impl OtlpTargetConfig {
Expand Down Expand Up @@ -1932,6 +1940,7 @@ mod tests {
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: false,
include_alert_details: false,
}
}

Expand Down Expand Up @@ -2636,6 +2645,7 @@ endpoint = "https://central.example:4317"
batch_size = 1024
flush_interval = "5s"
include_diagnostics = true
include_alert_details = true

[targets.tls]
ca_cert_path = "/central/ca.crt"
Expand All @@ -2657,6 +2667,8 @@ reload_interval = "30s"
assert_eq!(targets[1].batch_size, 1024);
assert_eq!(targets[1].flush_interval, Duration::from_secs(5));
assert!(targets[1].include_diagnostics);
assert!(!targets[0].include_alert_details);
assert!(targets[1].include_alert_details);

let tls = targets[1]
.tls
Expand Down Expand Up @@ -2892,6 +2904,7 @@ reload_interval = "30s"
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: false,
include_alert_details: false,
tls: None,
}],
}),
Expand Down Expand Up @@ -2929,6 +2942,7 @@ reload_interval = "30s"
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: true,
include_alert_details: false,
tls: None,
}],
}),
Expand All @@ -2946,13 +2960,15 @@ reload_interval = "30s"
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: false,
include_alert_details: false,
tls: None,
},
OtlpTargetConfig {
endpoint: "http://central.example:4317".to_string(),
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: true,
include_alert_details: false,
tls: None,
},
],
Expand Down Expand Up @@ -2998,6 +3014,7 @@ reload_interval = "30s"
batch_size: 512,
flush_interval: Duration::from_secs(2),
include_diagnostics: false,
include_alert_details: false,
tls: None,
}],
}),
Expand Down
Loading
Loading