Search code examples
azureazure-application-insights

Can we find out if there is an increase to number of requests to a given page?


If i have a web app in Azure, with ApplicationInsights configured, is there a way we can tell if there was an increase in the number of requests to a given page?

I know we can get the "Delta" of performance in a given time slice, compared to the previous period, but doesn't seem like we can do this for requests?

For example, i'd like to answer questions like: "what pages in the last hour had the highest % increase in requests, compared to the previous period"?

Does anyone know how to do this, or can it be done via the AppInsights query language?

Thanks!


Solution

  • Not sure whether it can be done using the Portal, I don't think so. But I came up with the following Kusto query:

    requests
    | where timestamp > ago(2h) and timestamp < ago(1h)
    | summarize previousPeriod = todouble(count()) by url
    | join (
    requests
    | where timestamp > ago(1h)
    | summarize lastHour = todouble(count()) by url
    ) on url
    | project url, previousPeriod, lastHour, change = ((lastHour - previousPeriod) / previousPeriod) * 100
    | order by change desc
    

    This is about increase/decrease of amount of traffic per url, you can change count() to for example avg(duration) to get the increase/decrease of the average duration.