Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jolokia support multiple dimensions #1481

Closed
phemmer opened this issue Jul 11, 2016 · 4 comments · Fixed by #1524
Closed

Jolokia support multiple dimensions #1481

phemmer opened this issue Jul 11, 2016 · 4 comments · Fixed by #1524

Comments

@phemmer
Copy link
Contributor

phemmer commented Jul 11, 2016

Feature Request

Proposal:

Currently jolokia doesn't support data returned with multiple dimensions.

Current behavior:

Config:

[[inputs.jolokia.metrics]]
    name = "garbage_collector"
    mbean = "java.lang:type=GarbageCollector,*"
    attribute = "CollectionCount,CollectionTime"

Output:

* Plugin: jolokia, Collection 1
> jolokia,host=fll2gbow02dev,jolokia_host=127.0.0.1,jolokia_port=7777 garbage_collector_java.lang:name\=ConcurrentMarkSweep\,type\=GarbageCollector="map[CollectionTime:116 CollectionCount:3]",garbage_collector_java.lang:name\=ParNew\,type\=GarbageCollector="map[CollectionCount:54 CollectionTime:941]" 1468266458664897695

Desired behavior:

* Plugin: jolokia, Collection 1
> jolokia,host=fll2gbow02dev,jolokia_host=127.0.0.1,jolokia_port=7777,name=ConcurrentMarkSweep,type=GarbageCollector CollectionTime=116i CollectionCount=3i 1468266458664897695
> jolokia,host=fll2gbow02dev,jolokia_host=127.0.0.1,jolokia_port=7777,name=ParNew,type=GarbageCollector CollectionCount=54i,CollectionTime=941i 1468266458664897695
@trehn
Copy link
Contributor

trehn commented Jul 19, 2016

Hm, I don't know anything about Go, but to me it looks like at least it was meant to be handled:

if values, ok := out["value"]; ok {

So maybe this is a bug rather than a new feature.

@sparrc
Copy link
Contributor

sparrc commented Jul 19, 2016

I don't have the ability to test, but PRs would be appreciated :).

@kostasb
Copy link

kostasb commented Jul 20, 2016

+1 on this

> select heap_memory_usage_NonHeapMemoryUsage from jolokia where time > now() - 40s
name: jolokia
-------------
time            heap_memory_usage_NonHeapMemoryUsage
1469016050000000000 map[committed:2.22101504e+08 init:2.3527424e+07 used:2.20133792e+08 max:2.197815296e+09]

The desired behavior would be to unpack the map returned by JMX into multiple fields of the proper type instead of storing the map into a single string field.

Not sure if it is a bug or just not included in the plugin's implementation.

@trehn
Copy link
Contributor

trehn commented Jul 20, 2016

I have created a PR with a quick fix.

A workaround until it is merged is to configure multidimensional attributes separately, e.g.

  [[inputs.jolokia.metrics]]
    name = "heap_memory_usage"
    mbean  = "java.lang:type=Memory"
    attribute = "HeapMemoryUsage"

  [[inputs.jolokia.metrics]]
    name = "non_heap_memory_usage"
    mbean  = "java.lang:type=Memory"
    attribute = "NonHeapMemoryUsage"

instead of

  [[inputs.jolokia.metrics]]
    name = "heap_memory_usage"
    mbean  = "java.lang:type=Memory"
    attribute = "HeapMemoryUsage,NonHeapMemoryUsage"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants