SOLVED

Getting memory consumption per process in a VM

%3CLINGO-SUB%20id%3D%22lingo-sub-1499161%22%20slang%3D%22en-US%22%3EGetting%20memory%20consumption%20per%20process%20in%20a%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499161%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%20Is%20there%20a%20way%20to%20get%20memory%20consumption%20per%20process%20exported%20to%20log%20analytics%20workspace%3F%20Probably%20the%20easiest%20way%20would%20be%20to%20log%20on%20to%20the%20VM%20but%20sometimes%20this%20is%20not%20possible%20and%20instead%20of%20just%20seeing%20we%20are%20out%20of%20memory%20would%20be%20nice%20to%20see%20what%20is%20actually%20eating%20up%20the%20memory.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20believe%20Rahul%20pointed%20to%20me%2C%20that%26nbsp%3B%3CSPAN%3EI%20would%20need%20to%20enable%20process%20level%20perf%20counters%20from%20my%20workspace%2C%20to%20collect%20this%20data%20but%20i'm%20not%20100%25%20sure%20on%20how%20%3A)%3C%2Fimg%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1499161%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELog%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Evm%20insights%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499201%22%20slang%3D%22en-US%22%3ERe%3A%20Getting%20memory%20consumption%20per%20process%20in%20a%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499201%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F424832%22%20target%3D%22_blank%22%3E%40Juval%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20don't%20collect%20process%20performance%20counters%26nbsp%3Bout%20of%20the%20box%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20the%20agent%20to%20configure%20to%20collect%20process%20performance%20counters%20as%20Rahul%20said.%26nbsp%3B%20Here%20is%20the%20link%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fdata-sources-performance-counters%23configuring-performance-counters%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fdata-sources-performance-counters%23configuring-performance-counters%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eregards%3C%2FP%3E%0A%3CP%3E-ketan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499229%22%20slang%3D%22en-US%22%3ERe%3A%20Getting%20memory%20consumption%20per%20process%20in%20a%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499229%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F424832%22%20target%3D%22_blank%22%3E%40Juval%3C%2FA%3E%26nbsp%3BHi%20to%20enable%20performance%20counters%2C%20events%20from%20event%20viewer%20etcs...%20you%20need%20to%20go%20to%20log%20analytics%20workspace%20that%20you%20are%20using%2C%20and%20enable%20what%20you%20need%20in%20advance%20settings.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22loadedlouie27_1-1593535416688.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202212iDC9C210A5BD452FB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22loadedlouie27_1-1593535416688.png%22%20alt%3D%22loadedlouie27_1-1593535416688.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAftear%20this%20you%20have%20to%20select%20what%20you%20need%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22loadedlouie27_2-1593535532229.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202214i7D61CE66C184B068%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22loadedlouie27_2-1593535532229.png%22%20alt%3D%22loadedlouie27_2-1593535532229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps%2C%20you%20can%20also%20use%20this%26nbsp%3B%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpt-pt%2Fazure%2Fazure-monitor%2Fplatform%2Fdata-sources-performance-counters%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fpt-pt%2Fazure%2Fazure-monitor%2Fplatform%2Fdata-sources-performance-counters%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20it%20helps%20it%20took%20me%20a%20while%20to%20understand%20what%20was%20needed.%26nbsp%3B%3C%2FP%3E%3CP%3E%3A)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EJust%20a%20side%20note%20keep%20tracking%20of%20what%20you%20enable%2C%20because%20log%20analytics%20is%20payed%20by%20ingestion...%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20take%20a%20look%20at%20your%20ingestion%20and%20cost%2C%20in%20the%20%22usage%20and%20Cost%22%20on%20the%20log%20analytics%20workspace.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20it%20helps.%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Regards.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499303%22%20slang%3D%22en-US%22%3ERe%3A%20Getting%20memory%20consumption%20per%20process%20in%20a%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499303%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714167%22%20target%3D%22_blank%22%3E%40loadedlouie27%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EHi%20thanks%20for%20the%20pics%20and%20guidance!%20I%20appreciate%20all%20the%20help%20i%20can%20get%20so%20thank%20you!%20Yeah%20need%20to%20be%20careful%20i%20guess%20so%20in%20that%20sense%20it%20would%20be%20nice%20if%20i%20could%20just%20enable%20on%20a%20problematic%20VM%20and%20not%20all%20of%20the%20VMs.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499361%22%20slang%3D%22en-US%22%3ERe%3A%20Getting%20memory%20consumption%20per%20process%20in%20a%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499361%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F424832%22%20target%3D%22_blank%22%3E%40Juval%3C%2FA%3E%26nbsp%3BYou%20can%20actually...%26nbsp%3B%3C%2FP%3E%3CP%3Eit%20took%20me%20a%20while%20to%20understand%2C%20but%20basically%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22loadedlouie27_0-1593537266941.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202221i81601852507DEFF8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22loadedlouie27_0-1593537266941.png%22%20alt%3D%22loadedlouie27_0-1593537266941.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewhen%20you%20add%20this%20counter%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3EProcessor(*)%5C%25%20Processor%20Time%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20collecting%20for%20all%20the%20VM's%2C%20but%20if%20you%20putt%20it%20like%20this%3A%26nbsp%3B%3C%2FP%3E%3CP%3EProcessor(YOURVMNAME)%5C%25%20Processor%20Time%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20will%20only%20collect%20the%20VM%20you%20specified.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EDon't%20ask%20me%20multiple%20VM's%20how-to%2C%20because%20I%20don't%20know%20but%20I'm%20guessing%20one%20line%20for%20each%20VM.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3A)%3C%2Fimg%3E%20hope%20it%20helps.%3C%2FP%3E%3CP%3EHit%20That%20Like%20%3AD%3C%2Fimg%3E%20loool%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi! Is there a way to get memory consumption per process exported to log analytics workspace? Probably the easiest way would be to log on to the VM but sometimes this is not possible and instead of just seeing we are out of memory would be nice to see what is actually eating up the memory.

I believe Rahul pointed to me, that I would need to enable process level perf counters from my workspace, to collect this data but i'm not 100% sure on how :)

4 Replies
best response confirmed by Juval (Occasional Contributor)
Solution

@Juval 

We don't collect process performance counters out of the box 

You can configure the agent to configure to collect process performance counters as Rahul said.  Here is the link - https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-performance-counters#conf...

 

regards

-ketan

@Juval Hi to enable performance counters, events from event viewer etcs... you need to go to log analytics workspace that you are using, and enable what you need in advance settings. 

 

loadedlouie27_1-1593535416688.png

Aftear this you have to select what you need : 

 

loadedlouie27_2-1593535532229.png

 

Hope this helps, you can also use this  : 

 

https://docs.microsoft.com/pt-pt/azure/azure-monitor/platform/data-sources-performance-counters 

 

Hope it helps it took me a while to understand what was needed. 

:) 


Just a side note keep tracking of what you enable, because log analytics is payed by ingestion... 

You can take a look at your ingestion and cost, in the "usage and Cost" on the log analytics workspace. 

 

Hope it helps. 

Best Regards. 

 

 

 

@loadedlouie27 


Hi thanks for the pics and guidance! I appreciate all the help i can get so thank you! Yeah need to be careful i guess so in that sense it would be nice if i could just enable on a problematic VM and not all of the VMs.

@Juval You can actually... 

it took me a while to understand, but basically 

loadedlouie27_0-1593537266941.png

when you add this counter : 

Processor(*)\% Processor Time

 

Your collecting for all the VM's, but if you putt it like this: 

Processor(YOURVMNAME)\% Processor Time

 

It will only collect the VM you specified. 


Don't ask me multiple VM's how-to, because I don't know but I'm guessing one line for each VM. 

 

:) hope it helps.

Hit That Like :D loool