From d01ad7314eb0fadb07cb80bc798d4afc642b1432 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 18 Oct 2024 10:10:53 +0200 Subject: [PATCH] fix: do not capture entire elements in web vitals (#1483) --- src/extensions/web-vitals/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/extensions/web-vitals/index.ts b/src/extensions/web-vitals/index.ts index 706806caf..7b9bf1937 100644 --- a/src/extensions/web-vitals/index.ts +++ b/src/extensions/web-vitals/index.ts @@ -181,6 +181,14 @@ export class WebVitalsAutocapture { ? Date.now() : this.buffer.firstMetricTimestamp + if (metric.attribution && metric.attribution.interactionTargetElement) { + // we don't want to send the entire element + // they can be very large + // TODO we could run this through autocapture code so that we get elements chain info + // and can display the element in the UI + metric.attribution.interactionTargetElement = undefined + } + this.buffer.metrics.push({ ...metric, $current_url: $currentUrl,