Skip to content

Commit

Permalink
Accept debug events to log then (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny authored Aug 29, 2023
1 parent 1ba878e commit de92aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::cmp::max;

use axum_tracing_opentelemetry::{otlp, resource::DetectResource};
use http::header::HeaderMap;
use opentelemetry_http::HeaderInjector;
Expand Down Expand Up @@ -37,9 +39,10 @@ pub fn init_tracing_with_fallbacks(
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.with_writer(std::io::stdout.with_max_level(log_level));

let level_filter: LevelFilter = max(log_level, tracing::Level::INFO).into();
let subscriber = tracing_subscriber::registry()
.with(fmt_layer)
.with(LevelFilter::INFO)
.with(level_filter)
.with(otel_layer);
tracing::subscriber::set_global_default(subscriber).unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod jaegar;

pub use opentelemetry_api::trace::{SpanId, TraceId};
use hyper::{body::Bytes, header::HeaderValue, Body, Error, HeaderMap, Response};
pub use opentelemetry_api::trace::{SpanId, TraceId};
use rand::Rng;

#[derive(Debug)]
Expand Down

0 comments on commit de92aae

Please sign in to comment.