Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/browser-utils/src/metrics/browserMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export function startTrackingLongAnimationFrames(): void {
*/
export function startTrackingInteractions(): void {
addPerformanceInstrumentationHandler('event', ({ entries }) => {
if (!getActiveSpan()) {
const parent = getActiveSpan();
if (!parent) {
return;
}
for (const entry of entries) {
Expand All @@ -214,10 +215,7 @@ export function startTrackingInteractions(): void {
spanOptions.attributes['ui.component_name'] = componentName;
}

const span = startInactiveSpan(spanOptions);
if (span) {
span.end(startTime + duration);
}
startAndEndSpan(parent, startTime, startTime + duration, spanOptions);
}
}
});
Expand Down
Loading