console errors not getting sent when using apm-agent-rum-js with angular
See original GitHub issueHi, i have created a custom js library using this apm-agent-rum-js
, while running the directly in the library errors are getting captured and event is sent.
But same library if i use in angular app, http requests works but the console errors wont work as it doesnt sends a event.
i dont want to use @elastic/apm-rum-angular package
Thanks ! Any help would be appreciated
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Angular not working but not posting any errors to the console
I have a pretty basic Angular app. When I try to run it in the browser, the page is blank. But no errors...
Read more >Angular integration | APM Real User Monitoring ... - Elastic
This document covers how to use Real User Monitoring JavaScript agent with Angular applications. Supported versionsedit. This integration supports Angular ...
Read more >Errors List - Angular
Errors Listlink · NG0100: Expression Changed After Checked · NG01003: Wrong Async Validator Return Type · NG01203: Missing value accessor · NG0200: Circular ......
Read more >Intercept Errors with Angular ErrorHandler - Level Up Coding
This error in the console doesn't help us much as long as it doesn't reach us. The user will probably not send it...
Read more >Monitor JavaScript Console Logs and User Activity ... - Datadog
But if you're not tracking client-side errors and events to get visibility ... Once you're using Datadog's JavaScript logging library to add ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By default, when an error is thrown inside the Angular application, the default error handler prints the error messages to the console without rethrowing them as browser events which is why RUM agent will not be able to capture those errors and report it.
Details here - https://www.elastic.co/guide/en/apm/agent/rum-js/current/angular-integration.html#_capturing_errors_in_angular_applications
If you dont want to use the Angular package, you need to extend the Angular
ErrorHandler
class and add handle the error and report it to the APM server. See example code here - https://github.com/elastic/apm-agent-rum-js/blob/9bb158c22d0ae1f6ef6ea1679930c79814b60dcf/packages/rum-angular/src/error-handler.ts#L31-L40Thanks @vigneshshanmugam, working perfectly fine.