diff --git a/filebeat/tests/system/filebeat.py b/filebeat/tests/system/filebeat.py index 4d34de9ccca..6b217c64f4b 100644 --- a/filebeat/tests/system/filebeat.py +++ b/filebeat/tests/system/filebeat.py @@ -45,15 +45,3 @@ def get_registry_entry_by_path(self, path): tmp_entry = entry return tmp_entry - - def assert_fields_are_documented(self, evt): - """ - Assert that all keys present in evt are documented in fields.yml. - This reads from the global fields.yml, means `make collect` has to be run before the check. - """ - expected_fields, dict_fields = self.load_fields() - flat = self.flatten_object(evt, dict_fields) - - for key in flat.keys(): - if key not in expected_fields: - raise Exception("Key '{}' found in event is not documented!".format(key)) diff --git a/heartbeat/_meta/fields.common.yml b/heartbeat/_meta/fields.common.yml index e5e5dc6e153..90688a14909 100644 --- a/heartbeat/_meta/fields.common.yml +++ b/heartbeat/_meta/fields.common.yml @@ -2,6 +2,8 @@ title: "Common heartbeat monitor" description: fields: + - name: type + type: keyword - name: monitor type: group description: > diff --git a/heartbeat/docs/fields.asciidoc b/heartbeat/docs/fields.asciidoc index 0bc6cb664e7..7b9ac87393c 100644 --- a/heartbeat/docs/fields.asciidoc +++ b/heartbeat/docs/fields.asciidoc @@ -213,6 +213,13 @@ Region in which this host is running. None +*`type`*:: ++ +-- +type: keyword + +-- + [float] == monitor fields @@ -573,6 +580,15 @@ Duration in microseconds -- +*`http.rtt.content.us`*:: ++ +-- +type: long + +Time required to retrieved the content in micro seconds. + +-- + [float] == total fields diff --git a/heartbeat/include/fields.go b/heartbeat/include/fields.go index ae6fcca823f..f3adc029cd7 100644 --- a/heartbeat/include/fields.go +++ b/heartbeat/include/fields.go @@ -14,5 +14,5 @@ func init() { // Asset returns asset data func Asset() string { - return "eJzsW19z27gRf/en2MlTOyNrmqTJdPzQaeqkPc1d7jy2+yxDwErEGQQYALSsm374Dv6RoEjqj6Vc3ZnqJSYJ7C52f/jtLshcXMIjbq5ggcReAFhuBV7B38MVQ0M1ryxX8gr+egEAcK2kJVwaoKoslfTzYMlRMAPkiXBBFgKBSyBCA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LTQFYWdafnA2uMM6Al0sdewnjNueG1sDq2dJxWeUs3v/10d2QrF5+EU1q5+R3Ubq2PPDMI4jN8Wzqs9vd98RWixFfgJgff0VJ9joa9/l3iTLO1DJ8zwfyMteNDv+o/sua/9GlmOjqiebTd/jvpvIieHHHnIkn7S86NaqWHsTgp/qn7dJbilr1EyHfOp27PbfIufGA6qtr5oemO9p7QlXXvCV6Lln2FrnnPinZdjPtlLNbd6uEzN/5/9ukv72tZqP8EAAD//wjRipo=" } diff --git a/heartbeat/monitors/active/http/_meta/fields.yml b/heartbeat/monitors/active/http/_meta/fields.yml index 082c1f2e54d..6cb7f0aae32 100644 --- a/heartbeat/monitors/active/http/_meta/fields.yml +++ b/heartbeat/monitors/active/http/_meta/fields.yml @@ -82,6 +82,11 @@ type: long description: Duration in microseconds + - name: content.us + type: long + description: + Time required to retrieved the content in micro seconds. + - name: total type: group description: | diff --git a/heartbeat/tests/system/test_monitor.py b/heartbeat/tests/system/test_monitor.py index 6f4ff2a8e51..423eee1b6d3 100644 --- a/heartbeat/tests/system/test_monitor.py +++ b/heartbeat/tests/system/test_monitor.py @@ -2,6 +2,8 @@ import BaseHTTPServer import threading from parameterized import parameterized +import os +from nose.plugins.skip import SkipTest class Test(BaseTest): @@ -35,6 +37,11 @@ def test_http(self, status_code): output = self.read_output() assert status_code == output[0]["http.response.status_code"] + if os.name == "nt": + # Currently skipped on Windows as fields.yml not generated + raise SkipTest + self.assert_fields_are_documented(output[0]) + @parameterized.expand([ ("8181", "up"), ("8182", "down"), @@ -63,6 +70,10 @@ def test_tcp(self, port, status): output = self.read_output() assert status == output[0]["monitor.status"] + if os.name == "nt": + # Currently skipped on Windows as fields.yml not generated + raise SkipTest + self.assert_fields_are_documented(output[0]) def start_server(self, content, status_code): class HTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler): diff --git a/libbeat/tests/system/beat/beat.py b/libbeat/tests/system/beat/beat.py index fe0ad480509..d54077c4618 100644 --- a/libbeat/tests/system/beat/beat.py +++ b/libbeat/tests/system/beat/beat.py @@ -579,3 +579,17 @@ def get_kibana_url(self): host=os.getenv("KIBANA_HOST", "localhost"), port=os.getenv("KIBANA_PORT", "5601"), ) + + def assert_fields_are_documented(self, evt): + """ + Assert that all keys present in evt are documented in fields.yml. + This reads from the global fields.yml, means `make collect` has to be run before the check. + """ + expected_fields, dict_fields = self.load_fields() + flat = self.flatten_object(evt, dict_fields) + + for key in flat.keys(): + documented = key in expected_fields + metaKey = key.startswith('@metadata.') + if not(documented or metaKey): + raise Exception("Key '{}' found in event is not documented!".format(key)) diff --git a/metricbeat/tests/system/metricbeat.py b/metricbeat/tests/system/metricbeat.py index 74fe07c7ab7..7deb99a3200 100644 --- a/metricbeat/tests/system/metricbeat.py +++ b/metricbeat/tests/system/metricbeat.py @@ -23,20 +23,6 @@ def setUpClass(self): self.beat_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) super(BaseTest, self).setUpClass() - def assert_fields_are_documented(self, evt): - """ - Assert that all keys present in evt are documented in fields.yml. - This reads from the global fields.yml, means `make collect` has to be run before the check. - """ - expected_fields, _ = self.load_fields() - flat = self.flatten_object(evt, []) - - for key in flat.keys(): - documented = key in expected_fields - metaKey = key.startswith('@metadata.') - if not(documented or metaKey): - raise Exception("Key '{}' found in event is not documented!".format(key)) - def de_dot(self, existing_fields): fields = {}