question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

console errors not getting sent when using apm-agent-rum-js with angular

See original GitHub issue

Hi, 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:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
vigneshshanmugamcommented, May 30, 2022

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

i dont want to use @elastic/apm-rum-angular package

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-L40

1reaction
Suraj-Gupta-MLcommented, May 31, 2022

Thanks @vigneshshanmugam, working perfectly fine.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found