Add identifier for explicit frontend error logging#11481
Conversation
changelog: Internal, Analytics, Add identifier for explicit frontend error logging
|
Overall, this looks good (even if I wish we didn't have to handroll error tracking like this, I feel like this should be easier). I have a couple of questions:
|
|
I think the answer to both your questions is that they ought to be unique per each call to But practically speaking, they can be anything. The problem this aims to address is to make it easier to work backwards from errors logged to NewRelic to the originating code. Without either a file name or identifier, all we have to work from is some cryptic error, like an |
🛠 Summary of changes
Updates frontend error logging through
trackErrorto require an identifier label.This fixes an issue where explicit calls to
trackErrorare currently not surfaced in error logging, due to changes in #8950 to filter out errors originating in scripts outside our own code. An unintended side-effect of this change is that we were ignoring our own errors.Including an
errorIdserves a dual purpose of guaranteeing that the error originates in our own code, while also providing an easy way to trace the source of the error.📜 Testing Plan
Verify that an error would be tracked to NewRelic for an error logged through
trackError.binding.pryimmediately before the call toNewRelic::Agent.notice_errorinFrontendErrorLogger(see diff below)error_idat the breakpoint shows'recaptchaExecute'