Can we monitor Heap Memory of Java application installed on Azure Vm's using Azure Monitor

Paras N. Rambhiya 26 Reputation points
2022-03-30T12:34:41.493+00:00

Hello Team,
Is it possible to monitor heap memory of java application deployed on Azure Vm's . We have application insights available/tagged on the machine. I have added below metrics in applicationinsights.json file. But I couldn't see the metrics. Can you please let us know how to move ahead.

"jmxMetrics": [
{
"name": "JVM uptime (millis)",
"objectName": "java.lang:type=MemoryPool",name=Tenured Gen",
"attribute": "Usage.used"
},
{
"name": "Heap Used",
"objectName": "java.lang:type=Memory",
"attribute": "HeapMemoryUsage.used"
}

]

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,546 Reputation points Moderator
    2022-03-31T10:02:32.507+00:00

    Hi @Paras N. Rambhiya

    Welcome to Microsoft Q&A! Thanks for posting the question.

    I understand that you are trying to measure heap related memory utilization by JVM. I would recommend referring this this doc for relevant information - Configuring JMX metrics

    To Summarize, Application Insights Java 3.x collects some of the JMX metrics by default. If the default ones are not enough, you can collect additional metrics by configuring the jmxMetrics section to the applicationinsights.json file. Please note that, to be able to update the jmxMetrics section, you must know the object names and the attributes, those properties are different for various libraries, frameworks, and application servers, and are often not well documented. To be able to view the available metrics, et the self-diagnostics level to DEBUG in your applicationinsights.json configuration file. This would give you all the available JMX metrics, with object names and attribute names in the application insights log file, which can be used to update the jmxMetrics section to the applicationinsights.json file.

    The following link has the complete information in this regards: Configuring JMX metrics.

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.