-
Notifications
You must be signed in to change notification settings - Fork 11
feat(tls): add tls_handshake_timeout config option #2303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cc34cf1
1ad4fb6
9dbe3c7
664da00
5b5f74f
505e3bf
7e6a5e9
8eba8f4
b75e898
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,7 +115,9 @@ mod tests { | |
| #[test] | ||
| fn incompatible_non_default() { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests in this file needed to be updated now that |
||
| let c = classifier(); | ||
| let result = c.classify("tls_handshake_timeout", &Value::Number(999.into())).unwrap(); | ||
| let result = c | ||
| .classify("dogstatsd_stats_buffer", &Value::Number(999.into())) | ||
| .unwrap(); | ||
| assert!(matches!(result.support_level, SupportLevel::Incompatible(_))); | ||
| assert!(!result.is_default); | ||
| } | ||
|
|
@@ -139,8 +141,10 @@ mod tests { | |
| #[test] | ||
| fn duration_default_null_is_not_default() { | ||
| let c = classifier(); | ||
| // tls_handshake_timeout has a duration default (10s); a null value can't be normalized. | ||
| let result = c.classify("tls_handshake_timeout", &Value::Null).unwrap(); | ||
| // dogstatsd_packet_buffer_flush_timeout has a duration default (100ms); a null value can't be normalized. | ||
| let result = c | ||
| .classify("dogstatsd_packet_buffer_flush_timeout", &Value::Null) | ||
| .unwrap(); | ||
| assert!(!result.is_default); | ||
| } | ||
|
|
||
|
|
@@ -149,14 +153,17 @@ mod tests { | |
| let c = classifier(); | ||
| // Neither an empty string nor arbitrary text parses as a duration, so neither matches. | ||
| assert!( | ||
| !c.classify("tls_handshake_timeout", &Value::String("".into())) | ||
| !c.classify("dogstatsd_packet_buffer_flush_timeout", &Value::String("".into())) | ||
| .unwrap() | ||
| .is_default | ||
| ); | ||
| assert!( | ||
| !c.classify("tls_handshake_timeout", &Value::String("something".into())) | ||
| .unwrap() | ||
| .is_default | ||
| !c.classify( | ||
| "dogstatsd_packet_buffer_flush_timeout", | ||
| &Value::String("something".into()) | ||
| ) | ||
| .unwrap() | ||
| .is_default | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -165,15 +172,15 @@ mod tests { | |
| let c = classifier(); | ||
| // The default is also matched when supplied as a Go duration string rather than nanoseconds. | ||
| let result = c | ||
| .classify("tls_handshake_timeout", &Value::String("10s".into())) | ||
| .classify("dogstatsd_packet_buffer_flush_timeout", &Value::String("100ms".into())) | ||
| .unwrap(); | ||
| assert!(result.is_default); | ||
| } | ||
|
|
||
| #[test] | ||
| fn incompatible_severity_levels() { | ||
| let c = classifier(); | ||
| let result = c.classify("tls_handshake_timeout", &Value::Number(30.into())).unwrap(); | ||
| let result = c.classify("dogstatsd_stats_buffer", &Value::Number(30.into())).unwrap(); | ||
| assert!(matches!( | ||
| result.support_level, | ||
| SupportLevel::Incompatible(Severity::Medium) | ||
|
|
@@ -183,20 +190,26 @@ mod tests { | |
| #[test] | ||
| fn duration_default_as_nanoseconds_is_default() { | ||
| let c = classifier(); | ||
| // The Agent transmits tls_handshake_timeout (schema default "10s") as integer nanoseconds. | ||
| // The classifier must recognize this as the default and not flag it as an override. | ||
| // The Agent transmits dogstatsd_packet_buffer_flush_timeout (schema default "100ms") as integer | ||
| // nanoseconds. The classifier must recognize this as the default and not flag it as an override. | ||
| let result = c | ||
| .classify("tls_handshake_timeout", &Value::Number(10_000_000_000i64.into())) | ||
| .classify( | ||
| "dogstatsd_packet_buffer_flush_timeout", | ||
| &Value::Number(100_000_000i64.into()), | ||
| ) | ||
| .unwrap(); | ||
| assert!(result.is_default); | ||
| } | ||
|
|
||
| #[test] | ||
| fn duration_non_default_nanoseconds_is_not_default() { | ||
| let c = classifier(); | ||
| // 5s in nanoseconds is not the 10s default. | ||
| // 5ms in nanoseconds is not the 100ms default. | ||
| let result = c | ||
| .classify("tls_handshake_timeout", &Value::Number(5_000_000_000i64.into())) | ||
| .classify( | ||
| "dogstatsd_packet_buffer_flush_timeout", | ||
| &Value::Number(5_000_000i64.into()), | ||
| ) | ||
| .unwrap(); | ||
| assert!(!result.is_default); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -331,6 +331,7 @@ where | |
| .with_request_timeout(config.request_timeout()) | ||
| .with_max_idle_conns_per_host(config.max_idle_connections_per_host()) | ||
| .with_min_tls_version(config.min_tls_version()) | ||
| .with_tls_handshake_timeout(config.tls_handshake_timeout()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an HTTPS intake is reached through a configured proxy, Useful? React with 👍 / 👎.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Claude Sonnet 5] This is a known, pre-existing limitation, not something introduced by this PR — I'll follow up to add support there. |
||
| .with_http_protocol(config.http_protocol()) | ||
| .with_bytes_sent_counter(telemetry.bytes_sent().clone()) | ||
| .with_endpoint_telemetry( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.