Skip to content

Conversation

@stefanosiano
Copy link
Member

📜 Description

DefaultCompositePerformanceCollector now stops the performance data collection for timeout on data collection rather than a scheduled background job

💡 Motivation and Context

Every time a transaction run, the SDK starts collecting performance data (cpu and ram usage) and schedules a timeout job after 30 seconds to stop this data collection.

Since v 8.19.0 we have a limit on the queue of our background executor of 271 scheduled jobs. Any other scheduled job is ignored.

This means that if a transaction runs forever and the background thread queue is full, its performance data will be collected forever, leading eventually to an OOM.

More in this doc

💚 How did you test it?

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

…ollection for timeout on data collection rather than a scheduled background job
@stefanosiano stefanosiano marked this pull request as ready for review October 28, 2025 12:32
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 312.87 ms 394.38 ms 81.52 ms
Size 1.58 MiB 2.12 MiB 551.42 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ee747ae 382.73 ms 435.41 ms 52.68 ms
96449e8 361.30 ms 423.39 ms 62.09 ms
ee747ae 374.71 ms 455.18 ms 80.47 ms
3699cd5 423.60 ms 495.52 ms 71.92 ms
b3d8889 371.84 ms 447.49 ms 75.65 ms
27d7cf8 369.82 ms 422.62 ms 52.80 ms
d364ace 411.72 ms 430.81 ms 19.10 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
ce0a49e 532.00 ms 609.96 ms 77.96 ms
3998a95 415.94 ms 478.54 ms 62.60 ms

App size

Revision Plain With Sentry Diff
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
96449e8 1.58 MiB 2.11 MiB 539.35 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
3699cd5 1.58 MiB 2.10 MiB 533.45 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
ce0a49e 1.58 MiB 2.10 MiB 532.94 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB

Previous results on branch: stefanosiano/fix/performance-data-collection-timeout

Startup times

Revision Plain With Sentry Diff
77933c2 312.19 ms 353.16 ms 40.97 ms
f8c8b31 335.17 ms 436.20 ms 101.03 ms

App size

Revision Plain With Sentry Diff
77933c2 1.58 MiB 2.12 MiB 551.50 KiB
f8c8b31 1.58 MiB 2.12 MiB 551.20 KiB

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's one comment I'm not sure about

cursor[bot]

This comment was marked as outdated.

@stefanosiano
Copy link
Member Author

@romtsn last check and approval? 😄

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stefanosiano stefanosiano merged commit e70d6d4 into main Oct 29, 2025
60 of 61 checks passed
@stefanosiano stefanosiano deleted the stefanosiano/fix/performance-data-collection-timeout branch October 29, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants