jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

Append attribute and/or compositeData key name to the resultAlias #39

Closed maheshkelkar closed 8 years ago

maheshkelkar commented 9 years ago

The following query exports all the attributes of the given objectName: <query objectName="java.lang:type=Memory" resultAlias="my.localmachine"/>

This query, generates the following output:

my.localmachine false 1432740403
my.localmachine 0 1432740403
my.localmachine 257425408 1432740403
my.localmachine 268435456 1432740403
my.localmachine 3817865216 1432740403
my.localmachine 79592824 1432740403
my.localmachine 50003968 1432740403
my.localmachine 24576000 1432740403
my.localmachine 136314880 1432740403
my.localmachine 49349944 1432740403
my.localmachine java.lang:type=Memory 1432740403

It uses the resultAlias for all the exported attributes, which makes it impossible to distinguish:

Instead the jmxtrans-agent should append the attribute and compositeDataKey (if applicable) to the resultName to make it self-explanatory. E.g. :

my.localmachine.Verbose false 1432742044
my.localmachine.ObjectPendingFinalizationCount 0 1432742044
my.localmachine.HeapMemoryUsage.committed 257425408 1432742044
my.localmachine.HeapMemoryUsage.init 268435456 1432742044
my.localmachine.HeapMemoryUsage.max 3817865216 1432742044
my.localmachine.HeapMemoryUsage.used 79746712 1432742044
my.localmachine.NonHeapMemoryUsage.committed 50003968 1432742044
my.localmachine.NonHeapMemoryUsage.init 24576000 1432742044
my.localmachine.NonHeapMemoryUsage.max 136314880 1432742044
my.localmachine.NonHeapMemoryUsage.used 49385432 1432742044
my.localmachine.ObjectName java.lang:type=Memory 1432742044

Yes. The expressionLanguageEngine is available, but it does not allow us to add attribute or compositeData key to the resultName. It simple enhances the existing resultAlias.

Sponsored by: Lookout, Inc.

maheshkelkar commented 9 years ago

Closed in error

kerlandsson commented 8 years ago

I'm closing this, as I understand, this behavior is now supported by providing resultAliases such as my.localmachine.#attribute#.#key#