Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ futures-sink = "0.3"
once_cell = { workspace = true }
pin-project-lite = { workspace = true, optional = true }
thiserror = { workspace = true }
tracing = {workspace = true, optional = true} # optional for opentelemetry internal logging

[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
js-sys = "0.3.63"
Expand All @@ -38,6 +39,7 @@ testing = ["trace", "metrics"]
logs = []
logs_level_enabled = ["logs"]
otel_unstable = []
internal-logs = ["tracing"]

[dev-dependencies]
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["logs_level_enabled"]} # for documentation tests
Expand Down
10 changes: 8 additions & 2 deletions opentelemetry/src/trace/context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Context extensions for tracing
use crate::{
global,
global, otel_debug,
trace::{Span, SpanContext, Status},
Context, ContextGuard, KeyValue,
};
Expand Down Expand Up @@ -55,7 +55,13 @@
if let Some(ref inner) = self.0.inner {
match inner.lock() {
Ok(mut locked) => f(&mut locked),
Err(err) => global::handle_error(err),
Err(err) => {
otel_debug!(

Check warning on line 59 in opentelemetry/src/trace/context.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry/src/trace/context.rs#L58-L59

Added lines #L58 - L59 were not covered by tests
name: "SpanRef.LockFailed",
message = "Failed to acquire lock for SpanRef: {:?}",
reason = format!("{:?}", err),
span_context = format!("{:?}", self.0.span_context));

Check warning on line 63 in opentelemetry/src/trace/context.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry/src/trace/context.rs#L62-L63

Added lines #L62 - L63 were not covered by tests
}
}
}
}
Expand Down
Loading