SOLVED

Welcome to the new Azure Log Analytics community!

%3CLINGO-SUB%20id%3D%22lingo-sub-149885%22%20slang%3D%22en-US%22%3EWelcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-149885%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3ECan%20you%20please%20help%20me%20out%20with%20an%20analytics%20query%20for%20Long%20running%20HTTP%20queue%20request%26nbsp%3B%2C%20availability%20result%20and%20slow%20response%20for%20app%20services%20and%20insights%20.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-149885%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150641%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150641%22%20slang%3D%22en-US%22%3EGreat!%20Glad%20that%20will%20help%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150639%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150639%22%20slang%3D%22en-US%22%3EThanks!!%20I%20can%20customize%20these%20queries%20according%20to%20my%20needs%20now!!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150192%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150192%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3ESpecifically%20for%20Http%20Queue%20Length%20seems%20that%20metric%20is%20not%20available%20in%20Application%20Insights%20itself.%20That%20metric%20is%20part%20of%20the%20metrics%20that%20Azure%20App%20service%20offers%20for%20web%20apps.%20Such%20metrics%20can%20be%20send%20to%20Azure%20Storage%2C%20Log%20Analytics%20workspace%20or%20Event%20Hub.%20If%20you%20configure%20your%20web%20app%20to%20send%20these%20metrics%20to%20Log%20Analytics%20workspace%20in%20the%20workspace%20itself%20these%20metrics%20will%20appear%20in%20'AzureMetrics'%20table.%20Once%20there%20you%20can%20execute%20query%20like%20the%20one%20below%20to%20calculate%20the%20average%20Http%20Queue%20length%20for%20each%20web%20app%3A%3C%2FP%3E%0A%3CPRE%3EAzureMetrics%20%7C%20where%20MetricName%20%3D%3D%20%22HttpQueueLength%22%20%20%7C%20summarize%20avg(Average)%20by%20Resource%20%3C%2FPRE%3E%0A%3CP%3EMore%20info%20about%20the%20Azure%20Metrics%20for%20Web%20apps%20you%20can%20find%20here%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmonitoring-and-diagnostics%2Fmonitoring-supported-metrics%23microsoftwebserverfarms%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmonitoring-and-diagnostics%2Fmonitoring-supported-metrics%23microsoftwebserverfarms%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EMy%20source%20for%20that%20metric%20not%20available%20in%20Application%20insights%20is%20this%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F47711831%2Fcan-i-see-http-queue-length-inside-azure-application-insight%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F47711831%2Fcan-i-see-http-queue-length-inside-azure-application-insight%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20Availability%3A%20Application%20Insights%20tracks%20availability%20with%20web%20tests.%20The%20results%20of%20these%20web%20tests%20are%20stored%20in%20Applications%20Insights%20in%20table%20'%3CSPAN%3EavailabilityResults'.%20The%20below%20query%20can%20be%20used%20to%20track%20availability%20per%20web%20test%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3EavailabilityResults%20%0A%20%20%20%20%7C%20where%20timestamp%20%26gt%3B%3D%20ago(30d)%0A%20%20%20%20%7C%20summarize%20AvailabilityPercentage%3D(sum(todouble(success))%20%2F%20count(success))%20*%20100%2C%20Failures%3Dcount(success)-sum(todouble(success))%2C%20TotalTests%3Dcount(success)%20by%20TestName%3Dname%0A%7C%20order%20by%20Failures%20asc%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3EThe%20source%20of%20the%20query%3A%20%3CA%20href%3D%22https%3A%2F%2Fgist.github.com%2Fbrlinton%2F2b54cdaa77d1247b8b9c1d7b99eb14e9%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgist.github.com%2Fbrlinton%2F2b54cdaa77d1247b8b9c1d7b99eb14e9%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFor%20slow%20response%20it%20is%20not%20quite%20clear%20what%20you%20mean%20by%20slow%20response%20exactly%20but%20Application%20Insights%20tracks%20http%20request%20duration.%20That%20information%20is%20stored%20in%20%22requests%22%20table.%20You%20can%20track%20the%20request%20duration%20in%20percentile%2050%2C%2090%20and%2095%20in%201%20hour%20interval%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3Erequests%0A%7C%20where%20%20timestamp%20%26gt%3B%20ago(24h)%0A%7C%20summarize%20percentiles(duration%2C%2050%2C%2090%2C%2095)%20by%20bin(timestamp%2C%201h)%0A%7C%20render%20timechart%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%3EI%20will%20mark%20this%20reply%20as%20best%20response%20but%20let%20me%20know%20if%20something%20is%20not%20what%20you%20are%20looking%20for.%20In%20such%20case%20please%20give%20us%20a%20little%20more%20details%20what%20metrics%20you%20have%20in%20mind%20and%20what%20you%20are%20trying%20to%20achieve%20otherwise%20I%20am%20just%20making%20guesses.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150170%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150170%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EYes%2C%20It%20is%26nbsp%3B%3CSPAN%3Eabout%20monitoring%20Azure%20web%20app%20with%20Application%20Insights.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWell%20here%20is%20a%20screenshot%20of%20the%20alert%20that%20is%20configured%20in%20app%20services%20-%26gt%3B%20alerts.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150169%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150169%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EMore%20details%20are%20needed.%20In%20which%20logs%20is%20the%20data%20you%20want%20to%20query%20located%3F%20Is%20this%20about%20monitoring%20Azure%20web%20app%20with%20Application%20Insights%3F%20Application%20Insights%20and%20Log%20Analytics%20share%20common%20ground%20of%20features%20and%20technologies%20but%20they%20are%20different%20services%20so%20it%20is%20important%20to%20know%20your%20context.%20Give%20as%20much%20details%20as%20you%20can.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150168%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150168%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EI%20want%20to%20query%20out%20the%20data%20for%20all%20the%20long%20running%20HTTP%20queues%20(Requests%20which%20have%20not%20been%20acknowledged)%20requests%20for%20an%20app%20service%20and%20slow%20response%20(server%20is%20taking%20more%20time%20to%20respond%20for%20the%20request%20say%20like%2030%20sec).%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20above%20details%20are%20still%20not%20enough%2C%20then%20please%20do%20let%20me%20know%20what%20exactly%20needs%20to%20be%20provided%20from%20my%20end.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150167%22%20slang%3D%22en-US%22%3ERe%3A%20Welcome%20to%20the%20new%20Azure%20Log%20Analytics%20community!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150167%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EPlease%20provide%20some%20details%20on%20your%20request.%20You%20do%20not%20mention%20what%20you%20want%20actually%20to%20achieve%20or%20from%20which%20data%20you%20want%20to%20achieve%20it%20from.%20Log%20Analytics%20has%20a%20lot%20of%20different%20tables%20for%20storing%20data%20including%20custom%20ones%20that%20can%20be%20from%20any%20log.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted

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.

Highlighted

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.

 

 

Highlighted

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.

Highlighted

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.

 

 

Highlighted
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.

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