From ddcbd07f75c6973ee7096e490a54745db73817b7 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 1 Mar 2022 11:00:41 -0800 Subject: [PATCH] add tags Signed-off-by: Jess Frazelle --- sentry-tracing/src/layer.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sentry-tracing/src/layer.rs b/sentry-tracing/src/layer.rs index bc9752a6..c2d6e7ef 100644 --- a/sentry-tracing/src/layer.rs +++ b/sentry-tracing/src/layer.rs @@ -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, @@ -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();