Skip to content
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

Include unfinished spans in transactions #1182

Closed
Tracked by #1690 ...
bruno-garcia opened this issue Aug 31, 2021 · 6 comments · Fixed by #3013
Closed
Tracked by #1690 ...

Include unfinished spans in transactions #1182

bruno-garcia opened this issue Aug 31, 2021 · 6 comments · Fixed by #3013
Assignees
Labels
Feature New feature or request Product: Tracing
Milestone

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Aug 31, 2021

When a transaction is finished, the SDK tries to send the data to Sentry.

If an open Span (one that was not finished) exist in that transaction, the SDK removes that span before sending the data to Sentry.

That was done because Sentry will discard the transaction if unfinished spans are included. More context on this thread: getsentry/develop#274

An alternative solution used by the JavaScript SDK is to complete those spans with the timestamp of the finishing transaction and setting the status to deadline_exceeded . We should align with this approach as it shows something was going on even though it wasn't completed during the transaction.

Java: getsentry/sentry-java#1690
Cocoa: getsentry/sentry-cocoa#1303

@SimonCropp
Copy link
Contributor

blocked by https://getsentry.atlassian.net/browse/INGEST-1109 (internal)

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Apr 27, 2022

Created related issue on Relay: getsentry/relay#1244
Blocked by this ^

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Apr 27, 2022

Worth noting once we start adding unfinished Spans we'll need to notify the minimum Self Hosted version required since the old version of Relay dropped transactions completely if they had an unfinished span (reason why all SDKs compensated that with dropping or lying about a span being finished)

@bruno-garcia bruno-garcia added this to the 4.0.0 milestone Dec 14, 2023
@bruno-garcia
Copy link
Member Author

bruno-garcia commented Dec 14, 2023

@jamescrosswell @bitsandfoxes this is unblocked now and since we're on a major we should definitely include this one.

Android/Java SDKs added on 7.0.0 and it's the reason they mention new Self hosted min version 22.12:
From their README:

Since version 7.0.0 of this SDK, Sentry version >= 22.12.0 is required to properly ingest transactions with unfinished spans.

Related PRs:

@jamescrosswell
Copy link
Collaborator

From what I can tell, this was implemented about 3 years ago in #1296 so there's nothing to do here:

foreach (var span in _spans)
{
if (!span.IsFinished)
{
_options?.LogDebug("Deadline exceeded for Transaction {0} -> Span {1}.", SpanId, span.SpanId);
span.Finish(SpanStatus.DeadlineExceeded);
}
}

@bruno-garcia
Copy link
Member Author

From what I can tell, this was implemented about 3 years ago in #1296 so there's nothing to do here:

foreach (var span in _spans)
{
if (!span.IsFinished)
{
_options?.LogDebug("Deadline exceeded for Transaction {0} -> Span {1}.", SpanId, span.SpanId);
span.Finish(SpanStatus.DeadlineExceeded);
}
}

The goal is to delete that code. We don't need to "fake" finish stuff since Relay will deal with that.
4.0 is a good time to change this (since it'll break transactions on self hosted Sentry older then 22.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request Product: Tracing
Projects
Status: Done
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants