Skip to content

Commit

Permalink
feat: Flush timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
astuyve committed Nov 25, 2024
1 parent 5a1ee9d commit bde659e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bottlecap/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pub struct Config {
pub logs_config_processing_rules: Option<Vec<ProcessingRule>>,
pub serverless_flush_strategy: FlushStrategy,
pub enhanced_metrics: bool,
pub flush_timeout: u64,
pub https_proxy: Option<String>,
pub capture_lambda_payload: bool,
pub capture_lambda_payload_max_depth: u32,
Expand All @@ -102,6 +103,7 @@ impl Default for Config {
api_key_secret_arn: String::default(),
kms_api_key: String::default(),
serverless_flush_strategy: FlushStrategy::Default,
flush_timeout: 5,
// Unified Tagging
env: None,
service: None,
Expand Down
3 changes: 2 additions & 1 deletion bottlecap/src/http_client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::config;
use core::time::Duration;
use std::sync::Arc;
use tracing::error;

Expand All @@ -16,7 +17,7 @@ pub fn get_client(config: Arc<config::Config>) -> reqwest::Client {
}

fn build_client(config: Arc<config::Config>) -> Result<reqwest::Client, reqwest::Error> {
let client = reqwest::Client::builder();
let client = reqwest::Client::builder().timeout(Duration::from_secs(config.flush_timeout));
// This covers DD_PROXY_HTTPS and HTTPS_PROXY
if let Some(https_uri) = &config.https_proxy {
let proxy = reqwest::Proxy::https(https_uri.clone())?;
Expand Down

0 comments on commit bde659e

Please sign in to comment.