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

add initial values for functions to the data #445

Merged
merged 2 commits into from May 20, 2022
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion sentry-tracing/src/layer.rs
Expand Up @@ -162,7 +162,7 @@ where
return;
}

let (description, _data) = extract_span_data(attrs);
let (description, data) = extract_span_data(attrs);
let op = span.name();

// Spans don't always have a description, this ensures our data is not empty,
Expand All @@ -184,6 +184,12 @@ where
sentry_core::start_transaction(ctx).into()
}
};
// Add the data from the original span to the sentry span.
// This comes from typically the `fields` in `tracing::instrument`.
for (key, value) in data {
sentry_span.set_data(&key, value);
}

sentry_core::configure_scope(|scope| scope.set_span(Some(sentry_span.clone())));

let mut extensions = span.extensions_mut();
Expand Down