Skip to content

Commit 3407f02

Browse files
authored
[SVLS-7945] feat: Support TLS certificate for dogstatsd metrics flusher (#984)
## Motivation A customer reported that their Lambda is behind a proxy, and the Rust-based extension encounters an error when sending logs and metrics to Datadog via the proxy. ## Overview Previous PRs in fixed this for traces/stats (#961) and logs/proxy (#979). DataDog/serverless-components#61 in `serverless-components` repo fixed this issue for dogstatsd metrics. This PR upgrades the dependency on `serverless-components` to patch this update. ## Testing #### Steps See #979 #### Result **Before:** Metrics flushing failed: > DD_EXTENSION | DEBUG | Flushing 0 series and 1 distributions DD_EXTENSION | DEBUG | Sending distributions: SketchPayload { ... } DD_EXTENSION | DEBUG | Request to https://api.datadoghq.com/api/beta/sketches took 144ms DD_EXTENSION | ERROR | Error shipping data: None Failed to send request after 3 attempts DD_EXTENSION | ERROR | Failed to flush some metrics due to shipping errors: 0 series and 1 sketches **After:** Metrics flushing succeeded: > DD_EXTENSION | DEBUG | Flushing 0 series and 1 distributions DD_EXTENSION | DEBUG | Sending distributions: SketchPayload { ... } DD_EXTENSION | DEBUG | Request to https://api.datadoghq.com/api/beta/sketches took 619ms DD_EXTENSION | DEBUG | Successfully flushed 0 series and 1 distributions ## Notes Customer report issue: #919
1 parent 2b44db0 commit 3407f02

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

bottlecap/Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bottlecap/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ libdd-trace-utils = { git = "https://github.com/DataDog/libdatadog", rev = "73c6
7171
libdd-trace-normalization = { git = "https://github.com/DataDog/libdatadog", rev = "73c675b79f81978ee1190be6af0c5abec997e3b0" }
7272
libdd-trace-obfuscation = { git = "https://github.com/DataDog/libdatadog", rev = "73c675b79f81978ee1190be6af0c5abec997e3b0" }
7373
libdd-trace-stats = { git = "https://github.com/DataDog/libdatadog", rev = "73c675b79f81978ee1190be6af0c5abec997e3b0" }
74-
dogstatsd = { git = "https://github.com/DataDog/serverless-components", rev = "fd8b7a9bcec2f19b305bb74b7195ca3910538e5b", default-features = false }
75-
datadog-fips = { git = "https://github.com/DataDog/serverless-components", rev = "fd8b7a9bcec2f19b305bb74b7195ca3910538e5b", default-features = false }
74+
dogstatsd = { git = "https://github.com/DataDog/serverless-components", rev = "18b49baba8bfef97060d7edd8b830584d0da3373", default-features = false }
75+
datadog-fips = { git = "https://github.com/DataDog/serverless-components", rev = "18b49baba8bfef97060d7edd8b830584d0da3373", default-features = false }
7676
libddwaf = { version = "1.28.1", git = "https://github.com/DataDog/libddwaf-rust", rev = "d1534a158d976bd4f747bf9fcc58e0712d2d17fc", default-features = false, features = ["serde"] }
7777

7878
[dev-dependencies]

bottlecap/src/bin/bottlecap/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,7 @@ fn start_metrics_flushers(
16221622
aggregator_handle: metrics_aggr_handle.clone(),
16231623
metrics_intake_url_prefix: metrics_intake_url.expect("can't parse site or override"),
16241624
https_proxy: config.proxy_https.clone(),
1625+
ca_cert_path: config.tls_cert_file.clone(),
16251626
timeout: Duration::from_secs(config.flush_timeout),
16261627
retry_strategy: DsdRetryStrategy::Immediate(3),
16271628
compression_level: config.metrics_config_compression_level,
@@ -1651,6 +1652,7 @@ fn start_metrics_flushers(
16511652
aggregator_handle: metrics_aggr_handle.clone(),
16521653
metrics_intake_url_prefix: metrics_intake_url.clone(),
16531654
https_proxy: config.proxy_https.clone(),
1655+
ca_cert_path: config.tls_cert_file.clone(),
16541656
timeout: Duration::from_secs(config.flush_timeout),
16551657
retry_strategy: DsdRetryStrategy::Immediate(3),
16561658
compression_level: config.metrics_config_compression_level,

bottlecap/tests/metrics_integration_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ async fn test_enhanced_metrics() {
5252
metrics_intake_url_prefix: MetricsIntakeUrlPrefix::new(None, Some(metrics_site_override))
5353
.expect("can't parse metrics intake URL from site"),
5454
https_proxy: None,
55+
ca_cert_path: None,
5556
timeout: std::time::Duration::from_secs(5),
5657
retry_strategy: dogstatsd::datadog::RetryStrategy::Immediate(1),
5758
compression_level: 6,

0 commit comments

Comments
 (0)