Subject : Log analytics workspace - add CPU + Memory usage per each query on analysis

New Contributor

Hello , 

my goal is to retrieve from log analytics  all queries being fired against analysis server.

so that is being done with the following rows  below.


BUT my question is - how can i add per each query that is being fired - it's CPU and memory usage ?

Please advise.



let window = AzureDiagnostics
   | where ResourceProvider == "MICROSOFT.ANALYSISSERVICES" and Resource =~ "Server Name";
| where OperationName has "QueryEnd" or (OperationName has "CommandEnd" and EventSubclass_s == 38)
| where EffectiveUsername_s != "NT AUTHORITY\\SYSTEM" 
| where toint(Duration_s) > toint(5000)
| where TimeGenerated > ago(2d)
| project  EventSubclass_s,TimeGenerated,StartTime_t,EndTime_t,ServerName_s,OperationName,RootActivityId_g,TextData_s,DatabaseName_s,ApplicationName_s,Duration_s,EffectiveUsername_s,User_s
| order by StartTime_t asc




1 Reply
You're right! You won't be able to get this info from Log Analytics. What you need to do is to use Azure SQL diagnostic settings to tell you what are the most running queries and other diagnostic info.

Hope this helps!