Have you ever wanted to monitor or set up alerts for Service Fabric applications and its services when it crosses certain threshold in terms of memory or CPU utilization? Then this blog will help you set up performance counters for Service Fabric services and further you can set up alerts based on trigger condition.
Then you can use the Log Analytics Workspace ID and key to install OMS extension on all the VM scale sets part of the SF cluster, you can use resource explorer (https://resources.azure.com) to do this change:
Do a PATCH operation using above details on the VMSS:
After PATCH, wait for the VMSS extension update to complete. After the extension is successfully provisioned, you start seeing all the VMs (part of VMSS) in connected agent blade of the log analytics workspace.
After you see the VMs in connected state, you can go Agents Configuration blade of log analytics workspace to indicate which counters you would like the OMS Agent to collect for example below:
Above shown counters are few sample counters; you can add counters based on your requirement.
After the counters are added, wait for few minutes for counters data to get collected, you can then go to Logs blade of log analytics workspace, there you’ll see Perf table which will have data of configured counters.
You can then use different query and can set an alert based on your query on it like below
A service fabric application consists of multiple services, those services run as a process inside the VM, with these performance counters, you can see memory and CPU utilization of each process per node.
Few examples query:
If you would like to know the memory (Working Set) of an individual process per node, you can use query: