sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Sentry Supabase Integration

Open denrase opened this issue 8 months ago • 4 comments

:scroll: Description

Supabase instrumentation for database operations (no auth instrumentation)

  • [x] Breadcrumbs
  • [x] Body Redaction
  • [x] Tracing
  • [x] Errors
  • [x] PII (Body, Query)

:bulb: Motivation and Context

Closes #2727

:green_heart: How did you test it?

Unit tests.

:pencil: Checklist

  • [x] I reviewed submitted code
  • [x] I added tests to verify changes
  • [x] No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • [ ] I updated the docs if needed
  • [x] All tests passing
  • [x] No breaking changes

denrase avatar May 06 '25 12:05 denrase

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 88.19%. Comparing base (bbdbcb9) to head (d2780a9). :warning: Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2913      +/-   ##
==========================================
- Coverage   88.31%   88.19%   -0.13%     
==========================================
  Files         291      291              
  Lines        9957     9957              
==========================================
- Hits         8794     8782      -12     
- Misses       1163     1175      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 06 '25 12:05 codecov[bot]

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 355.94 ms 353.02 ms -2.92 ms
Size 13.93 MiB 15.18 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2b5e0909ab65eea96847f25a12e71b576161c9d6 437.21 ms 467.14 ms 29.93 ms
854171607b8d01e91bc2d6476b5df37c17ffceaf 437.14 ms 443.65 ms 6.51 ms
32914d80ea2dfc92afeceeb9aa632add83a93be9 461.96 ms 495.47 ms 33.51 ms
ec7888805bfda6d2f739a632adbab10859e125bd 457.94 ms 519.96 ms 62.02 ms
8825ed822526eb251bd8aabce2afdf5f29e9bc1a 447.65 ms 456.90 ms 9.25 ms
d3fb366320cdb681366330731e73b8c4ddd8ba45 391.49 ms 385.85 ms -5.64 ms
c8596a67e15016e6525cc0df70020434b0a362b9 474.00 ms 492.96 ms 18.96 ms
7cfee3bc629d20e5ab56e18774c1692b367b0c23 498.78 ms 516.98 ms 18.20 ms
9b99523bc1d93bd8f07db6148870b0ca52460f96 456.91 ms 490.55 ms 33.64 ms
0fb45d0ad41517aeeb2adc942dadc4dd5dd49794 482.79 ms 554.02 ms 71.23 ms

App size

Revision Plain With Sentry Diff
2b5e0909ab65eea96847f25a12e71b576161c9d6 13.93 MiB 15.06 MiB 1.13 MiB
854171607b8d01e91bc2d6476b5df37c17ffceaf 13.93 MiB 15.00 MiB 1.06 MiB
32914d80ea2dfc92afeceeb9aa632add83a93be9 6.54 MiB 7.70 MiB 1.16 MiB
ec7888805bfda6d2f739a632adbab10859e125bd 6.54 MiB 7.69 MiB 1.15 MiB
8825ed822526eb251bd8aabce2afdf5f29e9bc1a 13.93 MiB 14.93 MiB 1.00 MiB
d3fb366320cdb681366330731e73b8c4ddd8ba45 13.93 MiB 15.06 MiB 1.13 MiB
c8596a67e15016e6525cc0df70020434b0a362b9 6.54 MiB 7.53 MiB 1015.27 KiB
7cfee3bc629d20e5ab56e18774c1692b367b0c23 6.54 MiB 7.70 MiB 1.17 MiB
9b99523bc1d93bd8f07db6148870b0ca52460f96 6.54 MiB 7.69 MiB 1.15 MiB
0fb45d0ad41517aeeb2adc942dadc4dd5dd49794 6.54 MiB 7.70 MiB 1.17 MiB

Previous results on branch: feat/supabase

Startup times

Revision Plain With Sentry Diff
5e3ca918ef7d66ae8d5a7d159caf0aa7e817820c 451.24 ms 496.74 ms 45.50 ms
30c089b14554ccc2771854ca54ea507362481d9b 471.71 ms 522.65 ms 50.94 ms
0ab2eddc6297ff128321a7b834fe04fcdda474e3 459.85 ms 506.63 ms 46.77 ms
2db18e64753084d50dabf501ea2caa0c34717a97 470.42 ms 473.86 ms 3.43 ms
2c3bf294fddf7a3bdd37dab44455fdc4c5448cb1 437.27 ms 454.44 ms 17.17 ms
de422e0d0a2bb05e36446b30ff52e8e5e9b0a078 364.02 ms 362.76 ms -1.27 ms
1476f86ae6c50469d97ebdf91184ce3bf7e0dde8 477.10 ms 480.87 ms 3.77 ms
e4d1bf6d5e311cffb257340e5dd7bb57fe827886 499.64 ms 528.47 ms 28.82 ms
f8ec07ba7fc87f2a8612688fc5c51548d06c4c82 452.65 ms 537.85 ms 85.21 ms
22c24e681e074dcc8eae211fc1eb067683b66c64 483.94 ms 485.42 ms 1.48 ms

App size

Revision Plain With Sentry Diff
5e3ca918ef7d66ae8d5a7d159caf0aa7e817820c 6.44 MiB 7.44 MiB 1017.53 KiB
30c089b14554ccc2771854ca54ea507362481d9b 6.44 MiB 7.43 MiB 1010.46 KiB
0ab2eddc6297ff128321a7b834fe04fcdda474e3 6.54 MiB 7.53 MiB 1016.33 KiB
2db18e64753084d50dabf501ea2caa0c34717a97 13.93 MiB 14.93 MiB 1.00 MiB
2c3bf294fddf7a3bdd37dab44455fdc4c5448cb1 13.93 MiB 15.06 MiB 1.13 MiB
de422e0d0a2bb05e36446b30ff52e8e5e9b0a078 13.93 MiB 15.06 MiB 1.13 MiB
1476f86ae6c50469d97ebdf91184ce3bf7e0dde8 13.93 MiB 14.93 MiB 1.00 MiB
e4d1bf6d5e311cffb257340e5dd7bb57fe827886 6.44 MiB 7.44 MiB 1017.53 KiB
f8ec07ba7fc87f2a8612688fc5c51548d06c4c82 6.54 MiB 7.70 MiB 1.17 MiB
22c24e681e074dcc8eae211fc1eb067683b66c64 13.93 MiB 15.06 MiB 1.13 MiB

github-actions[bot] avatar May 06 '25 12:05 github-actions[bot]

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1261.65 ms 1259.84 ms -1.81 ms
Size 5.53 MiB 6.02 MiB 501.34 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e2d675d11e0e71aa181238f00cd6f0160197f5f0 1238.48 ms 1242.76 ms 4.28 ms
6b69699b942d9fbf185b96ff0db1d0b1667b49ad 1254.80 ms 1273.31 ms 18.52 ms
5b9a0da8593d3b51ee3d1b3870c900d5cd7488e4 1249.69 ms 1250.71 ms 1.03 ms
7cfbbd634366d0063511af2b8af5a18e39d1189c 1270.63 ms 1285.36 ms 14.72 ms
a69a51fd1695dd93024be80a50ad05dd990b2b82 1231.73 ms 1233.15 ms 1.42 ms
ad121c0a1b26b9f995b26dfd6c3edf3ed3a6d799 1275.04 ms 1280.59 ms 5.55 ms
6ad8fc411d695aca249efc1623adafebdfe89ead 1263.70 ms 1266.06 ms 2.36 ms
393f8ec60d48e2aed3516b6259996d6a48d0b633 1256.45 ms 1259.60 ms 3.16 ms
d0aa4b67fcca9e160fdf80cf64c1e0e87282e8bb 1268.23 ms 1268.39 ms 0.15 ms
819c1e74af28bd103416f18bb39ce25e771994bc 1250.59 ms 1249.08 ms -1.51 ms

App size

Revision Plain With Sentry Diff
e2d675d11e0e71aa181238f00cd6f0160197f5f0 7.86 MiB 9.44 MiB 1.58 MiB
6b69699b942d9fbf185b96ff0db1d0b1667b49ad 7.86 MiB 9.44 MiB 1.58 MiB
5b9a0da8593d3b51ee3d1b3870c900d5cd7488e4 5.53 MiB 5.96 MiB 444.32 KiB
7cfbbd634366d0063511af2b8af5a18e39d1189c 7.86 MiB 9.44 MiB 1.58 MiB
a69a51fd1695dd93024be80a50ad05dd990b2b82 5.53 MiB 6.01 MiB 487.38 KiB
ad121c0a1b26b9f995b26dfd6c3edf3ed3a6d799 5.53 MiB 6.01 MiB 488.11 KiB
6ad8fc411d695aca249efc1623adafebdfe89ead 5.53 MiB 6.01 MiB 487.65 KiB
393f8ec60d48e2aed3516b6259996d6a48d0b633 5.53 MiB 6.01 MiB 488.10 KiB
d0aa4b67fcca9e160fdf80cf64c1e0e87282e8bb 5.53 MiB 6.02 MiB 502.04 KiB
819c1e74af28bd103416f18bb39ce25e771994bc 5.53 MiB 6.00 MiB 479.96 KiB

Previous results on branch: feat/supabase

Startup times

Revision Plain With Sentry Diff
34b09231ea4d798e691335dfc2a9355d731c0e8a 1269.29 ms 1275.88 ms 6.59 ms
22c24e681e074dcc8eae211fc1eb067683b66c64 1254.75 ms 1265.22 ms 10.47 ms
5454931a4f1092911dd3548669d1de5a0ac2ebbe 1266.92 ms 1270.20 ms 3.29 ms
b0f288d7cf49e212c2c7f51de8bb99e53b6af2ef 1261.51 ms 1264.02 ms 2.51 ms
0a08454de39d4b0fdcdd7a6b383bbd2be12f8810 1265.15 ms 1283.18 ms 18.04 ms
2c3bf294fddf7a3bdd37dab44455fdc4c5448cb1 1248.09 ms 1259.79 ms 11.70 ms
f8ec07ba7fc87f2a8612688fc5c51548d06c4c82 1259.06 ms 1273.22 ms 14.16 ms
de422e0d0a2bb05e36446b30ff52e8e5e9b0a078 1245.98 ms 1249.29 ms 3.31 ms
e4d1bf6d5e311cffb257340e5dd7bb57fe827886 1249.16 ms 1267.12 ms 17.96 ms
5e3ca918ef7d66ae8d5a7d159caf0aa7e817820c 1263.90 ms 1277.43 ms 13.53 ms

App size

Revision Plain With Sentry Diff
34b09231ea4d798e691335dfc2a9355d731c0e8a 8.43 MiB 10.01 MiB 1.58 MiB
22c24e681e074dcc8eae211fc1eb067683b66c64 5.53 MiB 6.00 MiB 485.11 KiB
5454931a4f1092911dd3548669d1de5a0ac2ebbe 5.53 MiB 6.00 MiB 479.95 KiB
b0f288d7cf49e212c2c7f51de8bb99e53b6af2ef 5.53 MiB 6.00 MiB 479.95 KiB
0a08454de39d4b0fdcdd7a6b383bbd2be12f8810 8.43 MiB 10.01 MiB 1.58 MiB
2c3bf294fddf7a3bdd37dab44455fdc4c5448cb1 5.53 MiB 6.01 MiB 488.12 KiB
f8ec07ba7fc87f2a8612688fc5c51548d06c4c82 7.86 MiB 9.44 MiB 1.58 MiB
de422e0d0a2bb05e36446b30ff52e8e5e9b0a078 5.53 MiB 6.01 MiB 488.14 KiB
e4d1bf6d5e311cffb257340e5dd7bb57fe827886 8.43 MiB 10.00 MiB 1.56 MiB
5e3ca918ef7d66ae8d5a7d159caf0aa7e817820c 8.43 MiB 10.00 MiB 1.56 MiB

github-actions[bot] avatar May 06 '25 12:05 github-actions[bot]

Will make another review pass soon

buenaflor avatar Jul 08 '25 20:07 buenaflor

@denrase pls take a look at cursor's comment I think the concern is valid since we'd be doing this for every request

buenaflor avatar Jul 22 '25 13:07 buenaflor

@buenaflor 🤦‍♂️

denrase avatar Jul 23 '25 11:07 denrase

@denrase could you have a look at cursor comments pls

buenaflor avatar Oct 09 '25 13:10 buenaflor

@buenaflor Issues should be addressed now.

denrase avatar Oct 14 '25 13:10 denrase

cloudflare has an outage so lots of tests are failing now that depend on external downloads

buenaflor avatar Nov 18 '25 15:11 buenaflor

@buenaflor Last week I created a sample project with Flutter + Subase as an evaluation. I wan't to try this out before we merge.

denrase avatar Nov 19 '25 10:11 denrase

sounds good, looks good to me now

let me know if you thinks its ready

buenaflor avatar Nov 19 '25 11:11 buenaflor

@buenaflor Ok, looking good with the sample app. The error client is being called and breadcrumbs created.

Bildschirmfoto 2025-11-19 um 13 41 38

Only thing i saw that the hub does not have a span, so we can't create one. Dunno if this is supposed to be like that? We have the same logic in other integrations.

Bildschirmfoto 2025-11-19 um 13 42 42

denrase avatar Nov 19 '25 12:11 denrase

Only thing i saw that the hub does not have a span, so we can't create one. Dunno if this is supposed to be like that? We have the same logic in other integrations.

do you have a running transaction with bindToScope = true?

buenaflor avatar Nov 19 '25 12:11 buenaflor

We discussed that this works now

buenaflor avatar Nov 20 '25 14:11 buenaflor