Jolokia Module with dynamic JMX Metricset #3570
Conversation
913b10c to
4458863
Compare
There was a problem hiding this comment.
I suggest adding a beta[] tag here as well.
There was a problem hiding this comment.
What's the reason for the custom marshaling? I suspect performance is unlikely an issue here.
There was a problem hiding this comment.
@vas78 Can you share some insights on this one?
There was a problem hiding this comment.
No specific reason to use custom marshaling here, this was just a quick-and-dirty solution to test how it would work that eventually was left behind.
There was a problem hiding this comment.
This is a left over from the "old" code base where the config had a special implementation. I removed the file now.
There was a problem hiding this comment.
This error seems completely silenced? Should it be a TODO entry? I guess the implementation shouldn't be difficult here.
There was a problem hiding this comment.
Will try to simplify and cleanup this part further.
metricbeat/module/jolokia/jmx/jmx.go
Outdated
There was a problem hiding this comment.
Heh, I wanted to complain that they are not documented :).
There was a problem hiding this comment.
I'm still in progress of figuring this one out: #3051 (comment) I added the in progress label again to the PR to make sure it does not get merged by accident.
|
LGTM, left some minor comments. |
2692fd8 to
0c84f51
Compare
There was a problem hiding this comment.
Ah, I see why you were happy about the Put method 👍
There was a problem hiding this comment.
Is this still a limitation? At list there's not Add function in config.go to check :)
There was a problem hiding this comment.
Good point, this limitation was removed.
tsg
left a comment
There was a problem hiding this comment.
LGTM, happy to merge when you give the sign.
This is the implementation of a module for Jolokia which contains a dynamic jmx metricset.
An example configuration looks as following:
```
- module: jolokia
metricsets: ["jmx"]
enabled: true
period: 1s
hosts: ["localhost:8778"]
namespace: "metrics"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: Uptime
field: uptime
- mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
attributes:
- attr: CollectionTime
field: gc.cms_collection_time
- attr: CollectionCount
field: gc.cms_collection_count
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
```
For each mbeat the attributes which should be fetched can be defined. The field defines under which field name the event will be put. The namespace defines the metricset namespace.
This PR replaces elastic#3051
Further changes:
* Added support for method and body to http helper
* Handle empty fields in generators. This happens for a module which only contains dynamic metricsets which is currently the case for jolokia.
TODO:
* [x] Add system tests
* [x] Check documentation
* [x] Add integration test
* [ ] Open issue for metricset which contains basic memory info
This is the implementation of a module for Jolokia which contains a dynamic jmx metricset.
An example configuration looks as following:
```
- module: jolokia
metricsets: ["jmx"]
enabled: true
period: 1s
hosts: ["localhost:8778"]
namespace: "metrics"
jmx.mappings:
- mbean: 'java.lang:type=Runtime'
attributes:
- attr: Uptime
field: uptime
- mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
attributes:
- attr: CollectionTime
field: gc.cms_collection_time
- attr: CollectionCount
field: gc.cms_collection_count
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage
field: memory.heap_usage
- attr: NonHeapMemoryUsage
field: memory.non_heap_usage
```
For each mbeat the attributes which should be fetched can be defined. The field defines under which field name the event will be put. The namespace defines the metricset namespace.
This PR replaces elastic#3051
Further changes:
* Added support for method and body to http helper
* Handle empty fields in generators. This happens for a module which only contains dynamic metricsets which is currently the case for jolokia.
TODO:
* [x] Add system tests
* [x] Check documentation
* [x] Add integration test
* [ ] Open issue for metricset which contains basic memory info
|
Is this consumable for Production? |
|
@kkmathigir It will be shipped with 6.3. If you already want to try it let me know and I can provide you a snapshot. |
|
Can I use it with Elasticsearch 5.6? |
|
@nielsen-at-cgt Yes, that should work. |
This is the implementation of a module for Jolokia which contains a dynamic jmx metricset.
An example configuration looks as following:
For each mbeat the attributes which should be fetched can be defined. The field defines under which field name the event will be put. The namespace defines the metricset namespace.
This PR replaces elastic#3051
Further changes:
TODO: