From 204af900ddcd58fc68ecf57593a98dddec12f36d Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Mon, 4 Mar 2024 12:20:41 +0100 Subject: [PATCH] feat(resources): add missingresource checkpoint behind feature toggle --- src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.js b/src/index.js index 6f219a2..9b7c31d 100644 --- a/src/index.js +++ b/src/index.js @@ -167,5 +167,13 @@ const observer = new PerformanceObserver((list) => { .forEach((entry) => { sampleRUM('loadresource', { source: entry.name, target: Math.round(entry.duration) }); }); + if (window.origin === 'business.adobe.com') { + // feature flagged for now + list.getEntries() + .filter((entry) => entry.responseStatus === 404) + .forEach((entry) => { + sampleRUM('missingresource', { source: entry.name, target: entry.hostname }); + }); + } }); observer.observe({ type: 'resource', buffered: true });