question

ParasNRambhiya-3423 avatar image
0 Votes"
ParasNRambhiya-3423 asked AnuragSingh-MSFT commented

Adding multiple attirbutes in Appinsights JMX metrix json file.

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSingh-MSFT avatar image
0 Votes"
AnuragSingh-MSFT answered AnuragSingh-MSFT commented

Hi @ParasNRambhiya-3423,

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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Anurag for reply, Yes i am using this, was looking if we can add multiple attributes for same object in one using some array function or so. Since adding this one by one is little bit tedious.

Thanks
Paras

0 Votes 0 ·
AnuragSingh-MSFT avatar image AnuragSingh-MSFT ParasNRambhiya-3423 ·

@ParasNRambhiya-3423, thank you for the reply.

Please Accept as answer if it helped so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·