SOLVED

Welcome to the new Azure Log Analytics community!

Deleted
Not applicable

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 .

7 Replies

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.

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.

 

 

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.

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.

 

 

best response confirmed by Stanislav Zhelyazkov (MVP)
Solution

Hi

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:

https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics#micro...

My source for that metric not available in Application insights is this:

https://stackoverflow.com/questions/47711831/can-i-see-http-queue-length-inside-azure-application-in....

 

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.

Thanks!! I can customize these queries according to my needs now!!
Great! Glad that will help you.
1 best response

Accepted Solutions
best response confirmed by Stanislav Zhelyazkov (MVP)
Solution

Hi

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:

https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics#micro...

My source for that metric not available in Application insights is this:

https://stackoverflow.com/questions/47711831/can-i-see-http-queue-length-inside-azure-application-in....

 

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.

View solution in original post