Apr 27 2020
05:32 AM
- last edited on
Apr 08 2022
10:24 AM
by
TechCommunityAP
Apr 27 2020
05:32 AM
- last edited on
Apr 08 2022
10:24 AM
by
TechCommunityAP
Hi!
I'm trying to write a query in Application Insights that returns the slowest element (buttons, fields, etc) rendering times from custom events and group these by the component/view they belong to. Some of the custom events are generated on the back end and some on the front end. The front end events contain a human-readable name of the component but the back end events do not. I want to join these so that I can display the human-readable name. My query:
Apr 27 2020 07:48 AM
Solution
I don't have any test data but in KQL, the last line maybe:
Apr 27 2020 10:23 AM
Thanks for your quick reply!
As with many things, the solution just came to me after taking a break from it for a while. Here's the solution:
customEvents
| project ComponentName = tostring(customDimensions["componentName"]), ComponentID = tostring(customDimensions["componentId"])
| where ComponentName != "" and ComponentID != ""
| distinct ComponentName, ComponentID
| join
(
customEvents
| project UpdateTime = toint(customDimensions["serverUpdateTime"]), ComponentID = tostring(customDimensions["componentId"]), Property = tostring(customDimensions["elementName"])
| where UpdateTime != 0 and ComponentID != "" and Property != ""
)
on ComponentID
| summarize avg(UpdateTime) by ComponentName, Property