Closed
Description
Hey, I installed the new unified Sentry SDK in my Angular 7 project, and everything was working as expected, after a few days I noticed that the application performance had reduced, I tried to debug it and found that when I initialise the Sentry SDK, angular starts running change detection at an interval of few ms and it doesn't stop. I think there might be some asynchronous event that is getting captured inside Angular zone. Below are the details to reproduce this issue.
Inside your app module add the following code
export class AppModule {
constructor(applicationRef: ApplicationRef) {
//Angular change detection is run inside applicationRef.tick
//method. We are overriding this to log whenever change detection
//happens.
const originalTick = applicationRef.tick;
applicationRef.tick = function() {
const before = performance.now();
originalTick.apply(this, arguments);
const after = performance.now();
console.log("CHANGE DETECTION:", after - before);
return originalTick;
}
//Initialise Sentry with your DSN
Sentry.init({
dsn: __YOUR_SENTRY_DSN__
});
}
You can check the logs before and after commenting Sentry init part.
This has a lot of impact on our application's performance.
Please note that this issue didn't occur in the deprecated raven-js library.
Metadata
Metadata
Assignees
Labels
No labels