-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
Remove sentry
frames if SDK falls back to current stack trace
#2351
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2351 +/- ##
==========================================
+ Coverage 84.76% 84.80% +0.03%
==========================================
Files 253 253
Lines 9059 9074 +15
==========================================
+ Hits 7679 7695 +16
+ Misses 1380 1379 -1 ☔ View full report in Codecov by Sentry. |
Android Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe4aa56 | 356.06 ms | 428.67 ms | 72.61 ms |
d53c6fa | 282.83 ms | 344.00 ms | 61.17 ms |
873fb42 | 352.10 ms | 397.43 ms | 45.33 ms |
3334ac1 | 303.98 ms | 366.65 ms | 62.67 ms |
5f443de | 412.30 ms | 491.67 ms | 79.37 ms |
d089990 | 361.67 ms | 442.50 ms | 80.83 ms |
0118295 | 365.71 ms | 438.56 ms | 72.85 ms |
4d763a5 | 441.22 ms | 501.40 ms | 60.18 ms |
deaeece | 347.42 ms | 381.10 ms | 33.68 ms |
d8519f9 | 352.83 ms | 420.46 ms | 67.62 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe4aa56 | 6.06 MiB | 7.10 MiB | 1.04 MiB |
d53c6fa | 6.16 MiB | 7.14 MiB | 1011.18 KiB |
873fb42 | 5.94 MiB | 6.96 MiB | 1.02 MiB |
3334ac1 | 6.06 MiB | 7.03 MiB | 993.54 KiB |
5f443de | 6.35 MiB | 7.34 MiB | 1008.00 KiB |
d089990 | 6.34 MiB | 7.28 MiB | 967.79 KiB |
0118295 | 6.33 MiB | 7.26 MiB | 947.07 KiB |
4d763a5 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
deaeece | 5.94 MiB | 6.96 MiB | 1.02 MiB |
d8519f9 | 6.33 MiB | 7.26 MiB | 946.13 KiB |
Previous results on branch: feat/stack-frame-excludes
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
89f72ba | 690.31 ms | 750.86 ms | 60.55 ms |
89ff369 | 449.88 ms | 501.09 ms | 51.21 ms |
be807ef | 447.39 ms | 509.94 ms | 62.55 ms |
6a2fb35 | 452.60 ms | 471.21 ms | 18.61 ms |
b74ef0c | 457.74 ms | 504.35 ms | 46.61 ms |
adf8466 | 449.17 ms | 503.16 ms | 54.00 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
89f72ba | 6.49 MiB | 7.57 MiB | 1.08 MiB |
89ff369 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
be807ef | 6.49 MiB | 7.57 MiB | 1.08 MiB |
6a2fb35 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
b74ef0c | 6.49 MiB | 7.57 MiB | 1.08 MiB |
adf8466 | 6.49 MiB | 7.57 MiB | 1.08 MiB |
iOS Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
c70e01a | 1273.00 ms | 1299.12 ms | 26.12 ms |
f770c4c | 1204.61 ms | 1222.82 ms | 18.20 ms |
98d9a4a | 1244.73 ms | 1266.33 ms | 21.59 ms |
30c1193 | 1227.20 ms | 1235.00 ms | 7.80 ms |
7ec9238 | 1259.69 ms | 1281.59 ms | 21.90 ms |
24f71aa | 1267.47 ms | 1272.00 ms | 4.53 ms |
636cb61 | 1266.06 ms | 1271.38 ms | 5.31 ms |
6e083bb | 1244.33 ms | 1264.60 ms | 20.26 ms |
ebfead1 | 1271.57 ms | 1284.48 ms | 12.91 ms |
6034b0a | 1244.89 ms | 1270.22 ms | 25.33 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
c70e01a | 8.16 MiB | 9.17 MiB | 1.01 MiB |
f770c4c | 8.32 MiB | 9.38 MiB | 1.06 MiB |
98d9a4a | 8.33 MiB | 9.62 MiB | 1.29 MiB |
30c1193 | 8.28 MiB | 9.34 MiB | 1.06 MiB |
7ec9238 | 8.34 MiB | 9.65 MiB | 1.31 MiB |
24f71aa | 8.10 MiB | 9.16 MiB | 1.07 MiB |
636cb61 | 8.28 MiB | 9.34 MiB | 1.06 MiB |
6e083bb | 8.16 MiB | 9.17 MiB | 1.01 MiB |
ebfead1 | 8.10 MiB | 9.16 MiB | 1.07 MiB |
6034b0a | 8.33 MiB | 9.40 MiB | 1.07 MiB |
Previous results on branch: feat/stack-frame-excludes
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
be807ef | 1238.78 ms | 1250.96 ms | 12.18 ms |
b74ef0c | 1256.04 ms | 1281.37 ms | 25.33 ms |
89ff369 | 1238.06 ms | 1254.94 ms | 16.88 ms |
89f72ba | 1253.04 ms | 1285.69 ms | 32.65 ms |
6a2fb35 | 1237.61 ms | 1245.08 ms | 7.47 ms |
adf8466 | 1233.16 ms | 1243.47 ms | 10.31 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
be807ef | 8.38 MiB | 9.75 MiB | 1.37 MiB |
b74ef0c | 8.38 MiB | 9.75 MiB | 1.37 MiB |
89ff369 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
89f72ba | 8.38 MiB | 9.75 MiB | 1.37 MiB |
6a2fb35 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
adf8466 | 8.38 MiB | 9.75 MiB | 1.37 MiB |
what about sdk crashes/errors? If a real sdk crash/error happened we wouldn't know because the frames would be removed, no? the main reason why we re-enabled it a couple months ago was to catch sdk errors |
stackFrameExcludes
to SentryOptions
sentry
frames if SDK falls back to currentStackTrace
sentry
frames if SDK falls back to currentStackTrace
sentry
frames if SDK falls back to current stack trace
@buenaflor We should somehow verify that we are not involuntarily breaking SDK crash detection, do you have any idea how? |
class Fixture { | ||
final options = defaultTestOptions(); | ||
|
||
SentryExceptionFactory getSut({bool attachStacktrace = true}) { | ||
options.attachStacktrace = true; | ||
options.attachStacktrace = attachStacktrace; |
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.
@buenaflor This was incorrect here, as the method param was never assigned. When fixed, some tests are breaking, but i don't have enough context yet to determine the corrected test expectations.
don't think we can directly test it but we can do a sanity check: https:/getsentry/sentry/blob/master/src/sentry/utils/sdk_crashes/sdk_crash_detection_config.py#L288C1-L302C1 if these paths are contained in one of the stacktraces we ingest it as a sdk crash/error one edge case is if we throw an unhandled error from the sdk and for some reason flutter doesn't provide a stacktrace, we try to capture a stacktrace with |
@buenaflor Checked wit some flutter sdk errors. Works as expected, sentry frames are removed. FlutterError.reportError(
FlutterErrorDetails(exception: FlutterError.fromParts(
<DiagnosticsNode>[
ErrorSummary(
'The Element for ${toStringShort()} cannot be inserted into slot "$slot" of its ancestor. ',
),
ErrorDescription(
'The ownership chain for the Element in question was:\n ${debugGetCreatorChain(10)}',
),
ErrorDescription(
'This Element allows the creation of multiple independent render trees, which cannot '
'be attached to an ancestor in an existing render tree. However, an ancestor RenderObject '
'is expecting that a child will be attached.'
),
ErrorHint(
'Try moving the subtree that contains the ${toStringShort()} widget into the '
'view property of a ViewAnchor widget or to the root of the widget tree, where '
'it is not expected to attach its RenderObject to its ancestor.',
),
],
)),
); FlutterError.reportError(
const FlutterErrorDetails(
exception:
'Both Router.navigate and Router.neglect have been called in this '
'build cycle, and the Router cannot decide whether to report the '
'route information. Please make sure only one of them is called '
'within the same build cycle.',
),
); FlutterError.reportError(
FlutterErrorDetails(
exception: FlutterError('A $runtimeType overflowed by $overflowText.'),
library: 'rendering library',
context: ErrorDescription('during layout'),
informationCollector: () => <DiagnosticsNode>[
// debugCreator should only be set in DebugMode, but we want the
// treeshaker to know that.
if (kDebugMode && debugCreator != null)
DiagnosticsDebugCreator(debugCreator!),
...overflowHints!,
describeForError('The specific $runtimeType in question is'),
// TODO(jacobr): this line is ascii art that it would be nice to
// handle a little more generically in GUI debugging clients in the
// future.
DiagnosticsNode.message('◢◤' * (FlutterError.wrapWidth ~/ 2), allowWrap: false),
],
),
); |
We could only avoid this if we only remove the stacktraces if the errors originiated in our error integrations, and not for any error where we fall back to StackTrace.current. |
@denrase if we throw an unhandled error within the SDK it is forwarded to our And for the rest where we fall back to // no stacktrace attached so we fallback to Stacktrace.current in stacktrace factory
Sentry.captureException(exception)
Sentry.captureMessage('msg') and that's also where the sentry frames are added that are misleading because it captures all sdk function calls until |
📜 Description
StackTrace.current
So we don't say that the app crashed in
stacktrace_utils.dart
anymore.Before
After (More frames are hidden in this screenshot, but it's identical to before)
💡 Motivation and Context
Relates to #2268
💚 How did you test it?
📝 Checklist
sendDefaultPii
is enabled🔮 Next steps
Will this affect grouping as well?
Will this affect SDK crash detection, provided we have this functionality on sentry dart/flutter?