sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

tracing: Propagate span to tags

Open frjonsen opened this issue 1 year ago • 1 comments
trafficstars

This is related to what was solved in this PR: https://github.com/getsentry/sentry-rust/pull/629

Currently all spans are propagated to context. I feel what's missing is that spans named "tags" should instead be propagated to tags in Sentry.

At a glance it should be sufficient to add a check in the arms of this match https://github.com/getsentry/sentry-rust/blob/acba14fb89638749a2b662223946498f92c4008c/sentry-tracing/src/converters.rs#L71-L88 where if the span name is tags, then the key should be formatted as tags.{}, rather than the current {}.{}.

frjonsen avatar Jan 11 '24 15:01 frjonsen

TBH, this feels a bit too magical, and might lead to some surprises as well.

Especially if you happen to have such a function:

#[tracing::instrument]
fn tags(arg: ()) {
}

This is an interesting idea though, and may be something to put more thought into.

Swatinem avatar Jan 12 '24 10:01 Swatinem