-
-
Notifications
You must be signed in to change notification settings - Fork 435
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 don't overwrite the span status of unfinished spans #2859
Fix don't overwrite the span status of unfinished spans #2859
Conversation
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b0815e7 | 286.90 ms | 322.02 ms | 35.12 ms |
03438e5 | 282.12 ms | 366.40 ms | 84.28 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b0815e7 | 1.72 MiB | 2.29 MiB | 575.25 KiB |
03438e5 | 1.72 MiB | 2.29 MiB | 575.21 KiB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feat/7.0.0 #2859 +/- ##
================================================
+ Coverage 81.26% 81.45% +0.18%
- Complexity 4560 4660 +100
================================================
Files 350 354 +4
Lines 16866 17152 +286
Branches 2272 2320 +48
================================================
+ Hits 13706 13971 +265
- Misses 2219 2231 +12
- Partials 941 950 +9
☔ View full report in Codecov by Sentry. |
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.
LGTM, but only one concern - we're not executing this block for JPC stuff, do we still need to handle it (at least the start date), in case of parent transaction is aborted?
sentry-java/sentry/src/main/java/io/sentry/Span.java
Lines 193 to 222 in 695d3a3
if (options.isTrimStart() || options.isTrimEnd()) { | |
@Nullable SentryDate minChildStart = null; | |
@Nullable SentryDate maxChildEnd = null; | |
// The root span should be trimmed based on all children, but the other spans, like the | |
// jetpack composition should be trimmed based on its direct children only | |
final @NotNull List<Span> children = | |
transaction.getRoot().getSpanId().equals(getSpanId()) | |
? transaction.getChildren() | |
: getDirectChildren(); | |
for (final Span child : children) { | |
if (minChildStart == null || child.getStartDate().isBefore(minChildStart)) { | |
minChildStart = child.getStartDate(); | |
} | |
if (maxChildEnd == null | |
|| (child.getFinishDate() != null && child.getFinishDate().isAfter(maxChildEnd))) { | |
maxChildEnd = child.getFinishDate(); | |
} | |
} | |
if (options.isTrimStart() | |
&& minChildStart != null | |
&& startTimestamp.isBefore(minChildStart)) { | |
updateStartDate(minChildStart); | |
} | |
if (options.isTrimEnd() | |
&& maxChildEnd != null | |
&& (this.timestamp == null || this.timestamp.isAfter(maxChildEnd))) { | |
updateEndDate(maxChildEnd); | |
} | |
} |
I looked into this in more detail now and I think it's fine this way as relay would anyway set the status to |
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.
good!
📜 Description
Span status should remain untouched when being force-finished, instead of setting
DEADLINE_EXCEEDED
.💡 Motivation and Context
Fixes #2730
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps