Reputation: 73123
Does anyone know why the 'Average response time' metric in Azure monitor doesn't always match up to the Application Insights response time?
It it because of sampling?
For example, here's some stats i pulled from my Azure App Service:
..and the corresponding stats in AppInsights:
So the bumps are there.. but the difference is huge.
Is there a difference? If so, what are they? I haven't been able to find documentation anywhere.
Thanks.
Upvotes: 3
Views: 3149
Reputation: 3511
Both Azure Monitoring and Application Insights define these metrics as how long it takes your app to respond to requests. Dmitry correctly noted that the difference is primarily because of what piece of the process the service is monitoring. Azure Monitoring is gathering statistings on the web server as a whole. That's why it is reporting on CPU and memory usage in addition to response times. On the other hand, Application Insights is built into your code, so it can only tell you how long your code took to run. It doesn't know how much of the CPU you are using, but it can tell you things about your code, like how long a database call took. For this reason I would expect the app service to report a higher number than App Insights.
Sampling probably won't have a significant impact on the difference- at the very least you wouldn't expect that difference to be so consistant over time. One thing that can definitely have an impact is if you have multiple apps on the same app service. Azure Monitor is looking at all the apps on the service, whereas Application Insights is only looking at that one app.
Upvotes: 3