Skip to content

Commit

Permalink
feat(resources): add missingresource checkpoint behind feature toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Mar 4, 2024
1 parent 5866158 commit 204af90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

0 comments on commit 204af90

Please sign in to comment.