Telegraf Jolokia metric name

Hi All,

I am trying to upgrade telegraf from 0.12 to 1.1.2. I am using telegraf to read metrics from jolokia to store it in influxdb. Earlier version used jmx with different format to write data. Newer version uses mbean and attribute combination. When I try to store the metric in the same name as before like the below one, it is not working. Please advise as how to preserve the metric so that it is not affecting our graphs.

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage_committed"
mbean = “java.lang:type=Memory/HeapMemoryUsage/committed”

or

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage_committed"
mbean = "java.lang:type=Memory/HeapMemoryUsage"
attribute = “committed”

or

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage"
mbean = "java.lang:type=Memory/HeapMemoryUsage"
attribute = “init, used, max, committed”

Either of the above is not working. Please let me know what am I missing here?

Regards
Karthik

You will need to use a different name for each metric, but you can combine them in the query.

Let me try to explain. For example, In the earlier version I used HeapMemoryUsage_committed to capture HeapMemoryUsage Committed metric. But in the newer version, it uses the combination of Name, HeapMemoryUsage/attribute and path like heap_memory_usage_HeapMemoryUsage_committed. If I do not use the name then it stores as _HeapMemoryUsage_committed. If I use the below configuration, it is not even storing the metric:
I understand init, used, max, committed are path but I tried it.

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage_committed"
mbean = “java.lang:type=Memory/HeapMemoryUsage/committed”

or

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage_committed"
mbean = "java.lang:type=Memory/HeapMemoryUsage"
attribute = “committed”

or

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage"
mbean = "java.lang:type=Memory/HeapMemoryUsage"
attribute = “init, used, max, committed”

Any help is appreciated to store the metric as HeapMemoryUsage_committed.

What is the final measurement name if you have this?

[[inputs.jolokia]]
  delimiter = "_"
  [[inputs.jolokia.metrics]]
    name = "HeapMemoryUsage"
    mbean = "java.lang:type=Memory/HeapMemoryUsage"
    attribute = "committed"

Data was not stored or not reaching the influxdb.

[[inputs.jolokia]]
delimiter = “_”
[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage"
mbean = "java.lang:type=Memory/HeapMemoryUsage"
attribute = “committed”

No data/column

[[inputs.jolokia]]
delimiter = “_”
[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage"
mbean = "java.lang:type=Memory"
attribute = “HeapMemoryUsage”

Stored as HeapMemoryUsage_HeapMemoryUsage_committed

[[inputs.jolokia]]
delimiter = “_”
[[inputs.jolokia.metrics]]
mbean = "java.lang:type=Memory"
attribute = “HeapMemoryUsage”

Stored as _HeapMemoryUsage_committed

[[inputs.jolokia]]
delimiter = “_”
[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage"
mbean = “java.lang:type=Memory/HeapMemoryUsage”

No Data.

I want to store data as HeapMemoryUsage_committed. Please help me. BTW, init, committed,max and used are path attributes.

Hi All,

My requirement is achieved by below configuration:

[[inputs.jolokia.metrics]]
name = "HeapMemoryUsage_committed"
mbean = "java.lang:type=Memory"
attribute = "HeapMemoryUsage"
path = “committed”

Thanks all for your time.

1 Like