feat: Add a timeout for auto-generated transactions#2535
feat: Add a timeout for auto-generated transactions#2535kevinrenskers merged 8 commits into8.0.0from
Conversation
|
|
This isn't really a user-facing feature that needs a changelog entry I guess? It's more of a safety net for Sentry. |
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0ccb7ce | 1244.24 ms | 1245.16 ms | 0.92 ms |
| 0c17d16 | 1243.92 ms | 1261.96 ms | 18.04 ms |
| f81c2c4 | 1216.88 ms | 1234.42 ms | 17.54 ms |
| 010583c | 1198.23 ms | 1225.52 ms | 27.29 ms |
| a9db8a6 | 1199.83 ms | 1234.56 ms | 34.73 ms |
| 17e2418 | 1245.59 ms | 1255.52 ms | 9.93 ms |
| a8ac44f | 1198.63 ms | 1231.08 ms | 32.45 ms |
| 9be1db2 | 1219.42 ms | 1245.66 ms | 26.24 ms |
| 57e140e | 1223.94 ms | 1252.50 ms | 28.56 ms |
| d914052 | 1236.52 ms | 1251.56 ms | 15.04 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0ccb7ce | 20.75 KiB | 405.10 KiB | 384.34 KiB |
| 0c17d16 | 20.75 KiB | 405.06 KiB | 384.30 KiB |
| f81c2c4 | 20.75 KiB | 402.12 KiB | 381.36 KiB |
| 010583c | 20.75 KiB | 383.61 KiB | 362.85 KiB |
| a9db8a6 | 20.75 KiB | 383.37 KiB | 362.62 KiB |
| 17e2418 | 20.75 KiB | 402.06 KiB | 381.31 KiB |
| a8ac44f | 20.75 KiB | 405.17 KiB | 384.41 KiB |
| 9be1db2 | 20.75 KiB | 373.94 KiB | 353.19 KiB |
| 57e140e | 20.75 KiB | 383.61 KiB | 362.85 KiB |
| d914052 | 20.75 KiB | 383.89 KiB | 363.13 KiB |
Previous results on branch: feat/1173-timeout-transactions
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 514632f | 1246.86 ms | 1266.40 ms | 19.54 ms |
| 6d8af96 | 1221.88 ms | 1231.51 ms | 9.63 ms |
| ae95eaf | 1236.18 ms | 1243.68 ms | 7.50 ms |
| b7e394e | 1221.86 ms | 1232.43 ms | 10.57 ms |
| 3ea4407 | 1236.16 ms | 1252.50 ms | 16.34 ms |
| 1a5aac6 | 1200.74 ms | 1225.92 ms | 25.18 ms |
| ba761fd | 1203.73 ms | 1224.46 ms | 20.73 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 514632f | 20.75 KiB | 403.14 KiB | 382.38 KiB |
| 6d8af96 | 20.75 KiB | 403.23 KiB | 382.48 KiB |
| ae95eaf | 20.75 KiB | 405.15 KiB | 384.40 KiB |
| b7e394e | 20.75 KiB | 403.24 KiB | 382.48 KiB |
| 3ea4407 | 20.75 KiB | 403.14 KiB | 382.38 KiB |
| 1a5aac6 | 20.75 KiB | 402.65 KiB | 381.89 KiB |
| ba761fd | 20.75 KiB | 405.15 KiB | 384.40 KiB |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 8.0.0 #2535 +/- ##
==========================================
+ Coverage 78.81% 79.06% +0.25%
==========================================
Files 241 244 +3
Lines 22144 22305 +161
Branches 9783 9858 +75
==========================================
+ Hits 17453 17636 +183
+ Misses 4245 4218 -27
- Partials 446 451 +5
Continue to review full report at Codecov.
|
* 8.0.0: feat: support SENTRY_DSN environment var on macOS (#2534)
|
Can I get a review? |
philipphofmann
left a comment
There was a problem hiding this comment.
Thanks for taking care of this, @kevinrenskers, and sorry for the late review.
Sources/Sentry/SentryTracer.m
Outdated
| self.deadlineTimer = [self.timerWrapper | ||
| scheduledTimerWithTimeInterval:SENTRY_AUTO_TRANSACTION_DEADLINE | ||
| repeats:NO | ||
| block:^(NSTimer *_Nonnull timer) { [self deadlineTimerFired]; }]; |
There was a problem hiding this comment.
Please use a weak reference to self here. Also add a test for that, please. It can be similar to
sentry-cocoa/Tests/SentryTests/Helper/SentryFileManagerTests.swift
Lines 175 to 189 in 1a18683
There was a problem hiding this comment.
I've used a weak reference, but I don't know how you would want to add a test for that, the code you linked to doesn't really help as something similar doesn't work for the SentryTracer test case.
|
Happy new year y'all! |
|
Happy new year to you, too, @kevinrenskers 😀. I just gave this another pass. LGTM 🙏 Thank you for following up on this one. |
We missed adding #2535 to the Changelog of 8.0.0.
We missed adding #2535 to the Changelog of 8.0.0.
📜 Description
When we start the transaction we start a timer of 30 seconds, for auto generated transactions. When the timer reaches 0 then we mark the transaction and the unfinished child spans as
deadline_exceededand finish the transaction.#skip-changelog
💡 Motivation and Context
Closes #1173
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps