@@ -124,32 +124,31 @@ export function startTrackingLongTasks(): void {
124
124
* Start tracking long animation frames.
125
125
*/
126
126
export function startTrackingLongAnimationFrames ( ) : void {
127
- addPerformanceInstrumentationHandler ( 'long-animation-frame' , ( { entries } ) => {
128
- for ( const entry of entries ) {
129
- if ( ! getActiveSpan ( ) ) {
130
- return ;
131
- }
132
- const startTime = msToSec ( ( browserPerformanceTimeOrigin as number ) + entry . startTime ) ;
133
- const duration = msToSec ( entry . duration ) ;
134
-
135
-
136
- const span = startInactiveSpan ( {
137
- name : 'Main UI thread blocked' ,
138
- op : 'ui.long-animation-frame' ,
139
- startTime,
140
- attributes : {
141
- [ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] : 'auto.ui.browser.metrics' ,
142
- } ,
143
- } ) ;
144
- if ( span ) {
145
- span . end ( startTime + duration ) ;
146
- }
147
- }
148
- } ) ;
127
+ // NOTE: the current web-vitals version (3.5.2) does not support long-animation-frame, so
128
+ // we should directly observe `long-animation-frame` events here instead of through the web-vitals
129
+ // `observe` helper function.
130
+ // addPerformanceInstrumentationHandler('long-animation-frame', ({ entries }) => {
131
+ // for (const entry of entries) {
132
+ // if (!getActiveSpan()) {
133
+ // return;
134
+ // }
135
+ // const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);
136
+ // const duration = msToSec(entry.duration);
137
+ // const span = startInactiveSpan({
138
+ // name: 'Main UI thread blocked',
139
+ // op: 'ui.long-animation-frame',
140
+ // startTime,
141
+ // attributes: {
142
+ // [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
143
+ // },
144
+ // });
145
+ // if (span) {
146
+ // span.end(startTime + duration);
147
+ // }
148
+ // }
149
+ // });
149
150
}
150
151
151
-
152
-
153
152
/**
154
153
* Start tracking interaction events.
155
154
*/
0 commit comments