Read oltp config from config and env (#4292)

This commit is contained in:
David Katz
2025-08-22 15:54:36 -04:00
committed by GitHub
parent dc01d1c7f8
commit 5898cb422b
2 changed files with 65 additions and 27 deletions
+5 -1
View File
@@ -10,7 +10,11 @@ async fn main() -> Result<()> {
let result = cli().await;
// Only wait for telemetry flush if OTLP is configured
if std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT").is_ok() {
let should_wait = goose::config::Config::global()
.get_param::<String>("otel_exporter_otlp_endpoint")
.is_ok();
if should_wait {
// Use a shorter, dynamic wait with max timeout
let max_wait = tokio::time::Duration::from_millis(500);
let start = tokio::time::Instant::now();