Jan 29 2018
07:35 AM
- last edited on
Apr 07 2022
04:52 PM
by
TechCommunityAP
Jan 29 2018
07:35 AM
- last edited on
Apr 07 2022
04:52 PM
by
TechCommunityAP
Can you please help me out with an analytics query for Long running HTTP queue request , availability result and slow response for app services and insights .
Jan 30 2018 12:01 AM
Hi
Please provide some details on your request. You do not mention what you want actually to achieve or from which data you want to achieve it from. Log Analytics has a lot of different tables for storing data including custom ones that can be from any log.
Jan 30 2018 12:11 AM
Hi
I want to query out the data for all the long running HTTP queues (Requests which have not been acknowledged) requests for an app service and slow response (server is taking more time to respond for the request say like 30 sec).
If the above details are still not enough, then please do let me know what exactly needs to be provided from my end.
Jan 30 2018 12:15 AM
Hi
More details are needed. In which logs is the data you want to query located? Is this about monitoring Azure web app with Application Insights? Application Insights and Log Analytics share common ground of features and technologies but they are different services so it is important to know your context. Give as much details as you can.
Jan 30 2018 12:27 AM
Hi,
Yes, It is about monitoring Azure web app with Application Insights.
Well here is a screenshot of the alert that is configured in app services -> alerts.
Jan 30 2018 02:05 AM
SolutionHi
Specifically for Http Queue Length seems that metric is not available in Application Insights itself. That metric is part of the metrics that Azure App service offers for web apps. Such metrics can be send to Azure Storage, Log Analytics workspace or Event Hub. If you configure your web app to send these metrics to Log Analytics workspace in the workspace itself these metrics will appear in 'AzureMetrics' table. Once there you can execute query like the one below to calculate the average Http Queue length for each web app:
AzureMetrics | where MetricName == "HttpQueueLength" | summarize avg(Average) by Resource
More info about the Azure Metrics for Web apps you can find here:
My source for that metric not available in Application insights is this:
For Availability: Application Insights tracks availability with web tests. The results of these web tests are stored in Applications Insights in table 'availabilityResults'. The below query can be used to track availability per web test:
availabilityResults | where timestamp >= ago(30d) | summarize AvailabilityPercentage=(sum(todouble(success)) / count(success)) * 100, Failures=count(success)-sum(todouble(success)), TotalTests=count(success) by TestName=name | order by Failures asc
The source of the query: https://gist.github.com/brlinton/2b54cdaa77d1247b8b9c1d7b99eb14e9
For slow response it is not quite clear what you mean by slow response exactly but Application Insights tracks http request duration. That information is stored in "requests" table. You can track the request duration in percentile 50, 90 and 95 in 1 hour interval:
requests | where timestamp > ago(24h) | summarize percentiles(duration, 50, 90, 95) by bin(timestamp, 1h) | render timechart
I will mark this reply as best response but let me know if something is not what you are looking for. In such case please give us a little more details what metrics you have in mind and what you are trying to achieve otherwise I am just making guesses.
Jan 30 2018 10:54 PM
Jan 30 2018 11:04 PM
Jan 30 2018 02:05 AM
SolutionHi
Specifically for Http Queue Length seems that metric is not available in Application Insights itself. That metric is part of the metrics that Azure App service offers for web apps. Such metrics can be send to Azure Storage, Log Analytics workspace or Event Hub. If you configure your web app to send these metrics to Log Analytics workspace in the workspace itself these metrics will appear in 'AzureMetrics' table. Once there you can execute query like the one below to calculate the average Http Queue length for each web app:
AzureMetrics | where MetricName == "HttpQueueLength" | summarize avg(Average) by Resource
More info about the Azure Metrics for Web apps you can find here:
My source for that metric not available in Application insights is this:
For Availability: Application Insights tracks availability with web tests. The results of these web tests are stored in Applications Insights in table 'availabilityResults'. The below query can be used to track availability per web test:
availabilityResults | where timestamp >= ago(30d) | summarize AvailabilityPercentage=(sum(todouble(success)) / count(success)) * 100, Failures=count(success)-sum(todouble(success)), TotalTests=count(success) by TestName=name | order by Failures asc
The source of the query: https://gist.github.com/brlinton/2b54cdaa77d1247b8b9c1d7b99eb14e9
For slow response it is not quite clear what you mean by slow response exactly but Application Insights tracks http request duration. That information is stored in "requests" table. You can track the request duration in percentile 50, 90 and 95 in 1 hour interval:
requests | where timestamp > ago(24h) | summarize percentiles(duration, 50, 90, 95) by bin(timestamp, 1h) | render timechart
I will mark this reply as best response but let me know if something is not what you are looking for. In such case please give us a little more details what metrics you have in mind and what you are trying to achieve otherwise I am just making guesses.