-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
rfc(decision): Mobile - Tracing Without Performance V2 #136
Changes from 1 commit
313a0a0
27c44c4
a68b563
e3be25a
3a70e7b
9c252cc
fddeeaa
764196a
cd840eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,11 @@ it based on routes, so it should be easy to implement for React-Native. | |
|
||
### Cons <a name="option-1-cons"></a> | ||
|
||
1. It doesn’t work well for declarative UI frameworks as Jetpack Compose and SwiftUI for which the | ||
1. For single-screen applications such as social networks, the lifetime of a trace could still be | ||
long, and multiple unrelated events could be mapped to one trace. | ||
2. For applications running for a long time in the background, such as running apps, the lifetime of | ||
a trace could still be long, and multiple unrelated events could be mapped to one trace. | ||
philipphofmann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. It doesn’t work well for declarative UI frameworks as Jetpack Compose and SwiftUI for which the | ||
SDKs can’t reliably automatically detect when apps load a new screen. | ||
|
||
# Drawbacks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were recently made aware that another implication of long-running traces is that it potentially increases transaction/span quota usage. This is because in JS we inherit the sampling decision for the trace in subsequent transactions. For example:
So either we accept this and move on for now by continuing with this behaviour or we break trace consistency by again rolling the dice for new root spans/transactions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Lms24, please clarify why this wasn't a problem before. I don't understand how this proposed change here will cause this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might be missing a bit of context around how Tracing without Performance and the PropagationContext is implemented in mobile SDKs. If the proposed change is purely intended for TwP scenarios and does not affect the overall trace lifetime in case a root span/transaction is started ("tracing with performance") I think we're good. That is because for TwP, we defer the sampling decision to the downstream service (i.e. send In JS however, we changed the trace lifetime not just for TwP but in general, leading to scenarios like the one above. To illustrate further, why this is problematic, I'm gonna adjust the example a bit from above
So even without an active transaction, we'd still propagate a forced sampled flag to downstream services. Does this make sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the detailed explanation. Yes, that makes sense, but I guess in the long run, you should have a roughly equal amount of transactions. It shouldn't matter if you roll the dice once for 10 transactions or every time for each transaction. If you roll the dice often enough, an equal amount of transactions should be captured. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessarily unfortunately. This would only hold up if the sample rates on client and server were the same. If users have lower sample rates on the server, they would send significantly less server-side transactions with the previous implementation. I tried verifying this with a small script: https://gist.github.com/Lms24/9a631295aef58cf22fb8f5307953335c There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We should say explicitly to use only the |
||
|
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.
IIUC this is in line with the JS implementation, and something we can accept for now. In case we have clear pointers we need to address this (and how) we can iterate
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.
A manual API to renew the
traceId
could help with these edge cases.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.
fyi, we have TracingUtils.startNewTrace in Java (should probably be exposed through the static API though)