Adding multiple attirbutes in Appinsights JMX metrix json file.

Paras N. Rambhiya 26 Reputation points
2022-04-22T08:46:11.517+00:00

Hello Team,

How can we add multiple attributes for Jmx metrix in appinsights config.json file?

For ex: If i want to add collectioncount and collectiontime under same name, what is correct format for that.

"selfDiagnostics": {
"level": "DEBUG"
},
"jmxMetrics": [
{
"name": "Policy - GC Collection Count",
"objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
"attribute": "CollectionCount"
}

Thanks
Paras

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,014 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 21,246 Reputation points
    2022-04-26T10:03:14.657+00:00

    Hi @Paras N. Rambhiya ,

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

    I see that you are trying to collect multiple attributes for the same object through JMX metrics. For the example mentioned in the question, you will have to add 2 attributes individually in the jmxMetrics array as shown below, even though they are for the same object:

    {  
        "jmxMetrics": [  
            {  
                "name": "Policy - GC Collection Count",  
                "objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",  
                "attribute": "CollectionCount"  
            },  
            {  
                "name": "Policy - GC Collection collectiontime",  
                "objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",  
                "attribute": "CollectionTime"  
            }  
        ]  
    }  
    

    Please refer to this link for more details: Configuration example

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