Skip to content

Propagate tracing span attributes in sentry events #617

Closed

Description

@samscott89

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?

Activity

  1. Swatinem commented on Sep 28, 2023

    @Swatinem
    Contributor

    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.

  2. samscott89 commented on Sep 29, 2023

    @samscott89
    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.

  3. tsionyx commented on Dec 2, 2023

    @tsionyx
    Contributor

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

  4. thomaseizinger commented on Nov 20, 2024

    @thomaseizinger
    Contributor

    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?

  5. thomaseizinger commented on Nov 29, 2024

    @thomaseizinger
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions