Skip to content

Commit

Permalink
Set global trace registry
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Sep 29, 2023
1 parent a6155bf commit b9f223e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust-connector-sdk/src/default_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ fn init_tracing(serve_command: &ServeCommand) -> Result<(), Box<dyn Error>> {
)
.install_batch(opentelemetry::runtime::Tokio)?;

tracing_subscriber::registry()
let subscriber = tracing_subscriber::registry()
.with(
tracing_opentelemetry::layer()
.with_exception_field_propagation(true)
Expand All @@ -207,8 +207,9 @@ fn init_tracing(serve_command: &ServeCommand) -> Result<(), Box<dyn Error>> {
tracing_subscriber::fmt::layer()
.json()
.with_timer(tracing_subscriber::fmt::time::time()),
)
.init();
);

tracing::subscriber::set_global_default(subscriber)?;

Ok(())
}
Expand Down

0 comments on commit b9f223e

Please sign in to comment.