getsentry / team-mobile

Meta issues for the Mobile team
4 stars 1 forks source link

Ensure correct measurements when trimming transactions #107

Open philipphofmann opened 1 year ago

philipphofmann commented 1 year ago

Idle transactions trim the end time stamp when finishing to the end time stamp of the last span. Our SDKs must ensure that all measurements they attach to the transaction are correct when trimming its end time stamp.

The Cocoa SDK, for example, wrongly sets the amount of slow and frozen frames when the idle time out times out. To fix this problem, the tracer must store all measurements when the last span finishes and use the stored measurements when trimming the transaction.

Wrong

|- transaction  -|
|-- span 1 --|
  |--- span 2 ---| 
                 | ------ idle timeout ------- |
                                               | get slow and frozen frames

Correct

|- transaction  -|
|-- span 1 --|
  |--- span 2 ---| 
                 | ------ idle timeout ------- |
                 | get slow and frozen frames

If the SDK already applies that behaviour, simply check the checkbox, otherwise please create an issue.

### Tasks
- [ ] https://github.com/getsentry/sentry-cocoa/issues/2963
- [ ] https://github.com/getsentry/sentry-java/issues/2676
- [ ] https://github.com/getsentry/sentry-dart/issues/513
- [ ] https://github.com/getsentry/sentry-react-native/issues/3015
- [ ] .NET
- [ ] Update develop
markushi commented 1 year ago

Let's have a look at this after frame-delay, as it will give us the timestamps for slow and frozen frames - which then can be used for trimming.

This also affects profiling.

marandaneto commented 1 year ago

Removing the Dart label till we figure out if we are going to implement it on native SDKs, or not at all after changing the approach. It's also possible this is automatically fixed by https://github.com/getsentry/sentry-dart/issues/513

bitsandfoxes commented 1 year ago

Removing the Unity label because it'll inherit this from .NET.