-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
Fix: Discard unfinished Spans before sending them over to Sentry #1279
Conversation
A question from #1262 (comment) must be answered before we can merge it |
Codecov Report
@@ Coverage Diff @@
## main #1279 +/- ##
============================================
+ Coverage 75.04% 75.06% +0.02%
- Complexity 1752 1754 +2
============================================
Files 183 183
Lines 6159 6165 +6
Branches 610 612 +2
============================================
+ Hits 4622 4628 +6
Misses 1258 1258
Partials 279 279
Continue to review full report at Codecov.
|
unfinishedSpans.add(span); | ||
} | ||
} | ||
transaction.getSpans().removeAll(unfinishedSpans); |
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.
Would be nice to log out. Maybe check if logging is enabled to warn level, if yes we log count of dropped span and the operations?
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.
I'd log it too
the answer is here: getsentry/develop#274 (comment) |
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.
I'd log unfinished spans and missing changelog, other than that, LGTM
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.
👍
unfinishedSpans.add(span); | ||
} | ||
} | ||
if (options.getLogger().isEnabled(SentryLevel.WARNING) && !unfinishedSpans.isEmpty()) { |
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.
if (options.getLogger().isEnabled(SentryLevel.WARNING) && !unfinishedSpans.isEmpty()) { | |
if (!unfinishedSpans.isEmpty()) { |
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.
options.getLogger().log
already checks if its enabled internally, !unfinishedSpans.isEmpty()
isn't a heavy call I believe, it'd be fine logging directly
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.
👍
📜 Description
Discard unfinished Spans before sending them over to Sentry
💡 Motivation and Context
Fixes #1262
💚 How did you test it?
Unit tests.
📝 Checklist