Skip to content

Commit

Permalink
Merge pull request #217 from adobecom/methomas/404-monitoring
Browse files Browse the repository at this point in the history
MWPW-143579 Log 404s to lana
  • Loading branch information
meganthecoder authored Jul 31, 2024
2 parents a165696 + 884d235 commit e4c6652
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,10 @@ export const LIBS = setLibs(window.location);
if (document.querySelector('.faas')) {
loadStyle('/styles/faas.css');
}
const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
if (entry.responseStatus === 404) window.lana?.log(`The resource ${entry.name} returned a 404 status.`, { tags: 'errorType=error,module=resource-404' });
});
});
observer.observe({ type: 'resource', buffered: true });
}());

0 comments on commit e4c6652

Please sign in to comment.