Skip to content

Commit 80e0b16

Browse files
committed
telemetry: Enable span events in tests
Signed-off-by: Lann Martin <[email protected]>
1 parent 61aef22 commit 80e0b16

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/telemetry/src/testing.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
use tracing_subscriber::fmt::format::FmtSpan;
2+
13
/// Initializes telemetry integration for libtest environments.
24
pub fn init_test_telemetry() {
35
static ONCE: std::sync::Once = std::sync::Once::new();
46
ONCE.call_once(|| {
5-
if let Err(err) = tracing_subscriber::fmt().with_test_writer().try_init() {
7+
if let Err(err) = tracing_subscriber::fmt()
8+
.with_span_events(FmtSpan::CLOSE)
9+
.with_test_writer()
10+
.try_init()
11+
{
612
eprintln!("init_test_telemetry failed to init global tracing_subscriber: {err:?}");
713
}
814
});

0 commit comments

Comments
 (0)