Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry: on_event respects event's explicit parent #2296

Merged
merged 1 commit into from Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tracing-opentelemetry/src/subscriber.rs
Expand Up @@ -620,8 +620,8 @@ where
/// [`ERROR`]: tracing::Level::ERROR
/// [`Error`]: opentelemetry::trace::StatusCode::Error
fn on_event(&self, event: &Event<'_>, ctx: Context<'_, C>) {
// Ignore events that are not in the context of a span
if let Some(span) = ctx.lookup_current() {
// Ignore events that have no explicit parent set *and* are not in the context of a span
if let Some(span) = ctx.event_span(event) {
// Performing read operations before getting a write lock to avoid a deadlock
// See https://github.com/tokio-rs/tracing/issues/763
#[cfg(feature = "tracing-log")]
Expand Down