Forum Discussion

  • roopesh_shetty 

     

    Two things:

     

    1. You need to tell Log Analytics to collect Perf (or Linux Perf counters) that relate to a process and memory.  

     

    Log Analytics - Advanced Settings - Data - "Windows Perf Counter" then type a filter like "process(*)" to see the list

     

    2. 

    Use the Top query option, like this (sample below) which shows a Top 10 for memory kbytes

    Go to Log Analytics and run query

    Perf
    | where ObjectName == "Process"
    | where CounterName == "Used Memory kBytes"
    | summarize by CounterValue, InstanceName
    | top 10 by CounterValue desc 

     

    https://docs.microsoft.com/en-us/azure/kusto/query/topoperator 

     

    From that link you provided, you would need to change the Countername to match the one you selected in step 1  https://www.systemcenterautomation.com/2018/07/cpu-processes-azure-log-analytics/ 

     

    • Nir1311's avatar
      Nir1311
      Copper Contributor

      CliveWatson 

      riding on this post - can you combine adding memory + cpu usage per each query being running on analysis ?

      let window = AzureDiagnostics
         | where ResourceProvider == "MICROSOFT.ANALYSISSERVICES" and Resource =~ "Server Name";
      window
      | 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

       

Resources