Search code examples
azure-application-insights

Hourly average usage in Azure Application Insights


I can get Application Insights to display a running hourly log of usage, but is there a way to display average usage on an hourly basis to see what times of the day a site is must used?


Solution

  • on the overview blade your resource, isn't there a metrics explorer that shows exactly that? the last 24 hours by hour? if that isn't what you mean, you could make an analytics query to get whatever you want, something like

    requests 
    | where timestamp > ago(7d) 
    | extend hour = datetime_part("hour", timestamp)
    | summarize sum(itemCount)/7 by hour
    | order by hour asc
    | render barchart
    

    which would show you requests over the last 7 days split by each of the 24 hours, divided by 7 to show you average per day.

    if you just want "today's" version of that its even simpler:

    requests
    | where timestamp > ago(1d) 
    | summarize sum(itemCount) by bin(timestamp, 1h)
    | render timechart
    

    anything you can query in the analytics website you can then pin as a tile on your azure dashboard.