fix(telemetry): include span attributes in breadcrumbs#7421
Merged
thomaseizinger merged 5 commits intomainfrom Dec 2, 2024
Merged
fix(telemetry): include span attributes in breadcrumbs#7421thomaseizinger merged 5 commits intomainfrom
thomaseizinger merged 5 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another attempt at fixing #7386. Previous PR was #7379. The difference is, this time it works! In the following screenshot,
handle_inputis a currently active span.I had to make some patches to Sentry, most notably:
finishgetsentry/sentry-rust#712The way we configure Sentry is quite tricky:
First and foremost, we need to understand that the
tracingadapter for Sentry has aspan_filterconfiguration. When a span gets filtered out there, the rest ofsentry-tracingnever sees the data in that span. Thus, in order to capture variables from spans, we need to have a fairly generous span filter. In this PR, we change this span filter to include all spans except those on TRACE level.Secondly, by default, the Sentry SDK doesn't send any spans to the backend, i.e. the sampling rate is 0. Previously, we set the sampling rate to 1.0 because the
span_filterwas already filtering out all non-telemetry spans. A telemetry span is a concept that we invented. It is a span that gets sampled at creation time with a probability of 1%. This is useful because creating a lot of spans is also expensive, so we don't want to do it e.g. on a per-packet basis. With just these configuration options, we now have a problem: We don't want to submit all spans to Sentry but we need thespan_filterto allow all spans otherwise we can't capture the contextual fields from the span in breadcrumbs. Luckily, the Sentry SDK has another configuration option:traces_sampler.The
traces_samplergets to compute a sampling rate for each individual span. This allows us to discard all spans from being sent to Sentry unless they aretelemetryspans.Resolves: #7386.