Forum Discussion

Stephen Davidson's avatar
Stephen Davidson
Copper Contributor
Aug 14, 2018

Query for Average response time based on a sub set of the Azure Subscription

First time poster and very new to ALA...

 

I have multiple sites within my Application insights resource and I want to get the Average Response time for each of the app/api's and then use them to create alerts if they go over our target SLA.  

 

Should I be using 

requests | search "https://nameofsite" to help seperate these and what query do I used to get this data?
 
Many thanks,
  • Hi Stephen, welcome aboard :)

    First I'd just note it might be easier to manage separate sites over separate Application Insights resources, that would help you monitor each site separately.

    To your question, I would suggest to create a runtime field (let's call it "domain" in this example) and then calculate the average duration for each domain. `parse` is a cool command that's meant for this kind of string parsing:

    requests
    | parse url with "https://" domain "/" *
    | summarize avg(duration) by domain

    if some of your sites start with "http" and some with "https", the parse pattern should be a bit different:

    requests
    | parse url with * "://" domain "/" *
    | summarize avg(duration) by domain

    HTH,

    Noa

Resources