You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description/Screenshot
We are using Application Insights on our Angular 8+ applications and have been noticing that despite having enableAutoRouteTracking: true enabled that durations are being reported in the Azure Portal as either 0 seconds or the initial duration that the page took when the SPA was first loaded.
The initial data sent to the App Insights /track when our SPA is first loaded in the browser appear to make sense; however, it's the latter requests that are sent to App Insights that don't really make a lot of sense. The next requests that occur when performing routing within our Angular app appear to send two /track requests with data that includes both a duration of zero seconds and a duration of the same time for when the app was first loaded.
The following screenshot depicts the information sent with a few visual highlights:
For reference, the below image is how the data sent appears to us in the Azure Application Insights Portal. You can see that both the duration of zero and the initial page-load duration is being reported for the second page navigated (I navigated from /pages/dashboard to /pages/admin).
In this example, the data is a bit nonsensical because while the /pages/dashboard took about 7 seconds to initially load the SPA it is also showing, on average, that the /pages/admin took about half that time to load. This result is explained by the fact the app is sending both durations of zero and the 7 seconds.
Our Angular ApplicationInsights object is configured currently as the following in a singleton Angular service object. According to the Application Insights Angular Plugin's GitHub this configuration should be sufficient to handle the tracking of SPA router changes:
We expected that durations could be near-zero between page routing within the SPA app (perhaps within <300ms to accommodate DOM rendering). However, even with CPU 6x slower and Network 3G throttling in Chrome Performance the duration is always reported as zero or the initial duration that the page took to load the initial webpage.
Additional context
This issue has some similarities to the other one reported in #781; however, in this issue I'm also reporting our observation of zero durations being sent to Application Insights.
The text was updated successfully, but these errors were encountered:
For duplicate pageviews - you should NOT configure enableAutoRouteTracking to true if you are using React plugin or Angular plugin. Angular plugin is listening to the router change and triggers trackPageView here. If you also configure the auto route tracking flag, it'll cause duplicate pageviews.
Duration for initial pageview is correct as you shared, however, duration for remaining pageview should be zero. Similar to React plugin here, there is no way for us to determine the "navigation" or "presentation" time, so set to zero. I've pushed a PR to fix the bug. You could provide your own "duration" if you call manually, otherwise it's always zero.
Description/Screenshot
We are using Application Insights on our Angular 8+ applications and have been noticing that despite having
enableAutoRouteTracking: true
enabled that durations are being reported in the Azure Portal as either 0 seconds or the initial duration that the page took when the SPA was first loaded.The initial data sent to the App Insights /track when our SPA is first loaded in the browser appear to make sense; however, it's the latter requests that are sent to App Insights that don't really make a lot of sense. The next requests that occur when performing routing within our Angular app appear to send two /track requests with data that includes both a duration of zero seconds and a duration of the same time for when the app was first loaded.
The following screenshot depicts the information sent with a few visual highlights:
![issue](https://user-images.githubusercontent.com/4529091/116472960-d0835b00-a833-11eb-8555-36890f00a770.png)
Raw JSON header data sent (same as picture above)
Initial request:
Second and third /track requests sent with the following JSON:
For reference, the below image is how the data sent appears to us in the Azure Application Insights Portal. You can see that both the duration of zero and the initial page-load duration is being reported for the second page navigated (I navigated from /pages/dashboard to /pages/admin).
In this example, the data is a bit nonsensical because while the /pages/dashboard took about 7 seconds to initially load the SPA it is also showing, on average, that the /pages/admin took about half that time to load. This result is explained by the fact the app is sending both durations of zero and the 7 seconds.
Our Angular ApplicationInsights object is configured currently as the following in a singleton Angular service object. According to the Application Insights Angular Plugin's GitHub this configuration should be sufficient to handle the tracking of SPA router changes:
Steps to Reproduce
We have followed the suggestions from the official Azure Monitor documentation here.
Packages:
OS/Browser: Windows 10 x64, Chrome 89.0
Expected behavior
We expected that durations could be near-zero between page routing within the SPA app (perhaps within <300ms to accommodate DOM rendering). However, even with CPU 6x slower and Network 3G throttling in Chrome Performance the duration is always reported as zero or the initial duration that the page took to load the initial webpage.
Additional context
This issue has some similarities to the other one reported in #781; however, in this issue I'm also reporting our observation of zero durations being sent to Application Insights.
The text was updated successfully, but these errors were encountered: