Repository navigation
feat(telemetry): Capture failing resource URL on DOM event promise rejections - #20082
sentry[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Please update the IS YOUR CHANGE URGENT? section of the PR description:
This information helps the Docs team prioritize your review. |
|
The plan checks failing-resource tags on Event errors, accepted client errors, and page-load volume. An issue escalates when Event errors continue without those tags. An issue also escalates when accepted client errors fall while page loads hold. Services: Mention PlanWhat changedUnhandled promise rejections from failed DOM resource loads now carry resource URL tags on the error event. The hook sets RiskIf Intended effectProduction errors of type Event must start carrying
Regression watchThis hook does not stop resource load failures. A new Event storm is not a regression of this change. Watch client errors that are not type Event. Watch page-load volume. A throw in
Not observableThe string HTMLLinkElement is not in current production error messages. Count was 0 in 2026-10-18T14:54:00Z to 2026-10-19T14:54:00Z. Sentry stores these failures as |
DESCRIBE YOUR PR
Problem
In Chrome, when a resource fails to load (such as a
<link>stylesheet or a script) and rejection is triggered, the promise rejection reason is a DOMEventrather than anError. This leads to Sentry events serializing merely as[object HTMLLinkElement], obscuring the actual URL of the failing asset and leaving the root cause unidentified.Solution
Adds a
beforeSendhook insrc/instrumentation-client.tsto inspect unhandled promise rejections originating from DOMEvents with anHTMLElementtarget. It extractshreforsrcattributes and tags the Sentry event withfailing_resource_urlandfailing_resource_tag, along with snippet details inextra.failing_resource_elementto make failing assets diagnosable.IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace
YYYY-MM-DDwith the due date. You can update this information later by editing the PR description.SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES