Skip to content

Commit

Permalink
Cherry-pick to 7.0: Enable checks for jolokia documented fields (elas…
Browse files Browse the repository at this point in the history
…tic#10979) (elastic#11144)

* Enable checks for jolokia documented fields (elastic#10979)

* Enable checks for jolokia documented fields
* Remove test fields before assert_fields_are_documented

(cherry picked from commit e031688)

* Fix changelog
  • Loading branch information
kaiyan-sheng authored Mar 12, 2019
1 parent 27b1eb7 commit a8fcb61
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ https://github.com/elastic/beats/compare/v7.0.0-beta1...master[Check the HEAD di
- Migrate docker autodiscover to ECS. {issue}10757[10757] {pull}10862[10862]
- Fix issue in kubernetes module preventing usage percentages to be properly calculated. {pull}10946[10946]
- Fix parsing error using GET in Jolokia module. {pull}11075[11075] {issue}11071[11071]
- Collect metrics when EC2 instances are not in running state. {issue}11008[11008] {pull}11023[11023]
- Change ECS field cloud.provider to aws. {pull}11023[11023]
- Add documentation about jolokia autodiscover fields. {issue}10925[10925] {pull}10979[10979]

*Packetbeat*

Expand Down
70 changes: 70 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10796,6 +10796,76 @@ jolokia contains metrics exposed via jolokia agent
*`jolokia.agent.version`*::
+
--
type: keyword
Version number of jolokia agent.
--
*`jolokia.agent.id`*::
+
--
type: keyword
Each agent has a unique id which can be either provided during startup of the agent in form of a configuration parameter or being autodetected. If autodected, the id has several parts: The IP, the process id, hashcode of the agent and its type.
--
*`jolokia.server.product`*::
+
--
type: keyword
The container product if detected.
--
*`jolokia.server.version`*::
+
--
type: keyword
The container's version (if detected).
--
*`jolokia.server.vendor`*::
+
--
type: keyword
The vendor of the container the agent is running in.
--
*`jolokia.url`*::
+
--
type: keyword
The URL how this agent can be contacted.
--
*`jolokia.secured`*::
+
--
type: boolean
Whether the agent was configured for authentication or not.
--
[[exported-fields-kafka]]
== Kafka fields
Expand Down
28 changes: 28 additions & 0 deletions metricbeat/module/jolokia/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,31 @@
description: >
jolokia contains metrics exposed via jolokia agent
fields:
- name: agent.version
type: keyword
description: >
Version number of jolokia agent.
- name: agent.id
type: keyword
description: >
Each agent has a unique id which can be either provided during startup of the agent in form of a configuration parameter or being autodetected. If autodected, the id has several parts: The IP, the process id, hashcode of the agent and its type.
- name: server.product
type: keyword
description: >
The container product if detected.
- name: server.version
type: keyword
description: >
The container's version (if detected).
- name: server.vendor
type: keyword
description: >
The vendor of the container the agent is running in.
- name: url
type: keyword
description: >
The URL how this agent can be contacted.
- name: secured
type: boolean
description: >
Whether the agent was configured for authentication or not.
2 changes: 1 addition & 1 deletion metricbeat/module/jolokia/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion metricbeat/module/jolokia/jmx/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
- release: ga
- key: jmx
type: group
description: >
Jolokia jmx metricset
release: ga
fields:
8 changes: 8 additions & 0 deletions metricbeat/tests/system/test_autodiscover_jolokia.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ def test_jolokia_jmx(self):
print(evt)

assert evt["jolokia"]["test"]["gc"]["collection_count"] >= 0

# Check Jolokia autodiscover metadata is added
assert evt['jolokia']['server']['product'] == 'tomcat'
assert evt['jolokia']['server']['vendor'] == 'Apache'

# Remove "test" fields because namespace specific fields are not documented
del(evt["jolokia"]["test"])
self.assert_fields_are_documented(output[0])

0 comments on commit a8fcb61

Please sign in to comment.