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

Cherry-pick #11284 to 7.0: [Metricbeat] Fix wrong alias in rabbitmq module #11289

Merged
merged 1 commit into from
Mar 18, 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
16 changes: 16 additions & 0 deletions filebeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,19 @@ def test_template(self):
assert exit_code == 0
assert self.log_contains('Loaded index template')
assert len(es.cat.templates(name='filebeat-*', h='name')) > 0

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_template_migration(self):
"""
Test that the template can be loaded with `setup --template`
"""
es = Elasticsearch([self.get_elasticsearch_url()])
self.render_config_template(
elasticsearch={"host": self.get_elasticsearch_url()},
)
exit_code = self.run_beat(extra_args=["setup", "--template",
"-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"])

assert exit_code == 0
assert self.log_contains('Loaded index template')
assert len(es.cat.templates(name='filebeat-*', h='name')) > 0
19 changes: 2 additions & 17 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20073,16 +20073,6 @@ RabbitMQ module



*`rabbitmq.node.name`*::
+
--
type: keyword

Node name


--

*`rabbitmq.vhost`*::
+
--
Expand All @@ -20103,9 +20093,7 @@ connection
*`rabbitmq.connection.name`*::
+
--
type: alias

alias to: rabbitmq.name
type: keyword

The name of the connection with non-ASCII characters escaped as in C.

Expand Down Expand Up @@ -20663,13 +20651,10 @@ Number of messages which have been written to the message store.
*`rabbitmq.node.name`*::
+
--
type: alias

alias to: rabbitmq.node.name
type: keyword

Node name


--

*`rabbitmq.node.proc.total`*::
Expand Down
5 changes: 0 additions & 5 deletions metricbeat/module/rabbitmq/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
type: group
description: >
fields:
- name: node.name
type: keyword
description: >
Node name

- name: vhost
type: keyword
description: >
Expand Down
4 changes: 1 addition & 3 deletions metricbeat/module/rabbitmq/connection/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
release: ga
fields:
- name: name
type: alias
path: rabbitmq.name
migration: true
type: keyword
description: >
The name of the connection with non-ASCII characters escaped as in C.
- name: vhost
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/rabbitmq/fields.go

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

6 changes: 2 additions & 4 deletions metricbeat/module/rabbitmq/node/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@
description: >
Number of messages which have been written to the message store.
- name: name
type: alias
path: rabbitmq.node.name
migration: true
description: >
type: keyword
description:
Node name
- name: proc.total
type: long
Expand Down
22 changes: 22 additions & 0 deletions metricbeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,25 @@ def test_dashboards(self):

assert exit_code == 0
assert self.log_contains("Kibana dashboards successfully loaded.")

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_migration(self):
"""
Test that the template loads when migration is enabled
"""

es = Elasticsearch([self.get_elasticsearch_url()])
self.render_config_template(
modules=[{
"name": "apache",
"metricsets": ["status"],
"hosts": ["localhost"],
}],
elasticsearch={"host": self.get_elasticsearch_url()},
)
exit_code = self.run_beat(extra_args=["setup", "--template",
"-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"])

assert exit_code == 0
assert self.log_contains('Loaded index template')
assert len(es.cat.templates(name='metricbeat-*', h='name')) > 0