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

Enable checks for jolokia documented fields #10979

Merged
merged 7 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- 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 @@ -11118,6 +11118,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR but I just realise now that this at one stage should become an ECS field and Metricbeat in this case is the observer. @jsoriano is this correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean setting observer.version to this field and observer.type to jolokia? I guess it could make sense, but yeah, nothing to be done on this PR about this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesish. This agent.version would end up on the top level an observer.version would be the current beat version. It's a more general issue we have but just jumped in my face here :-D

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

jsoriano marked this conversation as resolved.
Show resolved Hide resolved
# 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])