Search code examples
azureazure-application-insights

Grouping by calculated value in Visual Studio Application Insights


I am considering introducing Microsoft's Application Insights in a solution. I want to capture the duration of service requests.

When looking at the requests in the Application Insights UI, it would be nice to be able to group the result by customer size. The customer size would probably be a number between 1 and 500. Is it possible to create graphs where the service duration is grouped by intervals on the customer size?

A solution would be to define the intervals, when sending data to Application Insights, but it would be nice to be able to define (and experiment) with the intervals inside the Application Insights UI.


Solution

  • Thanks Peter for your answer. You can do couple more things to generate more insights

    1) Bin in groups of 50

    requests

    | extend organisationSize = tostring(customDimensions.OrganisationSize)

    | summarize avg(duration) by bin(organisationSize, 50), name

    | project avg_duration, name, organisationSize

    2) Generate your own buckets

    requests

    | extend organisationSize = tostring(customDimensions.OrganisationSize)

    | extend orgSizeBucket = iff(organisationSize > 500, ">500", iff(organisationSize>100, "100-500", "<100"))

    | summarize avg(duration) by orgSizeBucket, name

    | project avg_duration, name, orgSizeBucket