diff --git a/Cargo.lock b/Cargo.lock index e1b98f1..ace9c7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3643,9 +3643,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64 0.21.5", "bytes", @@ -3657,10 +3657,12 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -3669,8 +3671,10 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -4612,7 +4616,7 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "telemetry-batteries" version = "0.1.0" -source = "git+https://github.com/worldcoin/telemetry-batteries?rev=ec8ba6d4da45fdb98f900d8d4c8e1a09186894b4#ec8ba6d4da45fdb98f900d8d4c8e1a09186894b4" +source = "git+https://github.com/worldcoin/telemetry-batteries?rev=e0891328b29d9f85df037633feccca2f74a291a6#e0891328b29d9f85df037633feccca2f74a291a6" dependencies = [ "chrono", "dirs", @@ -4624,6 +4628,7 @@ dependencies = [ "opentelemetry-datadog", "opentelemetry-http", "opentelemetry_sdk", + "reqwest", "serde", "serde_json", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index c0433f8..0ab0993 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ aws-types = "1.0.1" postgres-docker-utils = { path = "crates/postgres-docker-utils" } # Company -telemetry-batteries = { git = "https://github.com/worldcoin/telemetry-batteries", rev = "ec8ba6d4da45fdb98f900d8d4c8e1a09186894b4" } +telemetry-batteries = { git = "https://github.com/worldcoin/telemetry-batteries", rev = "e0891328b29d9f85df037633feccca2f74a291a6" } ## External async-trait = "0.1.74" @@ -46,7 +46,7 @@ itertools = "0.12.0" metrics = "0.22.1" num-bigint = "0.4.4" rand = "0.8.5" -reqwest = { version = "0.11.13", default-features = false, features = [ +reqwest = { version = "0.11.24", default-features = false, features = [ "rustls-tls", ] } serde = "1.0.136" diff --git a/src/main.rs b/src/main.rs index 42031e8..412f807 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,14 +37,19 @@ async fn main() -> eyre::Result<()> { let config = load_config(args.config.iter().map(PathBuf::as_ref))?; - if config.service.datadog_enabled { - DatadogBattery::init(None, "tx-sitter-monolith", None, true); + let _shutdown_handle = if config.service.datadog_enabled { + let shutdown_handle = + DatadogBattery::init(None, "tx-sitter-monolith", None, true); + + Some(shutdown_handle) } else { tracing_subscriber::registry() .with(tracing_subscriber::fmt::layer().pretty().compact()) .with(EnvFilter::from_default_env()) .init(); - } + + None + }; if config.service.statsd_enabled { StatsdBattery::init(