-
-
Notifications
You must be signed in to change notification settings - Fork 276
Sentry Supabase Integration #2913
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2913 +/- ##
=======================================
Coverage 88.12% 88.12%
=======================================
Files 295 295
Lines 10122 10122
=======================================
Hits 8920 8920
Misses 1202 1202 ☔ View full report in Codecov by Sentry. |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 75284dc | 512.39 ms | 530.87 ms | 18.48 ms |
| e45c0e1 | 447.29 ms | 558.33 ms | 111.04 ms |
| fd88186 | 422.07 ms | 469.10 ms | 47.03 ms |
| 819c1e7 | 449.80 ms | 442.98 ms | -6.82 ms |
| 2cf9161 | 454.12 ms | 512.67 ms | 58.55 ms |
| c1e775e | 482.36 ms | 608.98 ms | 126.62 ms |
| 6e7d494 | 397.35 ms | 378.91 ms | -18.43 ms |
| 79f6b41 | 469.66 ms | 525.90 ms | 56.24 ms |
| 5a95d04 | 378.92 ms | 364.33 ms | -14.59 ms |
| 793f4dc | 462.68 ms | 544.21 ms | 81.53 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 75284dc | 13.93 MiB | 14.93 MiB | 1.00 MiB |
| e45c0e1 | 6.54 MiB | 7.70 MiB | 1.16 MiB |
| fd88186 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 819c1e7 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 2cf9161 | 6.54 MiB | 7.70 MiB | 1.16 MiB |
| c1e775e | 6.54 MiB | 7.70 MiB | 1.17 MiB |
| 6e7d494 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 79f6b41 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 5a95d04 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 793f4dc | 6.54 MiB | 7.69 MiB | 1.15 MiB |
Previous results on branch: feat/supabase
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8bd9497 | 470.21 ms | 524.26 ms | 54.05 ms |
| 0a08454 | 515.10 ms | 634.67 ms | 119.57 ms |
| 22c24e6 | 483.94 ms | 485.42 ms | 1.48 ms |
| e4d1bf6 | 499.64 ms | 528.47 ms | 28.82 ms |
| 30c089b | 471.71 ms | 522.65 ms | 50.94 ms |
| 1476f86 | 477.10 ms | 480.87 ms | 3.77 ms |
| 5454931 | 447.86 ms | 439.08 ms | -8.78 ms |
| 34b0923 | 509.55 ms | 590.18 ms | 80.62 ms |
| 2db18e6 | 470.42 ms | 473.86 ms | 3.43 ms |
| ecfbb1d | 479.15 ms | 537.30 ms | 58.15 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8bd9497 | 6.44 MiB | 7.43 MiB | 1013.21 KiB |
| 0a08454 | 6.44 MiB | 7.43 MiB | 1013.22 KiB |
| 22c24e6 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| e4d1bf6 | 6.44 MiB | 7.44 MiB | 1017.53 KiB |
| 30c089b | 6.44 MiB | 7.43 MiB | 1010.46 KiB |
| 1476f86 | 13.93 MiB | 14.93 MiB | 1.00 MiB |
| 5454931 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 34b0923 | 6.44 MiB | 7.43 MiB | 1013.10 KiB |
| 2db18e6 | 13.93 MiB | 14.93 MiB | 1.00 MiB |
| ecfbb1d | 6.54 MiB | 7.71 MiB | 1.17 MiB |
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0fb45d0 | 1273.24 ms | 1286.44 ms | 13.19 ms |
| c8596a6 | 1234.11 ms | 1241.19 ms | 7.08 ms |
| aeb02f2 | 1244.29 ms | 1256.55 ms | 12.26 ms |
| 5a95d04 | 1263.17 ms | 1265.37 ms | 2.20 ms |
| e2d675d | 1238.48 ms | 1242.76 ms | 4.28 ms |
| 9b99523 | 1256.06 ms | 1270.33 ms | 14.27 ms |
| 8541716 | 1270.18 ms | 1271.80 ms | 1.62 ms |
| de377fd | 1252.28 ms | 1254.76 ms | 2.48 ms |
| 2cf9161 | 1248.33 ms | 1266.55 ms | 18.22 ms |
| 5b9a0da | 1249.69 ms | 1250.71 ms | 1.03 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0fb45d0 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| c8596a6 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| aeb02f2 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 5a95d04 | 5.53 MiB | 6.01 MiB | 487.81 KiB |
| e2d675d | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 9b99523 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 8541716 | 5.53 MiB | 6.00 MiB | 479.96 KiB |
| de377fd | 20.71 MiB | 22.43 MiB | 1.73 MiB |
| 2cf9161 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 5b9a0da | 5.53 MiB | 5.96 MiB | 444.32 KiB |
Previous results on branch: feat/supabase
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f8ec07b | 1259.06 ms | 1273.22 ms | 14.16 ms |
| b0f288d | 1261.51 ms | 1264.02 ms | 2.51 ms |
| 5454931 | 1266.92 ms | 1270.20 ms | 3.29 ms |
| e4d1bf6 | 1249.16 ms | 1267.12 ms | 17.96 ms |
| 22c24e6 | 1254.75 ms | 1265.22 ms | 10.47 ms |
| 0a08454 | 1265.15 ms | 1283.18 ms | 18.04 ms |
| 34b0923 | 1269.29 ms | 1275.88 ms | 6.59 ms |
| 77c7ea9 | 1264.57 ms | 1279.47 ms | 14.89 ms |
| de422e0 | 1245.98 ms | 1249.29 ms | 3.31 ms |
| 0ab2edd | 1254.71 ms | 1264.28 ms | 9.56 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f8ec07b | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| b0f288d | 5.53 MiB | 6.00 MiB | 479.95 KiB |
| 5454931 | 5.53 MiB | 6.00 MiB | 479.95 KiB |
| e4d1bf6 | 8.43 MiB | 10.00 MiB | 1.56 MiB |
| 22c24e6 | 5.53 MiB | 6.00 MiB | 485.11 KiB |
| 0a08454 | 8.43 MiB | 10.01 MiB | 1.58 MiB |
| 34b0923 | 8.43 MiB | 10.01 MiB | 1.58 MiB |
| 77c7ea9 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| de422e0 | 5.53 MiB | 6.01 MiB | 488.14 KiB |
| 0ab2edd | 7.85 MiB | 9.45 MiB | 1.59 MiB |
|
@denrase could you have a look at cursor comments pls |
|
@buenaflor Issues should be addressed now. |
| request, | ||
| response, | ||
| ); | ||
| } |
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.
Bug: Sentry's error capture is too broad.
The error client captures exceptions for all HTTP requests, not just Supabase database requests. It should check if SentrySupabaseRequest.fromRequest() returns non-null before capturing the error, similar to how the breadcrumb and tracing clients filter requests. Currently, auth requests and other non-database operations incorrectly trigger error capture when they fail.
| span.setData( | ||
| SentrySpanOperations.dbSqlQuery, | ||
| supabaseRequest.generateSqlQuery(), | ||
| ); |
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.
Bug: Sentry Span Keys: Operations vs. Data
Using SentrySpanOperations.dbSqlQuery as a span data key, but this constant belongs to span operations (used for startChild operation parameter), not span data keys. All other data keys in this function use constants from SentrySpanData class. This semantic mismatch could cause confusion and makes the data key inconsistent with the codebase's organization pattern where SentrySpanOperations defines operation types and SentrySpanData defines data keys.
| }; | ||
|
|
||
| _hub.captureEvent(event, stackTrace: stackTrace, hint: hint); | ||
| } |
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.
Bug: Fix Unawaited Future in Exception Handling (Bugbot Rules)
The _captureException method calls _hub.captureEvent without awaiting the Future (line 81), violating the SDK rule to avoid unawaited futures unless intentional and documented. This is inconsistent with existing patterns like failed_request_client.dart which awaits captureEvent. To fix this, the method signature should be Future<void> and the call should be awaited, with corresponding changes to the two call sites (lines 28 and 38) to await _captureException.
📜 Description
Supabase instrumentation for database operations (no auth instrumentation)
💡 Motivation and Context
Closes #2727
💚 How did you test it?
Unit tests.
📝 Checklist
sendDefaultPiiis enabled