feat(otel): respect standard OTel env vars for exporter selection (#7144)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -58,6 +58,12 @@ pub async fn run() -> Result<()> {
|
||||
axum::serve(listener, app)
|
||||
.with_graceful_shutdown(shutdown_signal())
|
||||
.await?;
|
||||
|
||||
if goose::otel::otlp::is_otlp_initialized() {
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
goose::otel::otlp::shutdown_otlp();
|
||||
}
|
||||
|
||||
info!("server shutdown complete");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ use tracing_subscriber::{
|
||||
Registry,
|
||||
};
|
||||
|
||||
use goose::tracing::{langfuse_layer, otlp_layer};
|
||||
use goose::otel::otlp;
|
||||
use goose::tracing::langfuse_layer;
|
||||
|
||||
/// Sets up the logging infrastructure for the application.
|
||||
/// This includes:
|
||||
@@ -54,23 +55,7 @@ pub fn setup_logging(name: Option<&str>) -> Result<()> {
|
||||
console_layer.with_filter(base_env_filter).boxed(),
|
||||
];
|
||||
|
||||
if let Ok((otlp_tracing_layer, otlp_metrics_layer, otlp_logs_layer)) = otlp_layer::init_otlp() {
|
||||
layers.push(
|
||||
otlp_tracing_layer
|
||||
.with_filter(otlp_layer::create_otlp_tracing_filter())
|
||||
.boxed(),
|
||||
);
|
||||
layers.push(
|
||||
otlp_metrics_layer
|
||||
.with_filter(otlp_layer::create_otlp_metrics_filter())
|
||||
.boxed(),
|
||||
);
|
||||
layers.push(
|
||||
otlp_logs_layer
|
||||
.with_filter(otlp_layer::create_otlp_logs_filter())
|
||||
.boxed(),
|
||||
);
|
||||
}
|
||||
layers.extend(otlp::init_otlp_layers(goose::config::Config::global()));
|
||||
|
||||
if let Some(langfuse) = langfuse_layer::create_langfuse_observer() {
|
||||
layers.push(langfuse.with_filter(LevelFilter::DEBUG).boxed());
|
||||
|
||||
Reference in New Issue
Block a user