GeezerVison is showing github.com — feat(core): Capture # of dropped spans through `beforeSendTransaction` by mydea · Pull Request #13022 · getsentry/sentry-javascript
Conversation
Fixes #12849.
This is a bit tricky because beforeSendTransaction can return a promise, so in order to avoid dealing with this I put the # of spans on the sdk metadata, and then compare that afterwards.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const spans = event.spans || [];
|
|
|
// the transaction itself counts as one span, plus all the child spans that are added
|
|
|
const spanCount = 1 + spans.length;
|
|
|
this._outcomes['span'] = (this._outcomes['span'] || 0) + spanCount;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that this was actually buggy, because the key is built from reason + category 😬 now this is unified and should work consistently.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Lms24 reacted with thumbs up emoji
size-limit report 📦
| Path |
Size |
| @sentry/browser |
22.4 KB (+0.43% 🔺) |
| @sentry/browser (incl. Tracing) |
33.85 KB (+0.37% 🔺) |
| @sentry/browser (incl. Tracing, Replay) |
69.91 KB (+0.14% 🔺) |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
63.25 KB (+0.15% 🔺) |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
74.31 KB (+0.13% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
86.68 KB (+0.12% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback, metrics) |
88.56 KB (+0.14% 🔺) |
| @sentry/browser (incl. metrics) |
26.71 KB (+0.34% 🔺) |
| @sentry/browser (incl. Feedback) |
39.11 KB (+0.23% 🔺) |
| @sentry/browser (incl. sendFeedback) |
27.02 KB (+0.33% 🔺) |
| @sentry/browser (incl. FeedbackAsync) |
31.66 KB (+0.27% 🔺) |
| @sentry/react |
25.17 KB (+0.37% 🔺) |
| @sentry/react (incl. Tracing) |
36.9 KB (+0.27% 🔺) |
| @sentry/vue |
26.55 KB (+0.39% 🔺) |
| @sentry/vue (incl. Tracing) |
35.7 KB (+0.25% 🔺) |
| @sentry/svelte |
22.54 KB (+0.42% 🔺) |
| CDN Bundle |
23.59 KB (+0.32% 🔺) |
| CDN Bundle (incl. Tracing) |
35.58 KB (+0.22% 🔺) |
| CDN Bundle (incl. Tracing, Replay) |
69.95 KB (+0.13% 🔺) |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
75.22 KB (+0.1% 🔺) |
| CDN Bundle - uncompressed |
69.32 KB (+0.47% 🔺) |
| CDN Bundle (incl. Tracing) - uncompressed |
105.42 KB (+0.31% 🔺) |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
217.06 KB (+0.15% 🔺) |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
229.89 KB (+0.14% 🔺) |
| @sentry/nextjs (client) |
36.75 KB (+0.26% 🔺) |
| @sentry/sveltekit (client) |
34.49 KB (+0.29% 🔺) |
| @sentry/node |
111.86 KB (+0.09% 🔺) |
| @sentry/node - without tracing |
89.3 KB (+0.1% 🔺) |
| @sentry/aws-serverless |
98.44 KB (+0.1% 🔺) |
|
Lms24 reacted with eyes emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: no particular strong feelings given these are client reports but should we add a test for them?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
mydea reacted with thumbs up emoji
l: no particular strong feelings given these are client reports but should we add a test for them?
Yeah I thought about this too, I'll add some I think!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
krystofwoldrich
pushed a commit
that referenced
this pull request
Aug 13, 2024
#13022)
Fixes #12849.
This is a bit tricky because `beforeSendTransaction` can return a
promise, so in order to avoid dealing with this I put the # of spans on
the sdk metadata, and then compare that afterwards.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|