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

Propagate tracing span attributes in sentry events #617

Closed
samscott89 opened this issue Sep 27, 2023 · 5 comments · Fixed by #712
Closed

Propagate tracing span attributes in sentry events #617

samscott89 opened this issue Sep 27, 2023 · 5 comments · Fixed by #712

Comments

@samscott89
Copy link

Hey,

Thanks for providing Rust support. We're happily using sentry and sentry-tracing crates. Mostly all working well.

We expose a ton of helpful debugging information through span attributes. As far as I can tell, these are captured for performance monitoring, but aren't provided as context when capturing events (via tracing::error! for example).

Is there any way that any span data captured could also be included in events emitted by sentry-tracing?

@Swatinem
Copy link
Member

I don’t think this is currently possible. Other members of the team are prototyping ways to rewamp the performance monitoring / tracing APIs to make such things easier in the future, but it is still very early in that process.

@samscott89
Copy link
Author

Cool, looking forward to seeing what happens there. Let me know if you want any feedback/testers, we'd be open to trying stuff out.

@tsionyx
Copy link
Contributor

tsionyx commented Dec 2, 2023

Hello. I just made the implementation of this feature. Would be glad if someone look at it and maybe suggest some improvements.

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Nov 20, 2024

Unfortuantely, this feature appears to be tied to a span_filter that records the span which in turn might spam many spans to Sentry's Tracing feature. It would be great if we can record fields from spans in breadcrumbs while at the same time, only submit certain spans to Sentry.

Could we move the sampling of the span to the finish part? i.e. record it locally to ensure it is active when events try to extract fields for breadcrumbs and the sampling simply prevents it from being sent to Sentry?

github-merge-queue bot pushed a commit to firezone/firezone that referenced this issue Nov 21, 2024
Reverts #7379.

Unfortunately, this doesn't actually work because those fields are only
recorded as part of spans that get sampled, see
getsentry/sentry-rust#617 (comment).
If we were to start recording all spans, we'd have a massive overhead
and send lots of spans to Sentry.
github-merge-queue bot pushed a commit to firezone/firezone that referenced this issue Nov 21, 2024
Reverts #7379.

Unfortunately, this doesn't actually work because those fields are only
recorded as part of spans that get sampled, see
getsentry/sentry-rust#617 (comment).
If we were to start recording all spans, we'd have a massive overhead
and send lots of spans to Sentry.
@thomaseizinger
Copy link
Contributor

It would be great if we can record fields from spans in breadcrumbs while at the same time, only submit certain spans to Sentry.

The way to achieve this is to use a span_filter that allows all spans, paired with a traces_sampler that inspects the current span and computes an appropriate sampling rate (i.e. 0.0 for discard or 1.0 for include).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants