Skip to content

Commit

Permalink
Merge pull request #131 from adobe/missingresource-2x
Browse files Browse the repository at this point in the history
feat(resources): add missingresource checkpoint behind feature toggle
  • Loading branch information
trieloff authored Apr 16, 2024
2 parents 50fb2a3 + a9ba59d commit 27ac8d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ function addLoadResourceTracking() {
.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 });
}
Expand Down

0 comments on commit 27ac8d5

Please sign in to comment.