Skip to content

Commit 17d2407

Browse files
fix(performance): Missing frames measurements when active span is trimmed (#3684)
1 parent cc9666e commit 17d2407

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
### Fixes
4343

4444
- Allow custom `sentryUrl` for Expo updates source maps uploads ([#3664](https://github.com/getsentry/sentry-react-native/pull/3664))
45+
- Missing Mobile Vitals (slow, frozen frames) when ActiveSpan (Transaction) is trimmed at the end ([#3684](https://github.com/getsentry/sentry-react-native/pull/3684))
4546

4647
## 5.19.3
4748

src/js/tracing/utils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ export function instrumentChildSpanFinish(
7878

7979
callback(span, endTimestamp);
8080
};
81+
82+
// eslint-disable-next-line @typescript-eslint/unbound-method
83+
const originalSpanEnd = span.end;
84+
85+
span.end = (endTimestamp?: number) => {
86+
originalSpanEnd.apply(span, [endTimestamp]);
87+
88+
callback(span, endTimestamp);
89+
};
8190
};
8291
}
8392
}

0 commit comments

Comments
 (0)