Open frjonsen opened 10 months ago
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.
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 astags.{}
, rather than the current{}.{}
.