From dd6399a174d9e7334f4e4578635a0881b4a41dd1 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 20 Feb 2020 18:59:37 +0100 Subject: [PATCH 01/30] Prepare redis-enterprise docker image --- .../module/redis/_meta/Dockerfile.enterprise | 10 ++++++++ .../_meta/{Dockerfile => Dockerfile.oss} | 0 metricbeat/module/redis/_meta/healthcheck.sh | 21 ++++++++++++++++ .../module/redis/_meta/supported-versions.yml | 11 ++++++--- metricbeat/module/redis/docker-compose.yml | 13 ++++++++++ metricbeat/module/redis/test_redis.py | 24 +++++++++++++++++++ 6 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 metricbeat/module/redis/_meta/Dockerfile.enterprise rename metricbeat/module/redis/_meta/{Dockerfile => Dockerfile.oss} (100%) create mode 100755 metricbeat/module/redis/_meta/healthcheck.sh diff --git a/metricbeat/module/redis/_meta/Dockerfile.enterprise b/metricbeat/module/redis/_meta/Dockerfile.enterprise new file mode 100644 index 00000000000..12e72f7221a --- /dev/null +++ b/metricbeat/module/redis/_meta/Dockerfile.enterprise @@ -0,0 +1,10 @@ +ARG REDIS_VERSION +FROM redislabs/redis:${REDIS_VERSION} + +# Wait for the health endpoint to have monitors information +ADD healthcheck.sh / +HEALTHCHECK --interval=1s --retries=300 CMD /healthcheck.sh + +# RUN /opt/redislabs/sbin/supervisord_prestart_script.sh +# RUN rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 +# RUN curl -k -u "cihan@redislabs.com:redislabs123" --request POST --url "https://localhost:9443/v1/bdbs" --header 'content-type: application/json' --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' diff --git a/metricbeat/module/redis/_meta/Dockerfile b/metricbeat/module/redis/_meta/Dockerfile.oss similarity index 100% rename from metricbeat/module/redis/_meta/Dockerfile rename to metricbeat/module/redis/_meta/Dockerfile.oss diff --git a/metricbeat/module/redis/_meta/healthcheck.sh b/metricbeat/module/redis/_meta/healthcheck.sh new file mode 100755 index 00000000000..12b298e60c6 --- /dev/null +++ b/metricbeat/module/redis/_meta/healthcheck.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +CHECK_CLUSTER_CREATED=/opt/redislabs/config/check_cluster_created +CHECK_DATABASE_CREATED=/opt/redislabs/config/check_database_created + +if [[ ! -f "${CHECK_CLUSTER_CREATED}" ]]; then + rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 + touch ${CHECK_CLUSTER_CREATED} +fi + +if [[ ! -f "${CHECK_DATABASE_CREATED}" ]]; then + curl -s -k -u "cihan@redislabs.com:redislabs123" --request POST \ + --url "https://localhost:9443/v1/bdbs" \ + --header 'content-type: application/json' \ + --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' + touch ${CHECK_DATABASE_CREATED} +fi + +curl -s --insecure https://127.0.0.1:8070 >/dev/null diff --git a/metricbeat/module/redis/_meta/supported-versions.yml b/metricbeat/module/redis/_meta/supported-versions.yml index 44898f1c82d..27e6b04a239 100644 --- a/metricbeat/module/redis/_meta/supported-versions.yml +++ b/metricbeat/module/redis/_meta/supported-versions.yml @@ -1,4 +1,9 @@ variants: - - REDIS_VERSION: 3.2.12 - - REDIS_VERSION: 4.0.11 - - REDIS_VERSION: 5.0.5 + - REDIS_DISTRIBUTION: oss + REDIS_VERSION: 3.2.12 + - REDIS_DISTRIBUTION: oss + REDIS_VERSION: 4.0.11 + - REDIS_DISTRIBUTION: oss + REDIS_VERSION: 5.0.5 + - REDIS_DISTRIBUTION: enterprise + REDIS_VERSION: 5.4.10-22 diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index a2f9dcc4bdd..ae2f137120b 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -5,7 +5,20 @@ services: image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-1 build: context: ./_meta + dockerfile: Dockerfile.oss args: + REDIS_DISTRIBUTION: oss REDIS_VERSION: ${REDIS_VERSION:-3.2.12} ports: - 6379 + redis-enterprise: + image: docker.elastic.co/integrations-ci/beats-redis-enterprise:${REDIS_VERSION:-5.4.10-22}-1 + build: + context: ./_meta + dockerfile: Dockerfile.enterprise + args: + REDIS_DISTRIBUTION: enterprise + REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} + privileged: true + ports: + - 127.0.0.1:8070:8070 diff --git a/metricbeat/module/redis/test_redis.py b/metricbeat/module/redis/test_redis.py index 9d9967389f9..2a9b1f828bc 100644 --- a/metricbeat/module/redis/test_redis.py +++ b/metricbeat/module/redis/test_redis.py @@ -34,6 +34,11 @@ def test_info(self): """ Test redis info metricset """ + + if not self.oss_distribution(): + self.skipTest("only oss distribution is supported") + return + self.render_config_template(modules=[{ "name": "redis", "metricsets": ["info"], @@ -64,6 +69,10 @@ def test_keyspace(self): Test redis keyspace metricset """ + if not self.oss_distribution(): + self.skipTest("only oss distribution is supported") + return + # At least one event must be inserted so db stats exist host, port = self.compose_host().split(":") r = redis.StrictRedis( @@ -100,6 +109,10 @@ def test_key(self): Test redis key metricset """ + if not self.oss_distribution(): + self.skipTest("only oss distribution is supported") + return + # At least one event must be inserted so db stats exist host, port = self.compose_host().split(":") r = redis.StrictRedis( @@ -137,6 +150,11 @@ def test_module_processors(self): """ Test local processors for Redis info event. """ + + if not self.oss_distribution(): + self.skipTest("only oss distribution is supported") + return + fields = ["clients", "cpu"] eventFields = ['beat', 'metricset', 'service', 'event'] eventFields += ['redis.info.' + f for f in fields] @@ -164,3 +182,9 @@ def test_module_processors(self): self.assertCountEqual(fields, redis_info.keys()) self.assertCountEqual(self.de_dot(CLIENTS_FIELDS), redis_info["clients"].keys()) self.assertCountEqual(self.de_dot(CPU_FIELDS), redis_info["cpu"].keys()) + + def oss_distribution(self): + if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: + return False + + return self.COMPOSE_ENV['REDIS_DISTRIBUTION'] == 'oss' From 7091a29ba35f86f332df5655700980ce563483ca Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 20 Feb 2020 22:22:29 +0100 Subject: [PATCH 02/30] All existing tests are passing --- metricbeat/module/redis/docker-compose.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index ae2f137120b..ca775fcf24d 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -2,23 +2,14 @@ version: '2.3' services: redis: - image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-1 + image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-${REDIS_DISTRIBUTION:-oss}-1 build: context: ./_meta - dockerfile: Dockerfile.oss + dockerfile: Dockerfile.${REDIS_DISTRIBUTION:-oss} args: - REDIS_DISTRIBUTION: oss + REDIS_DISTRIBUTION: ${REDIS_DISTRIBUTION:-oss} REDIS_VERSION: ${REDIS_VERSION:-3.2.12} - ports: - - 6379 - redis-enterprise: - image: docker.elastic.co/integrations-ci/beats-redis-enterprise:${REDIS_VERSION:-5.4.10-22}-1 - build: - context: ./_meta - dockerfile: Dockerfile.enterprise - args: - REDIS_DISTRIBUTION: enterprise - REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} privileged: true ports: + - 6379 - 127.0.0.1:8070:8070 From 7411396fe9e2cbdd98fec2c82be9c5456499dd43 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 21 Feb 2020 11:16:46 +0100 Subject: [PATCH 03/30] Add metricsets - node and proxy --- metricbeat/docs/modules/redis.asciidoc | 15 +- metricbeat/docs/modules/redis/node.asciidoc | 24 +++ metricbeat/docs/modules/redis/proxy.asciidoc | 24 +++ metricbeat/docs/modules_list.asciidoc | 4 +- .../module/redis/_meta/config-enterprise.yml | 8 + metricbeat/module/redis/_meta/docs.asciidoc | 7 +- metricbeat/module/redis/docker-compose.yml | 11 ++ metricbeat/module/redis/fields.go | 2 +- metricbeat/module/redis/module.yml | 8 +- metricbeat/module/redis/node/_meta/data.json | 84 +++++++++ .../module/redis/node/_meta/docs.asciidoc | 1 + metricbeat/module/redis/node/_meta/fields.yml | 1 + .../redis/node/_meta/testdata/config.yml | 4 + .../_meta/testdata/redis-node.5.4.10-22.plain | 144 +++++++++++++++ .../redis-node.5.4.10-22.plain-expected.json | 99 +++++++++++ metricbeat/module/redis/node/manifest.yml | 29 +++ .../redis/node/node_integration_test.go | 49 +++++ metricbeat/module/redis/node/node_test.go | 32 ++++ metricbeat/module/redis/proxy/_meta/data.json | 86 +++++++++ .../module/redis/proxy/_meta/docs.asciidoc | 1 + .../module/redis/proxy/_meta/fields.yml | 1 + .../redis/proxy/_meta/testdata/config.yml | 4 + .../testdata/redis-proxy.5.4.10-22.plain | 168 ++++++++++++++++++ .../redis-proxy.5.4.10-22.plain-expected.json | 111 ++++++++++++ metricbeat/module/redis/proxy/manifest.yml | 29 +++ .../redis/proxy/proxy_integration_test.go | 49 +++++ metricbeat/module/redis/proxy/proxy_test.go | 32 ++++ .../module/redis/test_redis_enterprise.py | 60 +++++++ .../modules.d/redis-enterprise.yml.disabled | 11 ++ 29 files changed, 1090 insertions(+), 8 deletions(-) create mode 100644 metricbeat/docs/modules/redis/node.asciidoc create mode 100644 metricbeat/docs/modules/redis/proxy.asciidoc create mode 100644 metricbeat/module/redis/_meta/config-enterprise.yml create mode 100644 metricbeat/module/redis/node/_meta/data.json create mode 100644 metricbeat/module/redis/node/_meta/docs.asciidoc create mode 100644 metricbeat/module/redis/node/_meta/fields.yml create mode 100644 metricbeat/module/redis/node/_meta/testdata/config.yml create mode 100644 metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain create mode 100644 metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json create mode 100644 metricbeat/module/redis/node/manifest.yml create mode 100644 metricbeat/module/redis/node/node_integration_test.go create mode 100644 metricbeat/module/redis/node/node_test.go create mode 100644 metricbeat/module/redis/proxy/_meta/data.json create mode 100644 metricbeat/module/redis/proxy/_meta/docs.asciidoc create mode 100644 metricbeat/module/redis/proxy/_meta/fields.yml create mode 100644 metricbeat/module/redis/proxy/_meta/testdata/config.yml create mode 100644 metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain create mode 100644 metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json create mode 100644 metricbeat/module/redis/proxy/manifest.yml create mode 100644 metricbeat/module/redis/proxy/proxy_integration_test.go create mode 100644 metricbeat/module/redis/proxy/proxy_test.go create mode 100644 metricbeat/module/redis/test_redis_enterprise.py create mode 100644 metricbeat/modules.d/redis-enterprise.yml.disabled diff --git a/metricbeat/docs/modules/redis.asciidoc b/metricbeat/docs/modules/redis.asciidoc index b5c7f20364f..61855b3a0ad 100644 --- a/metricbeat/docs/modules/redis.asciidoc +++ b/metricbeat/docs/modules/redis.asciidoc @@ -33,8 +33,11 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The Redis metricsets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected -to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were +tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. [float] @@ -89,9 +92,17 @@ The following metricsets are available: * <> +* <> + +* <> + include::redis/info.asciidoc[] include::redis/key.asciidoc[] include::redis/keyspace.asciidoc[] +include::redis/node.asciidoc[] + +include::redis/proxy.asciidoc[] + diff --git a/metricbeat/docs/modules/redis/node.asciidoc b/metricbeat/docs/modules/redis/node.asciidoc new file mode 100644 index 00000000000..e0077e6876e --- /dev/null +++ b/metricbeat/docs/modules/redis/node.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-redis-node]] +=== Redis node metricset + +beta[] + +include::../../../module/redis/node/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../module/redis/node/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules/redis/proxy.asciidoc b/metricbeat/docs/modules/redis/proxy.asciidoc new file mode 100644 index 00000000000..b20cf2007d5 --- /dev/null +++ b/metricbeat/docs/modules/redis/proxy.asciidoc @@ -0,0 +1,24 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-redis-proxy]] +=== Redis proxy metricset + +beta[] + +include::../../../module/redis/proxy/_meta/docs.asciidoc[] + +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../module/redis/proxy/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index cbb56506e60..12f91610d7a 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -196,9 +196,11 @@ This file is generated! See scripts/mage/docs_collector.go |<> |<> |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> +.5+| .5+| |<> |<> |<> +|<> beta[] +|<> beta[] |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | diff --git a/metricbeat/module/redis/_meta/config-enterprise.yml b/metricbeat/module/redis/_meta/config-enterprise.yml new file mode 100644 index 00000000000..58c6b2dcd0d --- /dev/null +++ b/metricbeat/module/redis/_meta/config-enterprise.yml @@ -0,0 +1,8 @@ +- module: redis + metricsets: + - node + # - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] diff --git a/metricbeat/module/redis/_meta/docs.asciidoc b/metricbeat/module/redis/_meta/docs.asciidoc index a15de3429fd..7e7ed912924 100644 --- a/metricbeat/module/redis/_meta/docs.asciidoc +++ b/metricbeat/module/redis/_meta/docs.asciidoc @@ -26,5 +26,8 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The Redis metricsets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected -to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were +tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index ca775fcf24d..e4b19639b11 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -12,4 +12,15 @@ services: privileged: true ports: - 6379 + - 8070 + redis-enterprise: + image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-5.4.10-22}-enterprise-1 + build: + context: ./_meta + dockerfile: Dockerfile.enterprise + args: + REDIS_DISTRIBUTION: enterprise + REDIS_VERSION: ${REDIS_VERSION:-:5.4.10-22} + privileged: true + ports: - 127.0.0.1:8070:8070 diff --git a/metricbeat/module/redis/fields.go b/metricbeat/module/redis/fields.go index fd28937ec4b..a38a8737091 100644 --- a/metricbeat/module/redis/fields.go +++ b/metricbeat/module/redis/fields.go @@ -32,5 +32,5 @@ func init() { // AssetRedis returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/redis. func AssetRedis() string { - return "eJzkXF9v27YWf++nOMh9WAYk6u7D9hAMA5q13S3WtUXS4mJPCiUd2ZwpUiMpp+6nvyAp2bJMSvIfORmuH1rElnh+5/D8JQ95DQtc3YDEjKoXAJpqhjdwcWf+vngBkKFKJS01F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1AW3pJNfolTTsAQhqxC0gIJ8bR9t3RmhF3VJUozmfeXXKWC3euuZEIuqrEWsml2RglAOmTu7S3oOt64hF1SpifdZc0IZZnsCDhdoVaKqxB7P4MimQP4bE8mWDpdV8lJVCTQ0nQdrbgqrkvWIYcWuUZdEa5Se5yZEXdMcATpc1NhukzgXchFX06QRu42ctsEltwlQu4ezoKkU3UbO8FqFrbcxTu0R9ViJdIGT2Oi2k67pGOTcLvT+8e63u1ef30BZyVKoMb0GNkDGzlGrWEuSLjCLjelMjt7aZ03RorcoVmvwcElKuxKfMATBmb0ewGQj9ov6wrlhDrfPok/uO+2FDibba/XzlShzIesLOeqj6XajuXM8vc5oR7JyBp9KEiFN/PIxZZvCNhfuBE7c78fSAlfx5DPk9G5ONDyibICzVQt6zwb0Lt4zTEMHsVrQsjxI8hurF49MzCLbaeZdd/HAHoD8qxnLeiUmHjfO1OODWtnBiy7dfe4IXeCqdUXo7hkYm+a1Xtn/7k/zr1c8/kWvAQn9jis74sA9VDsLrUeQ/MLp3xUCdQ5Wz6myqfLlf02UNspjZAY/N3naLzc/Gwy/DN3TZxCdVi7mdXsl01w82juZHj7/+emN5wpXLx6GfKbnJ1Lk93awJkOw4mpl9AwLe/2hkSejSqurmrr9RmlJ+UxdQUpkRjlhVK/cD6jVkFRdFI607lbKh3JyX+/Ga9GM7bNBO/PHGqIdpO/CXmuRtUDtw9Pe2ntKI/q9Rgz2wgGaUwxd17KOEstZfLppfLVESWYIWrMBup687VCinehT11Hrgm6MJh8L5Xoz7wlqEvz+fwEAAP//LafAzg==" } diff --git a/metricbeat/module/redis/module.yml b/metricbeat/module/redis/module.yml index 6a4e4504f9c..6addb1d4881 100644 --- a/metricbeat/module/redis/module.yml +++ b/metricbeat/module/redis/module.yml @@ -1,3 +1,7 @@ +name: redis +metricsets: + - node + - proxy dashboards: - - id: AV4YjZ5pux-M-tCAunxK - file: Metricbeat-redis-overview.json + - id: AV4YjZ5pux-M-tCAunxK + file: Metricbeat-redis-overview.json diff --git a/metricbeat/module/redis/node/_meta/data.json b/metricbeat/module/redis/node/_meta/data.json new file mode 100644 index 00000000000..2a528bef053 --- /dev/null +++ b/metricbeat/module/redis/node/_meta/data.json @@ -0,0 +1,84 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "node" + }, + "service": { + "type": "redis", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "node": "1", + "instance": "127.0.0.1:8070", + "job": "redis" + }, + "metrics": { + "node_cpu_steal_median": 0, + "node_cpu_irqs_max": 0.001, + "node_cpu_user_min": 0.021, + "node_cpu_iowait_median": 0, + "node_cur_aof_rewrites": 0, + "node_ingress_bytes_min": 0, + "node_ingress_bytes_median": 0, + "node_cpu_idle_min": 0.929, + "node_cpu_iowait_max": 0, + "node_cpu_irqs": 0.0003333333333333333, + "node_available_memory": 6.262083584e+09, + "node_provisional_memory_no_overbooking": 4.757468584333e+09, + "node_cpu_idle": 0.9303333333333335, + "node_cpu_steal_max": 0 + } + }, + "event": { + "dataset": "redis.node", + "module": "redis", + "duration": 51870343 + } +} diff --git a/metricbeat/module/redis/node/_meta/docs.asciidoc b/metricbeat/module/redis/node/_meta/docs.asciidoc new file mode 100644 index 00000000000..101cf399e7d --- /dev/null +++ b/metricbeat/module/redis/node/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `node` metricset of the redis module. The metricset is compatible with Redis Enterprise Software. diff --git a/metricbeat/module/redis/node/_meta/fields.yml b/metricbeat/module/redis/node/_meta/fields.yml new file mode 100644 index 00000000000..8033a27f5ac --- /dev/null +++ b/metricbeat/module/redis/node/_meta/fields.yml @@ -0,0 +1 @@ +- release: beta diff --git a/metricbeat/module/redis/node/_meta/testdata/config.yml b/metricbeat/module/redis/node/_meta/testdata/config.yml new file mode 100644 index 00000000000..361e43c5ccd --- /dev/null +++ b/metricbeat/module/redis/node/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain new file mode 100644 index 00000000000..d1b94f28efd --- /dev/null +++ b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain @@ -0,0 +1,144 @@ +# HELP node_cpu_nice_min +# TYPE node_cpu_nice_min gauge +node_cpu_nice_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_max +# TYPE node_cpu_idle_max gauge +node_cpu_idle_max{cluster="cluster.local",node="1"} 0.914 +# HELP node_egress_bytes +# TYPE node_egress_bytes gauge +node_egress_bytes{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_idle +# TYPE node_cpu_idle gauge +node_cpu_idle{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_irqs +# TYPE node_cpu_irqs gauge +node_cpu_irqs{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_system_median +# TYPE node_cpu_system_median gauge +node_cpu_system_median{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_user +# TYPE node_cpu_user gauge +node_cpu_user{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_irqs_min +# TYPE node_cpu_irqs_min gauge +node_cpu_irqs_min{cluster="cluster.local",node="1"} 0.001 +# HELP node_ingress_bytes_min +# TYPE node_ingress_bytes_min gauge +node_ingress_bytes_min{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_system_min +# TYPE node_cpu_system_min gauge +node_cpu_system_min{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_irqs_median +# TYPE node_cpu_irqs_median gauge +node_cpu_irqs_median{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal +# TYPE node_cpu_steal gauge +node_cpu_steal{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_min +# TYPE node_cpu_user_min gauge +node_cpu_user_min{cluster="cluster.local",node="1"} 0.033 +# HELP node_persistent_storage_free +# TYPE node_persistent_storage_free gauge +node_persistent_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_ephemeral_storage_free +# TYPE node_ephemeral_storage_free gauge +node_ephemeral_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_cpu_idle_median +# TYPE node_cpu_idle_median gauge +node_cpu_idle_median{cluster="cluster.local",node="1"} 0.914 +# HELP node_provisional_memory_no_overbooking +# TYPE node_provisional_memory_no_overbooking gauge +node_provisional_memory_no_overbooking{cluster="cluster.local",node="1"} 5099636117.889 +# HELP node_free_memory +# TYPE node_free_memory gauge +node_free_memory{cluster="cluster.local",node="1"} 6268220757.333 +# HELP node_ingress_bytes +# TYPE node_ingress_bytes gauge +node_ingress_bytes{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_steal_median +# TYPE node_cpu_steal_median gauge +node_cpu_steal_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_conns +# TYPE node_conns gauge +node_conns{cluster="cluster.local",node="1"} 0.0 +# HELP node_ephemeral_storage_avail +# TYPE node_ephemeral_storage_avail gauge +node_ephemeral_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_cpu_nice +# TYPE node_cpu_nice gauge +node_cpu_nice{cluster="cluster.local",node="1"} 0.0 +# HELP node_ingress_bytes_median +# TYPE node_ingress_bytes_median gauge +node_ingress_bytes_median{cluster="cluster.local",node="1"} 1006.111 +# HELP node_ingress_bytes_max +# TYPE node_ingress_bytes_max gauge +node_ingress_bytes_max{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_iowait +# TYPE node_cpu_iowait gauge +node_cpu_iowait{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_median +# TYPE node_cpu_user_median gauge +node_cpu_user_median{cluster="cluster.local",node="1"} 0.033 +# HELP node_available_memory_no_overbooking +# TYPE node_available_memory_no_overbooking gauge +node_available_memory_no_overbooking{cluster="cluster.local",node="1"} 6270062136.889 +# HELP node_cpu_nice_median +# TYPE node_cpu_nice_median gauge +node_cpu_nice_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_total_req +# TYPE node_total_req gauge +node_total_req{cluster="cluster.local",node="1"} 0.0 +# HELP node_cur_aof_rewrites +# TYPE node_cur_aof_rewrites gauge +node_cur_aof_rewrites{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_max +# TYPE node_cpu_iowait_max gauge +node_cpu_iowait_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_persistent_storage_avail +# TYPE node_persistent_storage_avail gauge +node_persistent_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_available_memory +# TYPE node_available_memory gauge +node_available_memory{cluster="cluster.local",node="1"} 6270261475.556 +# HELP node_egress_bytes_min +# TYPE node_egress_bytes_min gauge +node_egress_bytes_min{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_user_max +# TYPE node_cpu_user_max gauge +node_cpu_user_max{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_steal_min +# TYPE node_cpu_steal_min gauge +node_cpu_steal_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_irqs_max +# TYPE node_cpu_irqs_max gauge +node_cpu_irqs_max{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal_max +# TYPE node_cpu_steal_max gauge +node_cpu_steal_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_min +# TYPE node_cpu_iowait_min gauge +node_cpu_iowait_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_min +# TYPE node_cpu_idle_min gauge +node_cpu_idle_min{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_system_max +# TYPE node_cpu_system_max gauge +node_cpu_system_max{cluster="cluster.local",node="1"} 0.022 +# HELP node_egress_bytes_max +# TYPE node_egress_bytes_max gauge +node_egress_bytes_max{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_nice_max +# TYPE node_cpu_nice_max gauge +node_cpu_nice_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_system +# TYPE node_cpu_system gauge +node_cpu_system{cluster="cluster.local",node="1"} 0.022 +# HELP node_provisional_memory +# TYPE node_provisional_memory gauge +node_provisional_memory{cluster="cluster.local",node="1"} 5099835456.556 +# HELP node_egress_bytes_median +# TYPE node_egress_bytes_median gauge +node_egress_bytes_median{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_iowait_median +# TYPE node_cpu_iowait_median gauge +node_cpu_iowait_median{cluster="cluster.local",node="1"} 0.0 diff --git a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json new file mode 100644 index 00000000000..8cb7df8873f --- /dev/null +++ b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json @@ -0,0 +1,99 @@ +[ + { + "event": { + "dataset": "redis.node", + "duration": 115000, + "module": "redis" + }, + "metricset": { + "name": "node", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:55467", + "job": "prometheus" + }, + "metrics": { + "up": 1 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redis" + } + }, + { + "event": { + "dataset": "redis.node", + "duration": 115000, + "module": "redis" + }, + "metricset": { + "name": "node", + "period": 10000 + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "instance": "127.0.0.1:55467", + "job": "redis", + "node": "1" + }, + "metrics": { + "node_available_memory": 6270261475.556, + "node_available_memory_no_overbooking": 6270062136.889, + "node_conns": 0, + "node_cpu_idle": 0.914, + "node_cpu_idle_max": 0.914, + "node_cpu_idle_median": 0.914, + "node_cpu_idle_min": 0.914, + "node_cpu_iowait": 0, + "node_cpu_iowait_max": 0, + "node_cpu_iowait_median": 0, + "node_cpu_iowait_min": 0, + "node_cpu_irqs": 0.001, + "node_cpu_irqs_max": 0.001, + "node_cpu_irqs_median": 0.001, + "node_cpu_irqs_min": 0.001, + "node_cpu_nice": 0, + "node_cpu_nice_max": 0, + "node_cpu_nice_median": 0, + "node_cpu_nice_min": 0, + "node_cpu_steal": 0, + "node_cpu_steal_max": 0, + "node_cpu_steal_median": 0, + "node_cpu_steal_min": 0, + "node_cpu_system": 0.022, + "node_cpu_system_max": 0.022, + "node_cpu_system_median": 0.022, + "node_cpu_system_min": 0.022, + "node_cpu_user": 0.033, + "node_cpu_user_max": 0.033, + "node_cpu_user_median": 0.033, + "node_cpu_user_min": 0.033, + "node_cur_aof_rewrites": 0, + "node_egress_bytes": 14291.444, + "node_egress_bytes_max": 14291.444, + "node_egress_bytes_median": 14291.444, + "node_egress_bytes_min": 14291.444, + "node_ephemeral_storage_avail": 52714645731.556, + "node_ephemeral_storage_free": 55931361507.556, + "node_free_memory": 6268220757.333, + "node_ingress_bytes": 1006.111, + "node_ingress_bytes_max": 1006.111, + "node_ingress_bytes_median": 1006.111, + "node_ingress_bytes_min": 1006.111, + "node_persistent_storage_avail": 52714645731.556, + "node_persistent_storage_free": 55931361507.556, + "node_provisional_memory": 5099835456.556, + "node_provisional_memory_no_overbooking": 5099636117.889, + "node_total_req": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redis" + } + } +] \ No newline at end of file diff --git a/metricbeat/module/redis/node/manifest.yml b/metricbeat/module/redis/node/manifest.yml new file mode 100644 index 00000000000..98b91f280e7 --- /dev/null +++ b/metricbeat/module/redis/node/manifest.yml @@ -0,0 +1,29 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + +# The custom processor is responsible for filtering Prometheus metrics +# not stricly related to the redis node. +processors: + - script: + lang: javascript + source: > + function process(event) { + var metrics = event.Get("prometheus.metrics"); + if (metrics == null) { + event.Cancel(); + return; + } + Object.keys(metrics).forEach(function(key) { + if (!(key.match(/^node_.*$/))) { + event.Delete("prometheus.metrics." + key); + } + }); + metrics = event.Get("prometheus.metrics"); + if (Object.keys(metrics).length == 0) { + event.Cancel(); + } + } diff --git a/metricbeat/module/redis/node/node_integration_test.go b/metricbeat/module/redis/node/node_integration_test.go new file mode 100644 index 00000000000..e6adec6471e --- /dev/null +++ b/metricbeat/module/redis/node/node_integration_test.go @@ -0,0 +1,49 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package node + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redis-enterprise") + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redis", + "metricsets": []string{"node"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/metricbeat/module/redis/node/node_test.go b/metricbeat/module/redis/node/node_test.go new file mode 100644 index 00000000000..3c64e38e84e --- /dev/null +++ b/metricbeat/module/redis/node/node_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package node + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redis", "node") +} diff --git a/metricbeat/module/redis/proxy/_meta/data.json b/metricbeat/module/redis/proxy/_meta/data.json new file mode 100644 index 00000000000..14b32d6262e --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/data.json @@ -0,0 +1,86 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "proxy" + }, + "service": { + "type": "redis", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "proxy": "1", + "instance": "127.0.0.1:8070", + "job": "redis" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0 + } + }, + "event": { + "dataset": "redis.proxy", + "module": "redis", + "duration": 51870343 + } +} diff --git a/metricbeat/module/redis/proxy/_meta/docs.asciidoc b/metricbeat/module/redis/proxy/_meta/docs.asciidoc new file mode 100644 index 00000000000..d88a4165235 --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `proxy` metricset of the redis module. The metricset is compatible with Redis Enterprise Software. diff --git a/metricbeat/module/redis/proxy/_meta/fields.yml b/metricbeat/module/redis/proxy/_meta/fields.yml new file mode 100644 index 00000000000..8033a27f5ac --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/fields.yml @@ -0,0 +1 @@ +- release: beta diff --git a/metricbeat/module/redis/proxy/_meta/testdata/config.yml b/metricbeat/module/redis/proxy/_meta/testdata/config.yml new file mode 100644 index 00000000000..361e43c5ccd --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain new file mode 100644 index 00000000000..423aaadae08 --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain @@ -0,0 +1,168 @@ +# HELP listener_acc_other_latency_max +# TYPE listener_acc_other_latency_max counter +listener_acc_other_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch_max +# TYPE listener_cmd_touch_max counter +listener_cmd_touch_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes +# TYPE listener_egress_bytes counter +listener_egress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req_max +# TYPE listener_read_req_max counter +listener_read_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_monitor_sessions_count +# TYPE listener_monitor_sessions_count counter +listener_monitor_sessions_count{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req_max +# TYPE listener_write_req_max counter +listener_write_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res_max +# TYPE listener_write_res_max counter +listener_write_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res_max +# TYPE listener_write_started_res_max counter +listener_write_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res_max +# TYPE listener_total_res_max counter +listener_total_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_other_latency +# TYPE listener_acc_other_latency counter +listener_acc_other_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res_max +# TYPE listener_total_started_res_max counter +listener_total_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res +# TYPE listener_total_started_res counter +listener_total_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req_max +# TYPE listener_other_req_max counter +listener_other_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req +# TYPE listener_write_req counter +listener_write_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res +# TYPE listener_write_res counter +listener_write_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush_max +# TYPE listener_cmd_flush_max counter +listener_cmd_flush_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch +# TYPE listener_cmd_touch counter +listener_cmd_touch{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds +# TYPE listener_auth_cmds counter +listener_auth_cmds{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes +# TYPE listener_ingress_bytes counter +listener_ingress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency +# TYPE listener_acc_write_latency counter +listener_acc_write_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_conns +# TYPE listener_conns counter +listener_conns{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res +# TYPE listener_write_started_res counter +listener_write_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency +# TYPE listener_acc_latency counter +listener_acc_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency_max +# TYPE listener_acc_read_latency_max counter +listener_acc_read_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes_max +# TYPE listener_ingress_bytes_max counter +listener_ingress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received +# TYPE listener_total_connections_received counter +listener_total_connections_received{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_req_time +# TYPE listener_last_req_time counter +listener_last_req_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res +# TYPE listener_other_res counter +listener_other_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res_max +# TYPE listener_other_started_res_max counter +listener_other_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req +# TYPE listener_other_req counter +listener_other_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded +# TYPE listener_max_connections_exceeded counter +listener_max_connections_exceeded{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get +# TYPE listener_cmd_get counter +listener_cmd_get{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res +# TYPE listener_total_res counter +listener_total_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req +# TYPE listener_total_req counter +listener_total_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res_max +# TYPE listener_read_res_max counter +listener_read_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency_max +# TYPE listener_acc_latency_max counter +listener_acc_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set +# TYPE listener_cmd_set counter +listener_cmd_set{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received_max +# TYPE listener_total_connections_received_max counter +listener_total_connections_received_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds_max +# TYPE listener_auth_cmds_max counter +listener_auth_cmds_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency_max +# TYPE listener_acc_write_latency_max counter +listener_acc_write_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors_max +# TYPE listener_auth_errors_max counter +listener_auth_errors_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req_max +# TYPE listener_total_req_max counter +listener_total_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded_max +# TYPE listener_max_connections_exceeded_max counter +listener_max_connections_exceeded_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_res_time +# TYPE listener_last_res_time counter +listener_last_res_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush +# TYPE listener_cmd_flush counter +listener_cmd_flush{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency +# TYPE listener_acc_read_latency counter +listener_acc_read_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res +# TYPE listener_read_started_res counter +listener_read_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes_max +# TYPE listener_egress_bytes_max counter +listener_egress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set_max +# TYPE listener_cmd_set_max counter +listener_cmd_set_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors +# TYPE listener_auth_errors counter +listener_auth_errors{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res +# TYPE listener_other_started_res counter +listener_other_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res_max +# TYPE listener_read_started_res_max counter +listener_read_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get_max +# TYPE listener_cmd_get_max counter +listener_cmd_get_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res_max +# TYPE listener_other_res_max counter +listener_other_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req +# TYPE listener_read_req counter +listener_read_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res +# TYPE listener_read_res counter +listener_read_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 diff --git a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json new file mode 100644 index 00000000000..77d393b99f4 --- /dev/null +++ b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json @@ -0,0 +1,111 @@ +[ + { + "event": { + "dataset": "redis.proxy", + "duration": 115000, + "module": "redis" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:56017", + "job": "prometheus" + }, + "metrics": { + "up": 1 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redis" + } + }, + { + "event": { + "dataset": "redis.proxy", + "duration": 115000, + "module": "redis" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "bdb": "1", + "cluster": "cluster.local", + "endpoint": "1:1", + "instance": "127.0.0.1:56017", + "job": "redis", + "node": "1", + "port": "12000", + "proxy": "1:1:1" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0, + "listener_cmd_set": 0, + "listener_cmd_set_max": 0, + "listener_cmd_touch": 0, + "listener_cmd_touch_max": 0, + "listener_conns": 0, + "listener_egress_bytes": 0, + "listener_egress_bytes_max": 0, + "listener_ingress_bytes": 0, + "listener_ingress_bytes_max": 0, + "listener_last_req_time": 0, + "listener_last_res_time": 0, + "listener_max_connections_exceeded": 0, + "listener_max_connections_exceeded_max": 0, + "listener_monitor_sessions_count": 0, + "listener_other_req": 0, + "listener_other_req_max": 0, + "listener_other_res": 0, + "listener_other_res_max": 0, + "listener_other_started_res": 0, + "listener_other_started_res_max": 0, + "listener_read_req": 0, + "listener_read_req_max": 0, + "listener_read_res": 0, + "listener_read_res_max": 0, + "listener_read_started_res": 0, + "listener_read_started_res_max": 0, + "listener_total_connections_received": 0, + "listener_total_connections_received_max": 0, + "listener_total_req": 0, + "listener_total_req_max": 0, + "listener_total_res": 0, + "listener_total_res_max": 0, + "listener_total_started_res": 0, + "listener_total_started_res_max": 0, + "listener_write_req": 0, + "listener_write_req_max": 0, + "listener_write_res": 0, + "listener_write_res_max": 0, + "listener_write_started_res": 0, + "listener_write_started_res_max": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redis" + } + } +] \ No newline at end of file diff --git a/metricbeat/module/redis/proxy/manifest.yml b/metricbeat/module/redis/proxy/manifest.yml new file mode 100644 index 00000000000..d7aeee836f8 --- /dev/null +++ b/metricbeat/module/redis/proxy/manifest.yml @@ -0,0 +1,29 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + +# The custom processor is responsible for filtering Prometheus metrics +# not stricly related to the redis node. +processors: + - script: + lang: javascript + source: > + function process(event) { + var metrics = event.Get("prometheus.metrics"); + if (metrics == null) { + event.Cancel(); + return; + } + Object.keys(metrics).forEach(function(key) { + if (!(key.match(/^proxy_.*$/))) { + event.Delete("prometheus.metrics." + key); + } + }); + metrics = event.Get("prometheus.metrics"); + if (Object.keys(metrics).length == 0) { + event.Cancel(); + } + } diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go new file mode 100644 index 00000000000..ddce6a149b8 --- /dev/null +++ b/metricbeat/module/redis/proxy/proxy_integration_test.go @@ -0,0 +1,49 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package proxy + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redis-enterprise") + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redis", + "metricsets": []string{"proxy"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/metricbeat/module/redis/proxy/proxy_test.go b/metricbeat/module/redis/proxy/proxy_test.go new file mode 100644 index 00000000000..c652e2ed3a2 --- /dev/null +++ b/metricbeat/module/redis/proxy/proxy_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package proxy + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redis", "proxy") +} diff --git a/metricbeat/module/redis/test_redis_enterprise.py b/metricbeat/module/redis/test_redis_enterprise.py new file mode 100644 index 00000000000..b83aaab5495 --- /dev/null +++ b/metricbeat/module/redis/test_redis_enterprise.py @@ -0,0 +1,60 @@ +import os +import redis +import sys +import unittest +from nose.plugins.attrib import attr + +sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) +import metricbeat + + +@metricbeat.parameterized_with_supported_versions +class Test(metricbeat.BaseTest): + + COMPOSE_SERVICES = ['redis'] + + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + @parameterized.expand([ + "node", + "proxy" + ]) + @attr('integration') + def test_metricset(self, metricset): + """ + Test redis enterprise metricset + """ + + if self.oss_distribution(): + self.skipTest("only oss distribution is supported") + return + + self.render_config_template(modules=[{ + "name": "redis", + "metricsets": [metricset], + "hosts": ['https://' + self.compose_host(port='8070/tcp')], + "period": "5s", + "ssl.verification_mode": "none" + }]) + proc = self.start_beat(home=self.beat_path) + self.wait_until(lambda: self.output_lines() > 0) + proc.check_kill_and_wait() + self.assert_no_logged_warnings() + + output = self.read_output_json() + self.assertGreater(len(output), 0) + + for evt in output: + self.assert_fields_are_documented(evt) + self.assertIn("prometheus", evt.keys(), evt) + self.assertIn("metrics", evt["prometheus"].keys(), evt) + self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) + + # Verify if processors are correctly setup. + for metric in evt["prometheus"]["metrics"].keys(): + assert metric.startswith(metricset + "_") + + def oss_distribution(self): + if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: + return False + + return self.COMPOSE_ENV['REDIS_DISTRIBUTION'] == 'oss' diff --git a/metricbeat/modules.d/redis-enterprise.yml.disabled b/metricbeat/modules.d/redis-enterprise.yml.disabled new file mode 100644 index 00000000000..0973526a77b --- /dev/null +++ b/metricbeat/modules.d/redis-enterprise.yml.disabled @@ -0,0 +1,11 @@ +# Module: redis +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redis.html + +- module: redis + metricsets: + - node + # - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] From 3ded1968a3b7295c566207f02696361f3fbcf3be Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 21 Feb 2020 12:04:38 +0100 Subject: [PATCH 04/30] Fix: system tests --- .../module/redis/_meta/config-enterprise.yml | 2 +- .../redis/node/node_integration_test.go | 25 ++++++++++++++----- metricbeat/module/redis/node/node_test.go | 19 +++++++++++--- metricbeat/module/redis/proxy/manifest.yml | 2 +- .../redis/proxy/proxy_integration_test.go | 25 ++++++++++++++----- metricbeat/module/redis/proxy/proxy_test.go | 19 +++++++++++--- .../module/redis/test_redis_enterprise.py | 17 +++++++------ .../modules.d/redis-enterprise.yml.disabled | 2 +- 8 files changed, 83 insertions(+), 28 deletions(-) diff --git a/metricbeat/module/redis/_meta/config-enterprise.yml b/metricbeat/module/redis/_meta/config-enterprise.yml index 58c6b2dcd0d..b6f5e0aba38 100644 --- a/metricbeat/module/redis/_meta/config-enterprise.yml +++ b/metricbeat/module/redis/_meta/config-enterprise.yml @@ -1,7 +1,7 @@ - module: redis metricsets: - node - # - proxy + - proxy period: 1m # Metrics endpoint diff --git a/metricbeat/module/redis/node/node_integration_test.go b/metricbeat/module/redis/node/node_integration_test.go index e6adec6471e..2abd2f6bab9 100644 --- a/metricbeat/module/redis/node/node_integration_test.go +++ b/metricbeat/module/redis/node/node_integration_test.go @@ -1,6 +1,19 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. // +build integration @@ -41,9 +54,9 @@ func TestFetch(t *testing.T) { func getConfig(host string) map[string]interface{} { return map[string]interface{}{ - "module": "redis", - "metricsets": []string{"node"}, - "hosts": []string{host}, + "module": "redis", + "metricsets": []string{"node"}, + "hosts": []string{host}, "ssl.verification_mode": "none", } } diff --git a/metricbeat/module/redis/node/node_test.go b/metricbeat/module/redis/node/node_test.go index 3c64e38e84e..641f2a20c24 100644 --- a/metricbeat/module/redis/node/node_test.go +++ b/metricbeat/module/redis/node/node_test.go @@ -1,6 +1,19 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. // +build !integration diff --git a/metricbeat/module/redis/proxy/manifest.yml b/metricbeat/module/redis/proxy/manifest.yml index d7aeee836f8..8fb85be9d60 100644 --- a/metricbeat/module/redis/proxy/manifest.yml +++ b/metricbeat/module/redis/proxy/manifest.yml @@ -18,7 +18,7 @@ processors: return; } Object.keys(metrics).forEach(function(key) { - if (!(key.match(/^proxy_.*$/))) { + if (!(key.match(/^listener_.*$/))) { event.Delete("prometheus.metrics." + key); } }); diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go index ddce6a149b8..91b9a7f8733 100644 --- a/metricbeat/module/redis/proxy/proxy_integration_test.go +++ b/metricbeat/module/redis/proxy/proxy_integration_test.go @@ -1,6 +1,19 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. // +build integration @@ -41,9 +54,9 @@ func TestFetch(t *testing.T) { func getConfig(host string) map[string]interface{} { return map[string]interface{}{ - "module": "redis", - "metricsets": []string{"proxy"}, - "hosts": []string{host}, + "module": "redis", + "metricsets": []string{"proxy"}, + "hosts": []string{host}, "ssl.verification_mode": "none", } } diff --git a/metricbeat/module/redis/proxy/proxy_test.go b/metricbeat/module/redis/proxy/proxy_test.go index c652e2ed3a2..b42199cda23 100644 --- a/metricbeat/module/redis/proxy/proxy_test.go +++ b/metricbeat/module/redis/proxy/proxy_test.go @@ -1,6 +1,19 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. // +build !integration diff --git a/metricbeat/module/redis/test_redis_enterprise.py b/metricbeat/module/redis/test_redis_enterprise.py index b83aaab5495..454168a79fc 100644 --- a/metricbeat/module/redis/test_redis_enterprise.py +++ b/metricbeat/module/redis/test_redis_enterprise.py @@ -1,4 +1,5 @@ import os +from parameterized import parameterized import redis import sys import unittest @@ -15,11 +16,11 @@ class Test(metricbeat.BaseTest): @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") @parameterized.expand([ - "node", - "proxy" + ("node", "node"), + ("proxy", "listener") ]) @attr('integration') - def test_metricset(self, metricset): + def test_metricset(self, metricset, metric_name_prefix): """ Test redis enterprise metricset """ @@ -33,12 +34,14 @@ def test_metricset(self, metricset): "metricsets": [metricset], "hosts": ['https://' + self.compose_host(port='8070/tcp')], "period": "5s", - "ssl.verification_mode": "none" + "extras": { + "ssl.verification_mode": "none" + } }]) proc = self.start_beat(home=self.beat_path) - self.wait_until(lambda: self.output_lines() > 0) + self.wait_until(lambda: self.output_lines() > 0, max_timeout=120) proc.check_kill_and_wait() - self.assert_no_logged_warnings() + self.assert_no_logged_warnings(replace=['SSL/TLS verifications disabled.']) output = self.read_output_json() self.assertGreater(len(output), 0) @@ -51,7 +54,7 @@ def test_metricset(self, metricset): # Verify if processors are correctly setup. for metric in evt["prometheus"]["metrics"].keys(): - assert metric.startswith(metricset + "_") + assert metric.startswith(metric_name_prefix + "_") def oss_distribution(self): if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: diff --git a/metricbeat/modules.d/redis-enterprise.yml.disabled b/metricbeat/modules.d/redis-enterprise.yml.disabled index 0973526a77b..d9d409c906b 100644 --- a/metricbeat/modules.d/redis-enterprise.yml.disabled +++ b/metricbeat/modules.d/redis-enterprise.yml.disabled @@ -4,7 +4,7 @@ - module: redis metricsets: - node - # - proxy + - proxy period: 1m # Metrics endpoint From 79a4b8877d8e060d3e4bb32996e0795f0777275c Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 21 Feb 2020 14:00:24 +0100 Subject: [PATCH 05/30] Fix: set secondary source --- metricbeat/mb/testing/data/data_test.go | 6 ++- .../redis-proxy.5.4.10-22.plain-expected.json | 50 +++++++++---------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/metricbeat/mb/testing/data/data_test.go b/metricbeat/mb/testing/data/data_test.go index 3102780e66f..8e330a3216b 100644 --- a/metricbeat/mb/testing/data/data_test.go +++ b/metricbeat/mb/testing/data/data_test.go @@ -24,12 +24,14 @@ import ( "strings" "testing" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - _ "github.com/elastic/beats/metricbeat/include" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) func TestAll(t *testing.T) { + mb.Registry.SetSecondarySource(mb.NewLightModulesSource(getModulesPath())) + configFiles, _ := filepath.Glob(getModulesPath() + "/*/*/_meta/testdata/config.yml") for _, f := range configFiles { diff --git a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json index 77d393b99f4..89607304936 100644 --- a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json +++ b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json @@ -1,28 +1,4 @@ [ - { - "event": { - "dataset": "redis.proxy", - "duration": 115000, - "module": "redis" - }, - "metricset": { - "name": "proxy", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:56017", - "job": "prometheus" - }, - "metrics": { - "up": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redis" - } - }, { "event": { "dataset": "redis.proxy", @@ -38,7 +14,7 @@ "bdb": "1", "cluster": "cluster.local", "endpoint": "1:1", - "instance": "127.0.0.1:56017", + "instance": "127.0.0.1:58281", "job": "redis", "node": "1", "port": "12000", @@ -107,5 +83,29 @@ "address": "127.0.0.1:55555", "type": "redis" } + }, + { + "event": { + "dataset": "redis.proxy", + "duration": 115000, + "module": "redis" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:58281", + "job": "prometheus" + }, + "metrics": { + "up": 1 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redis" + } } ] \ No newline at end of file From aea45faff77337dc3203816254410049a4027e8c Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 21 Feb 2020 14:36:08 +0100 Subject: [PATCH 06/30] Fix: mage check --- x-pack/libbeat/common/aws/credentials_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/libbeat/common/aws/credentials_test.go b/x-pack/libbeat/common/aws/credentials_test.go index 2e438033c9c..52b8f143362 100644 --- a/x-pack/libbeat/common/aws/credentials_test.go +++ b/x-pack/libbeat/common/aws/credentials_test.go @@ -5,9 +5,10 @@ package aws import ( + "testing" + awssdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/stretchr/testify/assert" - "testing" ) func TestGetAWSCredentials(t *testing.T) { From d0ef8103cb961c6e70fda1ae6aceee594d263acc Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 10:53:16 +0100 Subject: [PATCH 07/30] Fix: typo --- metricbeat/module/redis/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index e4b19639b11..edcbbd0f2cc 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -14,13 +14,13 @@ services: - 6379 - 8070 redis-enterprise: - image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-5.4.10-22}-enterprise-1 + image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-5.4.10-22}-enterprise-2 build: context: ./_meta dockerfile: Dockerfile.enterprise args: REDIS_DISTRIBUTION: enterprise - REDIS_VERSION: ${REDIS_VERSION:-:5.4.10-22} + REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} privileged: true ports: - 127.0.0.1:8070:8070 From 0d886743f3534aadb21f5eb9d8282217c471284e Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 12:52:38 +0100 Subject: [PATCH 08/30] Try: increase timeout --- metricbeat/module/redis/_meta/Dockerfile.enterprise | 4 ---- metricbeat/module/redis/node/node_integration_test.go | 5 ++--- metricbeat/module/redis/proxy/proxy_integration_test.go | 7 +++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/metricbeat/module/redis/_meta/Dockerfile.enterprise b/metricbeat/module/redis/_meta/Dockerfile.enterprise index 12e72f7221a..9b9dfeaed7e 100644 --- a/metricbeat/module/redis/_meta/Dockerfile.enterprise +++ b/metricbeat/module/redis/_meta/Dockerfile.enterprise @@ -4,7 +4,3 @@ FROM redislabs/redis:${REDIS_VERSION} # Wait for the health endpoint to have monitors information ADD healthcheck.sh / HEALTHCHECK --interval=1s --retries=300 CMD /healthcheck.sh - -# RUN /opt/redislabs/sbin/supervisord_prestart_script.sh -# RUN rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 -# RUN curl -k -u "cihan@redislabs.com:redislabs123" --request POST --url "https://localhost:9443/v1/bdbs" --header 'content-type: application/json' --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' diff --git a/metricbeat/module/redis/node/node_integration_test.go b/metricbeat/module/redis/node/node_integration_test.go index 2abd2f6bab9..fb25600a2ae 100644 --- a/metricbeat/module/redis/node/node_integration_test.go +++ b/metricbeat/module/redis/node/node_integration_test.go @@ -22,14 +22,13 @@ package node import ( "os" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/elastic/beats/libbeat/tests/compose" "github.com/elastic/beats/metricbeat/mb" mbtest "github.com/elastic/beats/metricbeat/mb/testing" - - // Register input module and metricset _ "github.com/elastic/beats/metricbeat/module/prometheus" _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" ) @@ -41,7 +40,7 @@ func init() { } func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise") + service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(10*time.Minute)) f := mbtest.NewFetcher(t, getConfig(service.Host())) events, errs := f.FetchEvents() diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go index 91b9a7f8733..9a744e26f3e 100644 --- a/metricbeat/module/redis/proxy/proxy_integration_test.go +++ b/metricbeat/module/redis/proxy/proxy_integration_test.go @@ -15,21 +15,20 @@ // specific language governing permissions and limitations // under the License. -// +build integration +// build integration package proxy import ( "os" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/elastic/beats/libbeat/tests/compose" "github.com/elastic/beats/metricbeat/mb" mbtest "github.com/elastic/beats/metricbeat/mb/testing" - - // Register input module and metricset _ "github.com/elastic/beats/metricbeat/module/prometheus" _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" ) @@ -41,7 +40,7 @@ func init() { } func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise") + service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(10*time.Minute)) f := mbtest.NewFetcher(t, getConfig(service.Host())) events, errs := f.FetchEvents() From 08c0b6ba290d56c447b5821320911032a8b90d8c Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 13:51:17 +0100 Subject: [PATCH 09/30] Shorten timeout --- metricbeat/module/redis/node/node_integration_test.go | 2 +- metricbeat/module/redis/proxy/proxy_integration_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metricbeat/module/redis/node/node_integration_test.go b/metricbeat/module/redis/node/node_integration_test.go index fb25600a2ae..152956a5c84 100644 --- a/metricbeat/module/redis/node/node_integration_test.go +++ b/metricbeat/module/redis/node/node_integration_test.go @@ -40,7 +40,7 @@ func init() { } func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(10*time.Minute)) + service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(5*time.Minute)) f := mbtest.NewFetcher(t, getConfig(service.Host())) events, errs := f.FetchEvents() diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go index 9a744e26f3e..effa2c5eaae 100644 --- a/metricbeat/module/redis/proxy/proxy_integration_test.go +++ b/metricbeat/module/redis/proxy/proxy_integration_test.go @@ -40,7 +40,7 @@ func init() { } func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(10*time.Minute)) + service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(5*time.Minute)) f := mbtest.NewFetcher(t, getConfig(service.Host())) events, errs := f.FetchEvents() From bb7e861a7839d1cb2fcef10a02698d4195a36c60 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 14:01:18 +0100 Subject: [PATCH 10/30] Fix --- metricbeat/module/redis/proxy/proxy_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go index effa2c5eaae..bbfee6e9b3e 100644 --- a/metricbeat/module/redis/proxy/proxy_integration_test.go +++ b/metricbeat/module/redis/proxy/proxy_integration_test.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -// build integration +// +build integration package proxy From 1710d2013233ea5bc4782877c4dbeb60167b20b5 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 14:06:03 +0100 Subject: [PATCH 11/30] Fix --- metricbeat/module/redis/module.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/metricbeat/module/redis/module.yml b/metricbeat/module/redis/module.yml index 6addb1d4881..2722441f03c 100644 --- a/metricbeat/module/redis/module.yml +++ b/metricbeat/module/redis/module.yml @@ -2,6 +2,3 @@ name: redis metricsets: - node - proxy -dashboards: - - id: AV4YjZ5pux-M-tCAunxK - file: Metricbeat-redis-overview.json From 8999ed98d1dad2bb3964e5a3230da13fabcc9b37 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 15:18:50 +0100 Subject: [PATCH 12/30] Fix: use proper port --- metricbeat/module/redis/docker-compose.yml | 2 +- metricbeat/module/redis/info/info_integration_test.go | 4 ++-- metricbeat/module/redis/key/key_integration_test.go | 4 ++-- metricbeat/module/redis/keyspace/keyspace_integration_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index edcbbd0f2cc..ec3091f997b 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -23,4 +23,4 @@ services: REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} privileged: true ports: - - 127.0.0.1:8070:8070 + - 8070 diff --git a/metricbeat/module/redis/info/info_integration_test.go b/metricbeat/module/redis/info/info_integration_test.go index 576103c75d3..e650c6be365 100644 --- a/metricbeat/module/redis/info/info_integration_test.go +++ b/metricbeat/module/redis/info/info_integration_test.go @@ -32,7 +32,7 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) events, err := mbtest.ReportingFetchV2Error(ms) if err != nil { t.Fatal("fetch", err) @@ -53,7 +53,7 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) err := mbtest.WriteEventsReporterV2Error(ms, t, "") if err != nil { t.Fatal("write", err) diff --git a/metricbeat/module/redis/key/key_integration_test.go b/metricbeat/module/redis/key/key_integration_test.go index 2a804d9a63b..60a943106b6 100644 --- a/metricbeat/module/redis/key/key_integration_test.go +++ b/metricbeat/module/redis/key/key_integration_test.go @@ -36,7 +36,7 @@ func TestFetch(t *testing.T) { addEntry(t, service.Host(), "foo", 1) - ms := mbtest.NewFetcher(t, getConfig(service.Host())) + ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) events, err := ms.FetchEvents() if err != nil { t.Fatal("fetch", err) @@ -51,7 +51,7 @@ func TestData(t *testing.T) { addEntry(t, service.Host(), "foo", 1) - ms := mbtest.NewFetcher(t, getConfig(service.Host())) + ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) ms.WriteEvents(t, "") } diff --git a/metricbeat/module/redis/keyspace/keyspace_integration_test.go b/metricbeat/module/redis/keyspace/keyspace_integration_test.go index e0b51c25dde..56e03a1ef55 100644 --- a/metricbeat/module/redis/keyspace/keyspace_integration_test.go +++ b/metricbeat/module/redis/keyspace/keyspace_integration_test.go @@ -36,7 +36,7 @@ func TestFetch(t *testing.T) { addEntry(t, service.Host()) // Fetch data - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) events, err := mbtest.ReportingFetchV2Error(ms) if err != nil { t.Fatal("fetch", err) @@ -60,7 +60,7 @@ func TestData(t *testing.T) { addEntry(t, service.Host()) - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) err := mbtest.WriteEventsReporterV2Error(ms, t, "") if err != nil { t.Fatal("write", err) From 6fb83607d80f3f1cb15cce6d66a28a3cad693a4d Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Mon, 24 Feb 2020 17:43:15 +0100 Subject: [PATCH 13/30] Fix: use proper port --- metricbeat/module/redis/key/key_integration_test.go | 8 ++++---- .../module/redis/keyspace/keyspace_integration_test.go | 4 ++-- metricbeat/module/redis/metricset_integration_test.go | 2 +- metricbeat/module/redis/redis_integration_test.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/metricbeat/module/redis/key/key_integration_test.go b/metricbeat/module/redis/key/key_integration_test.go index 60a943106b6..8b212c10053 100644 --- a/metricbeat/module/redis/key/key_integration_test.go +++ b/metricbeat/module/redis/key/key_integration_test.go @@ -34,7 +34,7 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.Host(), "foo", 1) + addEntry(t, service.HostForPort(6379), "foo", 1) ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) events, err := ms.FetchEvents() @@ -49,7 +49,7 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.Host(), "foo", 1) + addEntry(t, service.HostForPort(6379), "foo", 1) ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) ms.WriteEvents(t, "") @@ -66,10 +66,10 @@ func TestFetchMultipleKeyspaces(t *testing.T) { expectedEvents := len(expectedKeyspaces) for name, keyspace := range expectedKeyspaces { - addEntry(t, service.Host(), name, keyspace) + addEntry(t, service.HostForPort(6379), name, keyspace) } - config := getConfig(service.Host()) + config := getConfig(service.HostForPort(6379)) config["key.patterns"] = []map[string]interface{}{ { "pattern": "foo", diff --git a/metricbeat/module/redis/keyspace/keyspace_integration_test.go b/metricbeat/module/redis/keyspace/keyspace_integration_test.go index 56e03a1ef55..9c7d6dd3ddb 100644 --- a/metricbeat/module/redis/keyspace/keyspace_integration_test.go +++ b/metricbeat/module/redis/keyspace/keyspace_integration_test.go @@ -33,7 +33,7 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.Host()) + addEntry(t, service.HostForPort(6379)) // Fetch data ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) @@ -58,7 +58,7 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.Host()) + addEntry(t, service.HostForPort(6379)) ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) err := mbtest.WriteEventsReporterV2Error(ms, t, "") diff --git a/metricbeat/module/redis/metricset_integration_test.go b/metricbeat/module/redis/metricset_integration_test.go index 7d972030bb3..80e539051f4 100644 --- a/metricbeat/module/redis/metricset_integration_test.go +++ b/metricbeat/module/redis/metricset_integration_test.go @@ -40,7 +40,7 @@ func TestPasswords(t *testing.T) { t.Skip("Changing password affects other tests, see https://github.com/elastic/beats/issues/10955") service := compose.EnsureUp(t, "redis") - host := service.Host() + host := service.HostForPort(6379) registry := mb.NewRegister() err := registry.AddModule("redis", mb.DefaultModuleFactory) diff --git a/metricbeat/module/redis/redis_integration_test.go b/metricbeat/module/redis/redis_integration_test.go index c33df1556f0..280a4af93f9 100644 --- a/metricbeat/module/redis/redis_integration_test.go +++ b/metricbeat/module/redis/redis_integration_test.go @@ -33,7 +33,7 @@ import ( func TestFetchRedisInfo(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.Host() + host := service.HostForPort(6379) conn, err := rd.Dial("tcp", host) if err != nil { @@ -69,7 +69,7 @@ func TestFetchRedisInfo(t *testing.T) { func TestFetchKeys(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.Host() + host := service.HostForPort(6379) conn, err := rd.Dial("tcp", host) if err != nil { @@ -96,7 +96,7 @@ func TestFetchKeys(t *testing.T) { func TestFetchKeyInfo(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.Host() + host := service.HostForPort(6379) conn, err := rd.Dial("tcp", host) if err != nil { From 792df871ef93f389a579f1249abd7a3ff1ad7e5e Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 09:13:37 +0100 Subject: [PATCH 14/30] Fix: dashboard setup issue --- metricbeat/module/redis/fields.go | 2 +- metricbeat/module/redis/node/_meta/fields.yml | 5 ++++- metricbeat/module/redis/proxy/_meta/fields.yml | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/metricbeat/module/redis/fields.go b/metricbeat/module/redis/fields.go index a38a8737091..2d03a3dad15 100644 --- a/metricbeat/module/redis/fields.go +++ b/metricbeat/module/redis/fields.go @@ -32,5 +32,5 @@ func init() { // AssetRedis returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/redis. func AssetRedis() string { - return "eJzkXF9v27YWf++nOMh9WAYk6u7D9hAMA5q13S3WtUXS4mJPCiUd2ZwpUiMpp+6nvyAp2bJMSvIfORmuH1rElnh+5/D8JQ95DQtc3YDEjKoXAJpqhjdwcWf+vngBkKFKJS01FfwGfnkBAGB/gwK1pKmCVDCGqcYMcik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SR9t7/CDVhqbtkG154rm/rg1nT2S5RqGpYgZBWCFlCQb92jrXsjDKIuSYrRcqj8OgfsTm89E2JVlbWIVbMrUhDKIXNnd8nA4dYWckGVmnmfNSeUYXYg4HCBViWqSuzxDI5sDuS/MZHs6HBZJa9UlUBD03mw5qawKmlHDCt2jbokWqP0PDcj6prmBNDhosZ2m8S5kKu4mieN2G/ktA0uuU2Auj2cBU2l6DdyhtcqbL2NcWqPqMdKpCucxUZ3nXRNxyDndqH3j/e/3b7+8hbKSpZCTek1sAEydo5axVqSdIVZbExndvTWPmuKFr1FsWnBwyUp7Up8whAEZ/Z6AJON2C/qC+fGOdw9iz6777QXOphsr9PPV6LMhawv5KiPptuN5t7x9DqjncjKI/hUkghp4pePKdsUtr1wJ3Di/jCWVriJZ58hp3dLouEBZQOcbTrQBzag9/E+wjT0EKsVLcujJL+1evHAxCKynWbedRcP7BHIv5qxrFdi4mHrTD0+qJMdvOjTPeSO0BVuOleE7p+BsWle55XD7/40/3rF41/0GpHQ77ixI47cQ7W30HoCya+c/l0hUOdg9ZIqmypf/r+J0kZ5jMzg5yZP++X6Z4Phl7F7+gyi88rFvG6vZFqKB3sn0/2XPz+/9Vzh6sXDkC/08kyK/MEO1mQIVlydjJ5hYa8/NPJkVGn1sqZuv1FaUr5QLyElMqOcMKo37gfUakyqLgpHWvcr5WM5uat347VoxvbZoJ35Uw3RDjJ0Ya+1yFqg9uF5b+09pxH9XiMGe+EAzSmGrmtpo8R6EZ9vGl+vUZIFgtZshK4nbzuWaC/61HVUW9BN0eRTobReeHfv1a+frYokqIeUpLMD9208/IyN+p8AAAD//5na3lw=" } diff --git a/metricbeat/module/redis/node/_meta/fields.yml b/metricbeat/module/redis/node/_meta/fields.yml index 8033a27f5ac..4d523079ac9 100644 --- a/metricbeat/module/redis/node/_meta/fields.yml +++ b/metricbeat/module/redis/node/_meta/fields.yml @@ -1 +1,4 @@ -- release: beta +- name: node + type: group + release: beta + fields: diff --git a/metricbeat/module/redis/proxy/_meta/fields.yml b/metricbeat/module/redis/proxy/_meta/fields.yml index 8033a27f5ac..1c1fa1b036d 100644 --- a/metricbeat/module/redis/proxy/_meta/fields.yml +++ b/metricbeat/module/redis/proxy/_meta/fields.yml @@ -1 +1,4 @@ -- release: beta +- name: proxy + type: group + release: beta + fields: From 79316ee7ea9d1e7f37a061516436198faa626920 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 10:18:08 +0100 Subject: [PATCH 15/30] OSX: increase limit of open files --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a3171ff7061..06ccbfa4e89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -235,6 +235,7 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv==16.7.9; fi + - if [ $TRAVIS_OS_NAME = osx ]; then ulimit -n 1024; fi # Skips installations step From a8f067342e927ae69bb20cdf45a054133eea1300 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 10:56:14 +0100 Subject: [PATCH 16/30] Fix: skip integration tests --- metricbeat/module/redis/test_redis_enterprise.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/metricbeat/module/redis/test_redis_enterprise.py b/metricbeat/module/redis/test_redis_enterprise.py index 454168a79fc..600d1544a44 100644 --- a/metricbeat/module/redis/test_redis_enterprise.py +++ b/metricbeat/module/redis/test_redis_enterprise.py @@ -3,7 +3,6 @@ import redis import sys import unittest -from nose.plugins.attrib import attr sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) import metricbeat @@ -14,12 +13,11 @@ class Test(metricbeat.BaseTest): COMPOSE_SERVICES = ['redis'] - @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") @parameterized.expand([ ("node", "node"), ("proxy", "listener") ]) - @attr('integration') + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") def test_metricset(self, metricset, metric_name_prefix): """ Test redis enterprise metricset From 76bc10920e7ecf88837d96c3280c75ce0681223d Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 11:36:00 +0100 Subject: [PATCH 17/30] Use metrics_filters --- metricbeat/module/redis/node/manifest.yml | 25 ++-------------------- metricbeat/module/redis/proxy/manifest.yml | 25 ++-------------------- 2 files changed, 4 insertions(+), 46 deletions(-) diff --git a/metricbeat/module/redis/node/manifest.yml b/metricbeat/module/redis/node/manifest.yml index 98b91f280e7..fbb4c5781b3 100644 --- a/metricbeat/module/redis/node/manifest.yml +++ b/metricbeat/module/redis/node/manifest.yml @@ -4,26 +4,5 @@ input: metricset: collector defaults: metrics_path: / - -# The custom processor is responsible for filtering Prometheus metrics -# not stricly related to the redis node. -processors: - - script: - lang: javascript - source: > - function process(event) { - var metrics = event.Get("prometheus.metrics"); - if (metrics == null) { - event.Cancel(); - return; - } - Object.keys(metrics).forEach(function(key) { - if (!(key.match(/^node_.*$/))) { - event.Delete("prometheus.metrics." + key); - } - }); - metrics = event.Get("prometheus.metrics"); - if (Object.keys(metrics).length == 0) { - event.Cancel(); - } - } + metrics_filters: + include: ["node_*"] diff --git a/metricbeat/module/redis/proxy/manifest.yml b/metricbeat/module/redis/proxy/manifest.yml index 8fb85be9d60..62327fbd5cc 100644 --- a/metricbeat/module/redis/proxy/manifest.yml +++ b/metricbeat/module/redis/proxy/manifest.yml @@ -4,26 +4,5 @@ input: metricset: collector defaults: metrics_path: / - -# The custom processor is responsible for filtering Prometheus metrics -# not stricly related to the redis node. -processors: - - script: - lang: javascript - source: > - function process(event) { - var metrics = event.Get("prometheus.metrics"); - if (metrics == null) { - event.Cancel(); - return; - } - Object.keys(metrics).forEach(function(key) { - if (!(key.match(/^listener_.*$/))) { - event.Delete("prometheus.metrics." + key); - } - }); - metrics = event.Get("prometheus.metrics"); - if (Object.keys(metrics).length == 0) { - event.Cancel(); - } - } + metrics_filters: + include: ["listener_*"] From f96dd2fa2d0c76c4c4e6499b36f604c3c2054f64 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 11:57:17 +0100 Subject: [PATCH 18/30] Fix: skip 'up' metric --- metricbeat/module/redis/test_redis_enterprise.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metricbeat/module/redis/test_redis_enterprise.py b/metricbeat/module/redis/test_redis_enterprise.py index 600d1544a44..cad3d128042 100644 --- a/metricbeat/module/redis/test_redis_enterprise.py +++ b/metricbeat/module/redis/test_redis_enterprise.py @@ -50,9 +50,8 @@ def test_metricset(self, metricset, metric_name_prefix): self.assertIn("metrics", evt["prometheus"].keys(), evt) self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) - # Verify if processors are correctly setup. for metric in evt["prometheus"]["metrics"].keys(): - assert metric.startswith(metric_name_prefix + "_") + assert metric == "up" or metric.startswith(metric_name_prefix + "_") def oss_distribution(self): if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: From 34b5fcbcde487b73dbed2a76b0069ff4240ed7b6 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 25 Feb 2020 15:47:09 +0100 Subject: [PATCH 19/30] Container inspection --- libbeat/tests/compose/compose.go | 7 ++++++ libbeat/tests/compose/project.go | 9 ++++++++ libbeat/tests/compose/wrapper.go | 38 ++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/libbeat/tests/compose/compose.go b/libbeat/tests/compose/compose.go index 293e57e8784..e9011ca9645 100644 --- a/libbeat/tests/compose/compose.go +++ b/libbeat/tests/compose/compose.go @@ -81,6 +81,13 @@ func EnsureUp(t testing.TB, service string, options ...UpOption) HostInfo { // Wait for health err = compose.Wait(upOptions.Timeout, service) if err != nil { + inspected, inspectErr := compose.Inspect(service) + if inspectErr != nil { + t.Logf("inspection error: %v", err) + } else { + t.Logf("Container state (service: '%s'): %s", service, inspected) + } + t.Fatal(err) } diff --git a/libbeat/tests/compose/project.go b/libbeat/tests/compose/project.go index f4ebfb904e5..602b38b83ae 100644 --- a/libbeat/tests/compose/project.go +++ b/libbeat/tests/compose/project.go @@ -92,6 +92,7 @@ type Driver interface { Kill(ctx context.Context, signal string, service string) error KillOld(ctx context.Context, except []string) error Ps(ctx context.Context, filter ...string) ([]ContainerStatus, error) + Inspect(ctx context.Context, serviceName string) (string, error) LockFile() string @@ -227,6 +228,14 @@ func (c *Project) KillOld(except []string) error { return c.Driver.KillOld(context.TODO(), except) } +// Inspect a container +func (c *Project) Inspect(service string) (string, error) { + c.Lock() + defer c.Unlock() + + return c.Driver.Inspect(context.Background(), service) +} + // Lock acquires the lock (300s) timeout // Normally it should only be seconds that the lock is used, but in some cases it can take longer. // Pid is written to the lock file, and it is used to check if process holding the process is still diff --git a/libbeat/tests/compose/wrapper.go b/libbeat/tests/compose/wrapper.go index 35e37098a38..d5bb53869fc 100644 --- a/libbeat/tests/compose/wrapper.go +++ b/libbeat/tests/compose/wrapper.go @@ -21,6 +21,7 @@ import ( "archive/tar" "bytes" "context" + "encoding/json" "fmt" "net" "os" @@ -371,6 +372,43 @@ func (d *wrapperDriver) serviceNames(ctx context.Context) ([]string, error) { return strings.Fields(stdout.String()), nil } +// Inspect a container. +func (d *wrapperDriver) Inspect(ctx context.Context, serviceName string) (string, error) { + list, err := d.client.ContainerList(ctx, types.ContainerListOptions{All: true}) + if err != nil { + return "", errors.Wrap(err, "listing containers to be inspected") + } + + var found bool + var c types.Container + for _, container := range list { + aServiceName, ok := container.Labels[labelComposeService] + if ok && serviceName == aServiceName { + c = container + found = true + break + } + } + + if !found { + return "", errors.Wrap(err, "container not found") + } + + inspect, err := d.client.ContainerInspect(ctx, c.ID) + if err != nil { + return "", errors.Wrap(err, "container failed inspection") + } else if inspect.State == nil { + return "empty container state", nil + } + + state, err := json.Marshal(inspect.State) + if err != nil { + return "", errors.Wrap(err, "container inspection failed") + } + + return string(state), nil +} + func makeFilter(project, service string, projectFilter Filter) filters.Args { f := filters.NewArgs() f.Add("label", fmt.Sprintf("%s=%s", labelComposeProject, project)) From 666e6ebd2e40a41dfa4c04871d930303075f4140 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 14:46:45 +0100 Subject: [PATCH 20/30] Remove enterprise code --- metricbeat/docs/fields.asciidoc | 1332 +++++++++++++++++ metricbeat/docs/modules/redis.asciidoc | 1 + metricbeat/docs/modules/redis/info.asciidoc | 5 +- metricbeat/docs/modules/redis/key.asciidoc | 4 +- .../docs/modules/redis/keyspace.asciidoc | 5 +- metricbeat/docs/modules/redis/node.asciidoc | 4 +- metricbeat/docs/modules/redis/proxy.asciidoc | 4 +- metricbeat/docs/modules_list.asciidoc | 5 + .../_meta/{Dockerfile.oss => Dockerfile} | 0 .../module/redis/_meta/Dockerfile.enterprise | 6 - .../module/redis/_meta/config-enterprise.yml | 8 - metricbeat/module/redis/_meta/docs.asciidoc | 3 - metricbeat/module/redis/_meta/healthcheck.sh | 21 - .../module/redis/_meta/supported-versions.yml | 11 +- metricbeat/module/redis/docker-compose.yml | 16 +- metricbeat/module/redis/fields.go | 2 +- .../redis/info/info_integration_test.go | 4 +- .../module/redis/key/key_integration_test.go | 12 +- .../keyspace/keyspace_integration_test.go | 8 +- .../redis/metricset_integration_test.go | 2 +- metricbeat/module/redis/module.yml | 6 +- metricbeat/module/redis/node/_meta/data.json | 84 -- .../module/redis/node/_meta/docs.asciidoc | 1 - metricbeat/module/redis/node/_meta/fields.yml | 4 - .../redis/node/_meta/testdata/config.yml | 4 - .../_meta/testdata/redis-node.5.4.10-22.plain | 144 -- .../redis-node.5.4.10-22.plain-expected.json | 99 -- metricbeat/module/redis/node/manifest.yml | 8 - .../redis/node/node_integration_test.go | 61 - metricbeat/module/redis/node/node_test.go | 45 - metricbeat/module/redis/proxy/_meta/data.json | 86 -- .../module/redis/proxy/_meta/docs.asciidoc | 1 - .../module/redis/proxy/_meta/fields.yml | 4 - .../redis/proxy/_meta/testdata/config.yml | 4 - .../testdata/redis-proxy.5.4.10-22.plain | 168 --- .../redis-proxy.5.4.10-22.plain-expected.json | 111 -- metricbeat/module/redis/proxy/manifest.yml | 8 - .../redis/proxy/proxy_integration_test.go | 61 - metricbeat/module/redis/proxy/proxy_test.go | 45 - .../module/redis/redis_integration_test.go | 6 +- metricbeat/module/redis/test_redis.py | 22 - .../module/redis/test_redis_enterprise.py | 60 - .../modules.d/redis-enterprise.yml.disabled | 11 - 43 files changed, 1372 insertions(+), 1124 deletions(-) rename metricbeat/module/redis/_meta/{Dockerfile.oss => Dockerfile} (100%) delete mode 100644 metricbeat/module/redis/_meta/Dockerfile.enterprise delete mode 100644 metricbeat/module/redis/_meta/config-enterprise.yml delete mode 100755 metricbeat/module/redis/_meta/healthcheck.sh delete mode 100644 metricbeat/module/redis/node/_meta/data.json delete mode 100644 metricbeat/module/redis/node/_meta/docs.asciidoc delete mode 100644 metricbeat/module/redis/node/_meta/fields.yml delete mode 100644 metricbeat/module/redis/node/_meta/testdata/config.yml delete mode 100644 metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain delete mode 100644 metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json delete mode 100644 metricbeat/module/redis/node/manifest.yml delete mode 100644 metricbeat/module/redis/node/node_integration_test.go delete mode 100644 metricbeat/module/redis/node/node_test.go delete mode 100644 metricbeat/module/redis/proxy/_meta/data.json delete mode 100644 metricbeat/module/redis/proxy/_meta/docs.asciidoc delete mode 100644 metricbeat/module/redis/proxy/_meta/fields.yml delete mode 100644 metricbeat/module/redis/proxy/_meta/testdata/config.yml delete mode 100644 metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain delete mode 100644 metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json delete mode 100644 metricbeat/module/redis/proxy/manifest.yml delete mode 100644 metricbeat/module/redis/proxy/proxy_integration_test.go delete mode 100644 metricbeat/module/redis/proxy/proxy_test.go delete mode 100644 metricbeat/module/redis/test_redis_enterprise.py delete mode 100644 metricbeat/modules.d/redis-enterprise.yml.disabled diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 6394e568e15..07220608d61 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -65,6 +65,7 @@ grouped in the following categories: * <> * <> * <> +* <> * <> * <> * <> @@ -32433,6 +32434,1337 @@ type: long +*`redis.keyspace.id`*:: ++ +-- +Keyspace identifier. + + +type: keyword + +-- + +*`redis.keyspace.avg_ttl`*:: ++ +-- +Average ttl. + + +type: long + +-- + +*`redis.keyspace.keys`*:: ++ +-- +Number of keys in the keyspace. + + +type: long + +-- + +*`redis.keyspace.expires`*:: ++ +-- + + +type: long + +-- + +[[exported-fields-redis]] +== Redis fields + +Redis metrics collected from Redis. + + + +[float] +=== redis + +`redis` contains the information and statistics from Redis. + + + +[float] +=== info + +`info` contains the information and statistics returned by the `INFO` command. + + + +[float] +=== clients + +Redis client stats. + + + +*`redis.info.clients.connected`*:: ++ +-- +Number of client connections (excluding connections from slaves). + + +type: long + +-- + +*`redis.info.clients.longest_output_list`*:: ++ +-- + +deprecated:[6.5.0] + +Longest output list among current client connections (replaced by max_output_buffer). + + +type: long + +-- + +*`redis.info.clients.max_output_buffer`*:: ++ +-- +Longest output list among current client connections. + + +type: long + +-- + +*`redis.info.clients.biggest_input_buf`*:: ++ +-- + +deprecated:[6.5.0] + +Biggest input buffer among current client connections (replaced by max_input_buffer). + + +type: long + +-- + +*`redis.info.clients.max_input_buffer`*:: ++ +-- +Biggest input buffer among current client connections (on redis 5.0). + + +type: long + +-- + +*`redis.info.clients.blocked`*:: ++ +-- +Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH). + + +type: long + +-- + +[float] +=== cluster + +Redis cluster information. + + + +*`redis.info.cluster.enabled`*:: ++ +-- +Indicates that the Redis cluster is enabled. + + +type: boolean + +-- + +[float] +=== cpu + +Redis CPU stats + + + +*`redis.info.cpu.used.sys`*:: ++ +-- +System CPU consumed by the Redis server. + + +type: scaled_float + +-- + +*`redis.info.cpu.used.sys_children`*:: ++ +-- +User CPU consumed by the Redis server. + + +type: scaled_float + +-- + +*`redis.info.cpu.used.user`*:: ++ +-- +System CPU consumed by the background processes. + + +type: scaled_float + +-- + +*`redis.info.cpu.used.user_children`*:: ++ +-- +User CPU consumed by the background processes. + + +type: scaled_float + +-- + +[float] +=== memory + +Redis memory stats. + + + +*`redis.info.memory.used.value`*:: ++ +-- +Total number of bytes allocated by Redis. + + +type: long + +format: bytes + +-- + +*`redis.info.memory.used.rss`*:: ++ +-- +Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size). + + +type: long + +format: bytes + +-- + +*`redis.info.memory.used.peak`*:: ++ +-- +Peak memory consumed by Redis. + + +type: long + +format: bytes + +-- + +*`redis.info.memory.used.lua`*:: ++ +-- +Used memory by the Lua engine. + + +type: long + +format: bytes + +-- + +*`redis.info.memory.used.dataset`*:: ++ +-- +The size in bytes of the dataset + + +type: long + +format: bytes + +-- + +*`redis.info.memory.max.value`*:: ++ +-- +Memory limit. + + +type: long + +format: bytes + +-- + +*`redis.info.memory.max.policy`*:: ++ +-- +Eviction policy to use when memory limit is reached. + + +type: keyword + +-- + +*`redis.info.memory.fragmentation.ratio`*:: ++ +-- +Ratio between used_memory_rss and used_memory + + +type: float + +-- + +*`redis.info.memory.fragmentation.bytes`*:: ++ +-- +Bytes between used_memory_rss and used_memory + + +type: long + +format: bytes + +-- + +*`redis.info.memory.active_defrag.is_running`*:: ++ +-- +Flag indicating if active defragmentation is active + + +type: boolean + +-- + +*`redis.info.memory.allocator`*:: ++ +-- +Memory allocator. + + +type: keyword + +-- + + +*`redis.info.memory.allocator_stats.allocated`*:: ++ +-- +Allocated memory + + +type: long + +format: bytes + +-- + +*`redis.info.memory.allocator_stats.active`*:: ++ +-- +Active memeory + + +type: long + +format: bytes + +-- + +*`redis.info.memory.allocator_stats.resident`*:: ++ +-- +Resident memory + + +type: long + +format: bytes + +-- + +*`redis.info.memory.allocator_stats.fragmentation.ratio`*:: ++ +-- +Fragmentation ratio + + +type: float + +-- + +*`redis.info.memory.allocator_stats.fragmentation.bytes`*:: ++ +-- +Fragmented bytes + + +type: long + +format: bytes + +-- + +*`redis.info.memory.allocator_stats.rss.ratio`*:: ++ +-- +Resident ratio + + +type: float + +-- + +*`redis.info.memory.allocator_stats.rss.bytes`*:: ++ +-- +Resident bytes + + +type: long + +format: bytes + +-- + +[float] +=== persistence + +Redis CPU stats. + + + +*`redis.info.persistence.loading`*:: ++ +-- +Flag indicating if the load of a dump file is on-going + + +type: boolean + +-- + +[float] +=== rdb + +Provides information about RDB persistence + + + +*`redis.info.persistence.rdb.last_save.changes_since`*:: ++ +-- +Number of changes since the last dump + + +type: long + +-- + +*`redis.info.persistence.rdb.last_save.time`*:: ++ +-- +Epoch-based timestamp of last successful RDB save + + +type: long + +-- + +*`redis.info.persistence.rdb.bgsave.in_progress`*:: ++ +-- +Flag indicating a RDB save is on-going + + +type: boolean + +-- + +*`redis.info.persistence.rdb.bgsave.last_status`*:: ++ +-- +Status of the last RDB save operation + + +type: keyword + +-- + +*`redis.info.persistence.rdb.bgsave.last_time.sec`*:: ++ +-- +Duration of the last RDB save operation in seconds + + +type: long + +format: duration + +-- + +*`redis.info.persistence.rdb.bgsave.current_time.sec`*:: ++ +-- +Duration of the on-going RDB save operation if any + + +type: long + +format: duration + +-- + +*`redis.info.persistence.rdb.copy_on_write.last_size`*:: ++ +-- +The size in bytes of copy-on-write allocations during the last RBD save operation + + +type: long + +format: bytes + +-- + +[float] +=== aof + +Provides information about AOF persitence + + + +*`redis.info.persistence.aof.enabled`*:: ++ +-- +Flag indicating AOF logging is activated + + +type: boolean + +-- + +*`redis.info.persistence.aof.rewrite.in_progress`*:: ++ +-- +Flag indicating a AOF rewrite operation is on-going + + +type: boolean + +-- + +*`redis.info.persistence.aof.rewrite.scheduled`*:: ++ +-- +Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete. + + +type: boolean + +-- + +*`redis.info.persistence.aof.rewrite.last_time.sec`*:: ++ +-- +Duration of the last AOF rewrite operation in seconds + + +type: long + +format: duration + +-- + +*`redis.info.persistence.aof.rewrite.current_time.sec`*:: ++ +-- +Duration of the on-going AOF rewrite operation if any + + +type: long + +format: duration + +-- + +*`redis.info.persistence.aof.rewrite.buffer.size`*:: ++ +-- +Size of the AOF rewrite buffer + + +type: long + +format: bytes + +-- + +*`redis.info.persistence.aof.bgrewrite.last_status`*:: ++ +-- +Status of the last AOF rewrite operatio + + +type: keyword + +-- + +*`redis.info.persistence.aof.write.last_status`*:: ++ +-- +Status of the last write operation to the AOF + + +type: keyword + +-- + +*`redis.info.persistence.aof.copy_on_write.last_size`*:: ++ +-- +The size in bytes of copy-on-write allocations during the last RBD save operation + + +type: long + +format: bytes + +-- + +*`redis.info.persistence.aof.buffer.size`*:: ++ +-- +Size of the AOF buffer + + +type: long + +format: bytes + +-- + +*`redis.info.persistence.aof.size.current`*:: ++ +-- +AOF current file size + + +type: long + +format: bytes + +-- + +*`redis.info.persistence.aof.size.base`*:: ++ +-- +AOF file size on latest startup or rewrite + + +type: long + +format: bytes + +-- + +*`redis.info.persistence.aof.fsync.pending`*:: ++ +-- +Number of fsync pending jobs in background I/O queue + + +type: long + +-- + +*`redis.info.persistence.aof.fsync.delayed`*:: ++ +-- +Delayed fsync counter + + +type: long + +-- + +[float] +=== replication + +Replication + + + +*`redis.info.replication.role`*:: ++ +-- +Role of the instance (can be "master", or "slave"). + + +type: keyword + +-- + +*`redis.info.replication.connected_slaves`*:: ++ +-- +Number of connected slaves + + +type: long + +-- + +*`redis.info.replication.master_offset`*:: ++ +-- + +deprecated:[6.5] + +The server's current replication offset + + +type: long + +-- + +*`redis.info.replication.backlog.active`*:: ++ +-- +Flag indicating replication backlog is active + + +type: long + +-- + +*`redis.info.replication.backlog.size`*:: ++ +-- +Total size in bytes of the replication backlog buffer + + +type: long + +format: bytes + +-- + +*`redis.info.replication.backlog.first_byte_offset`*:: ++ +-- +The master offset of the replication backlog buffer + + +type: long + +-- + +*`redis.info.replication.backlog.histlen`*:: ++ +-- +Size in bytes of the data in the replication backlog buffer + + +type: long + +-- + +*`redis.info.replication.master.offset`*:: ++ +-- +The server's current replication offset + + +type: long + +-- + +*`redis.info.replication.master.second_offset`*:: ++ +-- +The offset up to which replication IDs are accepted + + +type: long + +-- + +*`redis.info.replication.master.link_status`*:: ++ +-- +Status of the link (up/down) + + +type: keyword + +-- + +*`redis.info.replication.master.last_io_seconds_ago`*:: ++ +-- +Number of seconds since the last interaction with master + + +type: long + +format: duration + +-- + +*`redis.info.replication.master.sync.in_progress`*:: ++ +-- +Indicate the master is syncing to the slave + + +type: boolean + +-- + +*`redis.info.replication.master.sync.left_bytes`*:: ++ +-- +Number of bytes left before syncing is complete + + +type: long + +format: bytes + +-- + +*`redis.info.replication.master.sync.last_io_seconds_ago`*:: ++ +-- +Number of seconds since last transfer I/O during a SYNC operation + + +type: long + +format: duration + +-- + +*`redis.info.replication.slave.offset`*:: ++ +-- +The replication offset of the slave instance + + +type: long + +-- + +*`redis.info.replication.slave.priority`*:: ++ +-- +The priority of the instance as a candidate for failover + + +type: long + +-- + +*`redis.info.replication.slave.is_readonly`*:: ++ +-- +Flag indicating if the slave is read-only + + +type: boolean + +-- + +[float] +=== server + +Server info + + + +*`redis.info.server.version`*:: ++ +-- +None + +type: alias + +alias to: service.version + +-- + +*`redis.info.server.git_sha1`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.git_dirty`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.build_id`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.mode`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.os`*:: ++ +-- +None + +type: alias + +alias to: os.full + +-- + +*`redis.info.server.arch_bits`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.multiplexing_api`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.gcc_version`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.process_id`*:: ++ +-- +None + +type: alias + +alias to: process.pid + +-- + +*`redis.info.server.run_id`*:: ++ +-- +None + +type: keyword + +-- + +*`redis.info.server.tcp_port`*:: ++ +-- +None + +type: long + +-- + +*`redis.info.server.uptime`*:: ++ +-- +None + +type: long + +-- + +*`redis.info.server.hz`*:: ++ +-- +None + +type: long + +-- + +*`redis.info.server.lru_clock`*:: ++ +-- +None + +type: long + +-- + +*`redis.info.server.config_file`*:: ++ +-- +None + +type: keyword + +-- + +[float] +=== stats + +Redis stats. + + + +*`redis.info.stats.connections.received`*:: ++ +-- +Total number of connections received. + +type: long + +-- + +*`redis.info.stats.connections.rejected`*:: ++ +-- +Total number of connections rejected. + +type: long + +-- + +*`redis.info.stats.commands_processed`*:: ++ +-- +Total number of commands processed. + +type: long + +-- + +*`redis.info.stats.net.input.bytes`*:: ++ +-- +Total network input in bytes. + +type: long + +-- + +*`redis.info.stats.net.output.bytes`*:: ++ +-- +Total network output in bytes. + +type: long + +-- + +*`redis.info.stats.instantaneous.ops_per_sec`*:: ++ +-- +Number of commands processed per second + + +type: long + +-- + +*`redis.info.stats.instantaneous.input_kbps`*:: ++ +-- +The network's read rate per second in KB/sec + + +type: scaled_float + +-- + +*`redis.info.stats.instantaneous.output_kbps`*:: ++ +-- +The network's write rate per second in KB/sec + + +type: scaled_float + +-- + +*`redis.info.stats.sync.full`*:: ++ +-- +The number of full resyncs with slaves + + +type: long + +-- + +*`redis.info.stats.sync.partial.ok`*:: ++ +-- +The number of accepted partial resync requests + + +type: long + +-- + +*`redis.info.stats.sync.partial.err`*:: ++ +-- +The number of denied partial resync requests + + +type: long + +-- + +*`redis.info.stats.keys.expired`*:: ++ +-- +Total number of key expiration events + + +type: long + +-- + +*`redis.info.stats.keys.evicted`*:: ++ +-- +Number of evicted keys due to maxmemory limit + + +type: long + +-- + +*`redis.info.stats.keyspace.hits`*:: ++ +-- +Number of successful lookup of keys in the main dictionary + + +type: long + +-- + +*`redis.info.stats.keyspace.misses`*:: ++ +-- +Number of failed lookup of keys in the main dictionary + + +type: long + +-- + +*`redis.info.stats.pubsub.channels`*:: ++ +-- +Global number of pub/sub channels with client subscriptions + + +type: long + +-- + +*`redis.info.stats.pubsub.patterns`*:: ++ +-- +Global number of pub/sub pattern with client subscriptions + + +type: long + +-- + +*`redis.info.stats.latest_fork_usec`*:: ++ +-- +Duration of the latest fork operation in microseconds + + +type: long + +-- + +*`redis.info.stats.migrate_cached_sockets`*:: ++ +-- +The number of sockets open for MIGRATE purposes + + +type: long + +-- + +*`redis.info.stats.slave_expires_tracked_keys`*:: ++ +-- +The number of keys tracked for expiry purposes (applicable only to writable slaves) + + +type: long + +-- + +*`redis.info.stats.active_defrag.hits`*:: ++ +-- +Number of value reallocations performed by active the defragmentation process + + +type: long + +-- + +*`redis.info.stats.active_defrag.misses`*:: ++ +-- +Number of aborted value reallocations started by the active defragmentation process + + +type: long + +-- + +*`redis.info.stats.active_defrag.key_hits`*:: ++ +-- +Number of keys that were actively defragmented + + +type: long + +-- + +*`redis.info.stats.active_defrag.key_misses`*:: ++ +-- +Number of keys that were skipped by the active defragmentation process + + +type: long + +-- + +*`redis.info.slowlog.count`*:: ++ +-- +Count of slow operations + + +type: long + +-- + +[float] +=== key + +`key` contains information about keys. + + + +*`redis.key.name`*:: ++ +-- +Key name. + + +type: keyword + +-- + +*`redis.key.id`*:: ++ +-- +Unique id for this key (With the form :). + + +type: keyword + +-- + +*`redis.key.type`*:: ++ +-- +Key type as shown by `TYPE` command. + + +type: keyword + +-- + +*`redis.key.length`*:: ++ +-- +Length of the key (Number of elements for lists, length for strings, cardinality for sets). + + +type: long + +-- + +*`redis.key.expire.ttl`*:: ++ +-- +Seconds to expire. + + +type: long + +-- + +[float] +=== keyspace + +`keyspace` contains the information about the keyspaces returned by the `INFO` command. + + + *`redis.keyspace.id`*:: + -- diff --git a/metricbeat/docs/modules/redis.asciidoc b/metricbeat/docs/modules/redis.asciidoc index 61855b3a0ad..885c9c3023b 100644 --- a/metricbeat/docs/modules/redis.asciidoc +++ b/metricbeat/docs/modules/redis.asciidoc @@ -3,6 +3,7 @@ This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-module-redis]] +[role="xpack"] == Redis module This module periodically fetches metrics from http://redis.io/[Redis] servers. diff --git a/metricbeat/docs/modules/redis/info.asciidoc b/metricbeat/docs/modules/redis/info.asciidoc index cf13ce7f6f5..9a3e5dbc70e 100644 --- a/metricbeat/docs/modules/redis/info.asciidoc +++ b/metricbeat/docs/modules/redis/info.asciidoc @@ -5,9 +5,8 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-info]] === Redis info metricset -include::../../../module/redis/info/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redis/info/_meta/docs.asciidoc[] -This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields @@ -18,5 +17,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../module/redis/info/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redis/info/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/key.asciidoc b/metricbeat/docs/modules/redis/key.asciidoc index b5e569957c5..d6949aba9ab 100644 --- a/metricbeat/docs/modules/redis/key.asciidoc +++ b/metricbeat/docs/modules/redis/key.asciidoc @@ -5,7 +5,7 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-key]] === Redis key metricset -include::../../../module/redis/key/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redis/key/_meta/docs.asciidoc[] ==== Fields @@ -17,5 +17,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../module/redis/key/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redis/key/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/keyspace.asciidoc b/metricbeat/docs/modules/redis/keyspace.asciidoc index fe842062054..77e35a0d81a 100644 --- a/metricbeat/docs/modules/redis/keyspace.asciidoc +++ b/metricbeat/docs/modules/redis/keyspace.asciidoc @@ -5,9 +5,8 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-keyspace]] === Redis keyspace metricset -include::../../../module/redis/keyspace/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redis/keyspace/_meta/docs.asciidoc[] -This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields @@ -18,5 +17,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../module/redis/keyspace/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redis/keyspace/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/node.asciidoc b/metricbeat/docs/modules/redis/node.asciidoc index e0077e6876e..a3cb5ee6742 100644 --- a/metricbeat/docs/modules/redis/node.asciidoc +++ b/metricbeat/docs/modules/redis/node.asciidoc @@ -7,7 +7,7 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -include::../../../module/redis/node/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redis/node/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. @@ -20,5 +20,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../module/redis/node/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redis/node/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/proxy.asciidoc b/metricbeat/docs/modules/redis/proxy.asciidoc index b20cf2007d5..85cb2029348 100644 --- a/metricbeat/docs/modules/redis/proxy.asciidoc +++ b/metricbeat/docs/modules/redis/proxy.asciidoc @@ -7,7 +7,7 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -include::../../../module/redis/proxy/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redis/proxy/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. @@ -20,5 +20,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../module/redis/proxy/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redis/proxy/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 12f91610d7a..9da750ba196 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -201,6 +201,10 @@ This file is generated! See scripts/mage/docs_collector.go |<> |<> beta[] |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | @@ -295,6 +299,7 @@ include::modules/postgresql.asciidoc[] include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] +include::modules/redis.asciidoc[] include::modules/sql.asciidoc[] include::modules/stan.asciidoc[] include::modules/statsd.asciidoc[] diff --git a/metricbeat/module/redis/_meta/Dockerfile.oss b/metricbeat/module/redis/_meta/Dockerfile similarity index 100% rename from metricbeat/module/redis/_meta/Dockerfile.oss rename to metricbeat/module/redis/_meta/Dockerfile diff --git a/metricbeat/module/redis/_meta/Dockerfile.enterprise b/metricbeat/module/redis/_meta/Dockerfile.enterprise deleted file mode 100644 index 9b9dfeaed7e..00000000000 --- a/metricbeat/module/redis/_meta/Dockerfile.enterprise +++ /dev/null @@ -1,6 +0,0 @@ -ARG REDIS_VERSION -FROM redislabs/redis:${REDIS_VERSION} - -# Wait for the health endpoint to have monitors information -ADD healthcheck.sh / -HEALTHCHECK --interval=1s --retries=300 CMD /healthcheck.sh diff --git a/metricbeat/module/redis/_meta/config-enterprise.yml b/metricbeat/module/redis/_meta/config-enterprise.yml deleted file mode 100644 index b6f5e0aba38..00000000000 --- a/metricbeat/module/redis/_meta/config-enterprise.yml +++ /dev/null @@ -1,8 +0,0 @@ -- module: redis - metricsets: - - node - - proxy - period: 1m - - # Metrics endpoint - hosts: ["https://127.0.0.1:8070/"] diff --git a/metricbeat/module/redis/_meta/docs.asciidoc b/metricbeat/module/redis/_meta/docs.asciidoc index 7e7ed912924..91489e2d575 100644 --- a/metricbeat/module/redis/_meta/docs.asciidoc +++ b/metricbeat/module/redis/_meta/docs.asciidoc @@ -28,6 +28,3 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. - -The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES -5.4.10-22 and are expected to work with all versions >= 5.0.2. diff --git a/metricbeat/module/redis/_meta/healthcheck.sh b/metricbeat/module/redis/_meta/healthcheck.sh deleted file mode 100755 index 12b298e60c6..00000000000 --- a/metricbeat/module/redis/_meta/healthcheck.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - -CHECK_CLUSTER_CREATED=/opt/redislabs/config/check_cluster_created -CHECK_DATABASE_CREATED=/opt/redislabs/config/check_database_created - -if [[ ! -f "${CHECK_CLUSTER_CREATED}" ]]; then - rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 - touch ${CHECK_CLUSTER_CREATED} -fi - -if [[ ! -f "${CHECK_DATABASE_CREATED}" ]]; then - curl -s -k -u "cihan@redislabs.com:redislabs123" --request POST \ - --url "https://localhost:9443/v1/bdbs" \ - --header 'content-type: application/json' \ - --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' - touch ${CHECK_DATABASE_CREATED} -fi - -curl -s --insecure https://127.0.0.1:8070 >/dev/null diff --git a/metricbeat/module/redis/_meta/supported-versions.yml b/metricbeat/module/redis/_meta/supported-versions.yml index 27e6b04a239..44898f1c82d 100644 --- a/metricbeat/module/redis/_meta/supported-versions.yml +++ b/metricbeat/module/redis/_meta/supported-versions.yml @@ -1,9 +1,4 @@ variants: - - REDIS_DISTRIBUTION: oss - REDIS_VERSION: 3.2.12 - - REDIS_DISTRIBUTION: oss - REDIS_VERSION: 4.0.11 - - REDIS_DISTRIBUTION: oss - REDIS_VERSION: 5.0.5 - - REDIS_DISTRIBUTION: enterprise - REDIS_VERSION: 5.4.10-22 + - REDIS_VERSION: 3.2.12 + - REDIS_VERSION: 4.0.11 + - REDIS_VERSION: 5.0.5 diff --git a/metricbeat/module/redis/docker-compose.yml b/metricbeat/module/redis/docker-compose.yml index ec3091f997b..3cb5c07c12e 100644 --- a/metricbeat/module/redis/docker-compose.yml +++ b/metricbeat/module/redis/docker-compose.yml @@ -2,25 +2,11 @@ version: '2.3' services: redis: - image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-${REDIS_DISTRIBUTION:-oss}-1 + image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-1 build: context: ./_meta - dockerfile: Dockerfile.${REDIS_DISTRIBUTION:-oss} args: - REDIS_DISTRIBUTION: ${REDIS_DISTRIBUTION:-oss} REDIS_VERSION: ${REDIS_VERSION:-3.2.12} privileged: true ports: - 6379 - - 8070 - redis-enterprise: - image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-5.4.10-22}-enterprise-2 - build: - context: ./_meta - dockerfile: Dockerfile.enterprise - args: - REDIS_DISTRIBUTION: enterprise - REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} - privileged: true - ports: - - 8070 diff --git a/metricbeat/module/redis/fields.go b/metricbeat/module/redis/fields.go index 2d03a3dad15..fd28937ec4b 100644 --- a/metricbeat/module/redis/fields.go +++ b/metricbeat/module/redis/fields.go @@ -32,5 +32,5 @@ func init() { // AssetRedis returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/redis. func AssetRedis() string { - return "eJzkXF1v3Dazvs+vGPhc1AVipeeivTCKAnGT9ARNk8BOcNArmZJGu+xSpEpS62x//QuSklarJSXth2wX714k8K7EeWY4n+SQV7DCzTVIzKh6AaCpZngNF7fm74sXABmqVNJSU8Gv4ZcXAAD2NyhQS5oqSA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OcTPJNtIMOR2BMwh4gSsV4deSykmuI+m6/QWuwFJzyza49FzZ1AW3pJNfolTTsAQhqxC0gIJ8bR9t3RmhF3VJUozmfeXXKWC3euuZEIuqrEWsml2RglAOmTu7S3oOt64hF1SpifdZc0IZZnsCDhdoVaKqxB7P4MimQP4bE8mWDpdV8lJVCTQ0nQdrbgqrkvWIYcWuUZdEa5Se5yZEXdMcATpc1NhukzgXchFX06QRu42ctsEltwlQu4ezoKkU3UbO8FqFrbcxTu0R9ViJdIGT2Oi2k67pGOTcLvT+8e63u1ef30BZyVKoMb0GNkDGzlGrWEuSLjCLjelMjt7aZ03RorcoVmvwcElKuxKfMATBmb0ewGQj9ov6wrlhDrfPok/uO+2FDibba/XzlShzIesLOeqj6XajuXM8vc5oR7JyBp9KEiFN/PIxZZvCNhfuBE7c78fSAlfx5DPk9G5ONDyibICzVQt6zwb0Lt4zTEMHsVrQsjxI8hurF49MzCLbaeZdd/HAHoD8qxnLeiUmHjfO1OODWtnBiy7dfe4IXeCqdUXo7hkYm+a1Xtn/7k/zr1c8/kWvAQn9jis74sA9VDsLrUeQ/MLp3xUCdQ5Wz6myqfLlf02UNspjZAY/N3naLzc/Gwy/DN3TZxCdVi7mdXsl01w82juZHj7/+emN5wpXLx6GfKbnJ1Lk93awJkOw4mpl9AwLe/2hkSejSqurmrr9RmlJ+UxdQUpkRjlhVK/cD6jVkFRdFI607lbKh3JyX+/Ga9GM7bNBO/PHGqIdpO/CXmuRtUDtw9Pe2ntKI/q9Rgz2wgGaUwxd17KOEstZfLppfLVESWYIWrMBup687VCinehT11Hrgm6MJh8K5X8BAAD//0AQtHI=" } diff --git a/metricbeat/module/redis/info/info_integration_test.go b/metricbeat/module/redis/info/info_integration_test.go index e650c6be365..576103c75d3 100644 --- a/metricbeat/module/redis/info/info_integration_test.go +++ b/metricbeat/module/redis/info/info_integration_test.go @@ -32,7 +32,7 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) events, err := mbtest.ReportingFetchV2Error(ms) if err != nil { t.Fatal("fetch", err) @@ -53,7 +53,7 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) err := mbtest.WriteEventsReporterV2Error(ms, t, "") if err != nil { t.Fatal("write", err) diff --git a/metricbeat/module/redis/key/key_integration_test.go b/metricbeat/module/redis/key/key_integration_test.go index 8b212c10053..2a804d9a63b 100644 --- a/metricbeat/module/redis/key/key_integration_test.go +++ b/metricbeat/module/redis/key/key_integration_test.go @@ -34,9 +34,9 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.HostForPort(6379), "foo", 1) + addEntry(t, service.Host(), "foo", 1) - ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewFetcher(t, getConfig(service.Host())) events, err := ms.FetchEvents() if err != nil { t.Fatal("fetch", err) @@ -49,9 +49,9 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.HostForPort(6379), "foo", 1) + addEntry(t, service.Host(), "foo", 1) - ms := mbtest.NewFetcher(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewFetcher(t, getConfig(service.Host())) ms.WriteEvents(t, "") } @@ -66,10 +66,10 @@ func TestFetchMultipleKeyspaces(t *testing.T) { expectedEvents := len(expectedKeyspaces) for name, keyspace := range expectedKeyspaces { - addEntry(t, service.HostForPort(6379), name, keyspace) + addEntry(t, service.Host(), name, keyspace) } - config := getConfig(service.HostForPort(6379)) + config := getConfig(service.Host()) config["key.patterns"] = []map[string]interface{}{ { "pattern": "foo", diff --git a/metricbeat/module/redis/keyspace/keyspace_integration_test.go b/metricbeat/module/redis/keyspace/keyspace_integration_test.go index 9c7d6dd3ddb..e0b51c25dde 100644 --- a/metricbeat/module/redis/keyspace/keyspace_integration_test.go +++ b/metricbeat/module/redis/keyspace/keyspace_integration_test.go @@ -33,10 +33,10 @@ import ( func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.HostForPort(6379)) + addEntry(t, service.Host()) // Fetch data - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) events, err := mbtest.ReportingFetchV2Error(ms) if err != nil { t.Fatal("fetch", err) @@ -58,9 +58,9 @@ func TestFetch(t *testing.T) { func TestData(t *testing.T) { service := compose.EnsureUp(t, "redis") - addEntry(t, service.HostForPort(6379)) + addEntry(t, service.Host()) - ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.HostForPort(6379))) + ms := mbtest.NewReportingMetricSetV2Error(t, getConfig(service.Host())) err := mbtest.WriteEventsReporterV2Error(ms, t, "") if err != nil { t.Fatal("write", err) diff --git a/metricbeat/module/redis/metricset_integration_test.go b/metricbeat/module/redis/metricset_integration_test.go index 80e539051f4..7d972030bb3 100644 --- a/metricbeat/module/redis/metricset_integration_test.go +++ b/metricbeat/module/redis/metricset_integration_test.go @@ -40,7 +40,7 @@ func TestPasswords(t *testing.T) { t.Skip("Changing password affects other tests, see https://github.com/elastic/beats/issues/10955") service := compose.EnsureUp(t, "redis") - host := service.HostForPort(6379) + host := service.Host() registry := mb.NewRegister() err := registry.AddModule("redis", mb.DefaultModuleFactory) diff --git a/metricbeat/module/redis/module.yml b/metricbeat/module/redis/module.yml index 2722441f03c..f89e64a72b3 100644 --- a/metricbeat/module/redis/module.yml +++ b/metricbeat/module/redis/module.yml @@ -1,4 +1,4 @@ name: redis -metricsets: - - node - - proxy +dashboards: + - id: AV4YjZ5pux-M-tCAunxK + file: Metricbeat-redis-overview.json diff --git a/metricbeat/module/redis/node/_meta/data.json b/metricbeat/module/redis/node/_meta/data.json deleted file mode 100644 index 2a528bef053..00000000000 --- a/metricbeat/module/redis/node/_meta/data.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "@timestamp": "2020-02-21T08:25:46.123Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "metricset": { - "period": 60000, - "name": "node" - }, - "service": { - "type": "redis", - "address": "127.0.0.1:8070" - }, - "ecs": { - "version": "1.4.0" - }, - "host": { - "hostname": "host", - "architecture": "x86_64", - "os": { - "family": "darwin", - "name": "Mac OS X", - "kernel": "18.7.0", - "build": "18G95", - "platform": "darwin", - "version": "10.14.6" - }, - "name": "host", - "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", - "ip": [ - "fe80::aede:48ff:fe00:1122", - "fe80::1c05:593c:e271:97ed", - "192.168.0.14", - "fe80::488c:55ff:fe4e:3b46", - "fe80::def:1653:5676:ea4e", - "fe80::f191:956a:99ff:1b98", - "fe80::3128:a84c:7b38:e3a9" - ], - "mac": [ - "ac:de:48:00:11:22", - "a6:83:e7:ae:70:01", - "a4:83:e7:ae:70:01", - "06:83:e7:ae:70:01" - ] - }, - "agent": { - "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", - "hostname": "MacBook-Elastic.local", - "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", - "version": "8.0.0", - "type": "metricbeat" - }, - "prometheus": { - "labels": { - "cluster": "cluster.local", - "node": "1", - "instance": "127.0.0.1:8070", - "job": "redis" - }, - "metrics": { - "node_cpu_steal_median": 0, - "node_cpu_irqs_max": 0.001, - "node_cpu_user_min": 0.021, - "node_cpu_iowait_median": 0, - "node_cur_aof_rewrites": 0, - "node_ingress_bytes_min": 0, - "node_ingress_bytes_median": 0, - "node_cpu_idle_min": 0.929, - "node_cpu_iowait_max": 0, - "node_cpu_irqs": 0.0003333333333333333, - "node_available_memory": 6.262083584e+09, - "node_provisional_memory_no_overbooking": 4.757468584333e+09, - "node_cpu_idle": 0.9303333333333335, - "node_cpu_steal_max": 0 - } - }, - "event": { - "dataset": "redis.node", - "module": "redis", - "duration": 51870343 - } -} diff --git a/metricbeat/module/redis/node/_meta/docs.asciidoc b/metricbeat/module/redis/node/_meta/docs.asciidoc deleted file mode 100644 index 101cf399e7d..00000000000 --- a/metricbeat/module/redis/node/_meta/docs.asciidoc +++ /dev/null @@ -1 +0,0 @@ -This is the `node` metricset of the redis module. The metricset is compatible with Redis Enterprise Software. diff --git a/metricbeat/module/redis/node/_meta/fields.yml b/metricbeat/module/redis/node/_meta/fields.yml deleted file mode 100644 index 4d523079ac9..00000000000 --- a/metricbeat/module/redis/node/_meta/fields.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: node - type: group - release: beta - fields: diff --git a/metricbeat/module/redis/node/_meta/testdata/config.yml b/metricbeat/module/redis/node/_meta/testdata/config.yml deleted file mode 100644 index 361e43c5ccd..00000000000 --- a/metricbeat/module/redis/node/_meta/testdata/config.yml +++ /dev/null @@ -1,4 +0,0 @@ -type: http -url: "/" -suffix: plain -remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain deleted file mode 100644 index d1b94f28efd..00000000000 --- a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain +++ /dev/null @@ -1,144 +0,0 @@ -# HELP node_cpu_nice_min -# TYPE node_cpu_nice_min gauge -node_cpu_nice_min{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_idle_max -# TYPE node_cpu_idle_max gauge -node_cpu_idle_max{cluster="cluster.local",node="1"} 0.914 -# HELP node_egress_bytes -# TYPE node_egress_bytes gauge -node_egress_bytes{cluster="cluster.local",node="1"} 14291.444 -# HELP node_cpu_idle -# TYPE node_cpu_idle gauge -node_cpu_idle{cluster="cluster.local",node="1"} 0.914 -# HELP node_cpu_irqs -# TYPE node_cpu_irqs gauge -node_cpu_irqs{cluster="cluster.local",node="1"} 0.001 -# HELP node_cpu_system_median -# TYPE node_cpu_system_median gauge -node_cpu_system_median{cluster="cluster.local",node="1"} 0.022 -# HELP node_cpu_user -# TYPE node_cpu_user gauge -node_cpu_user{cluster="cluster.local",node="1"} 0.033 -# HELP node_cpu_irqs_min -# TYPE node_cpu_irqs_min gauge -node_cpu_irqs_min{cluster="cluster.local",node="1"} 0.001 -# HELP node_ingress_bytes_min -# TYPE node_ingress_bytes_min gauge -node_ingress_bytes_min{cluster="cluster.local",node="1"} 1006.111 -# HELP node_cpu_system_min -# TYPE node_cpu_system_min gauge -node_cpu_system_min{cluster="cluster.local",node="1"} 0.022 -# HELP node_cpu_irqs_median -# TYPE node_cpu_irqs_median gauge -node_cpu_irqs_median{cluster="cluster.local",node="1"} 0.001 -# HELP node_cpu_steal -# TYPE node_cpu_steal gauge -node_cpu_steal{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_user_min -# TYPE node_cpu_user_min gauge -node_cpu_user_min{cluster="cluster.local",node="1"} 0.033 -# HELP node_persistent_storage_free -# TYPE node_persistent_storage_free gauge -node_persistent_storage_free{cluster="cluster.local",node="1"} 55931361507.556 -# HELP node_ephemeral_storage_free -# TYPE node_ephemeral_storage_free gauge -node_ephemeral_storage_free{cluster="cluster.local",node="1"} 55931361507.556 -# HELP node_cpu_idle_median -# TYPE node_cpu_idle_median gauge -node_cpu_idle_median{cluster="cluster.local",node="1"} 0.914 -# HELP node_provisional_memory_no_overbooking -# TYPE node_provisional_memory_no_overbooking gauge -node_provisional_memory_no_overbooking{cluster="cluster.local",node="1"} 5099636117.889 -# HELP node_free_memory -# TYPE node_free_memory gauge -node_free_memory{cluster="cluster.local",node="1"} 6268220757.333 -# HELP node_ingress_bytes -# TYPE node_ingress_bytes gauge -node_ingress_bytes{cluster="cluster.local",node="1"} 1006.111 -# HELP node_cpu_steal_median -# TYPE node_cpu_steal_median gauge -node_cpu_steal_median{cluster="cluster.local",node="1"} 0.0 -# HELP node_conns -# TYPE node_conns gauge -node_conns{cluster="cluster.local",node="1"} 0.0 -# HELP node_ephemeral_storage_avail -# TYPE node_ephemeral_storage_avail gauge -node_ephemeral_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 -# HELP node_cpu_nice -# TYPE node_cpu_nice gauge -node_cpu_nice{cluster="cluster.local",node="1"} 0.0 -# HELP node_ingress_bytes_median -# TYPE node_ingress_bytes_median gauge -node_ingress_bytes_median{cluster="cluster.local",node="1"} 1006.111 -# HELP node_ingress_bytes_max -# TYPE node_ingress_bytes_max gauge -node_ingress_bytes_max{cluster="cluster.local",node="1"} 1006.111 -# HELP node_cpu_iowait -# TYPE node_cpu_iowait gauge -node_cpu_iowait{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_user_median -# TYPE node_cpu_user_median gauge -node_cpu_user_median{cluster="cluster.local",node="1"} 0.033 -# HELP node_available_memory_no_overbooking -# TYPE node_available_memory_no_overbooking gauge -node_available_memory_no_overbooking{cluster="cluster.local",node="1"} 6270062136.889 -# HELP node_cpu_nice_median -# TYPE node_cpu_nice_median gauge -node_cpu_nice_median{cluster="cluster.local",node="1"} 0.0 -# HELP node_total_req -# TYPE node_total_req gauge -node_total_req{cluster="cluster.local",node="1"} 0.0 -# HELP node_cur_aof_rewrites -# TYPE node_cur_aof_rewrites gauge -node_cur_aof_rewrites{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_iowait_max -# TYPE node_cpu_iowait_max gauge -node_cpu_iowait_max{cluster="cluster.local",node="1"} 0.0 -# HELP node_persistent_storage_avail -# TYPE node_persistent_storage_avail gauge -node_persistent_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 -# HELP node_available_memory -# TYPE node_available_memory gauge -node_available_memory{cluster="cluster.local",node="1"} 6270261475.556 -# HELP node_egress_bytes_min -# TYPE node_egress_bytes_min gauge -node_egress_bytes_min{cluster="cluster.local",node="1"} 14291.444 -# HELP node_cpu_user_max -# TYPE node_cpu_user_max gauge -node_cpu_user_max{cluster="cluster.local",node="1"} 0.033 -# HELP node_cpu_steal_min -# TYPE node_cpu_steal_min gauge -node_cpu_steal_min{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_irqs_max -# TYPE node_cpu_irqs_max gauge -node_cpu_irqs_max{cluster="cluster.local",node="1"} 0.001 -# HELP node_cpu_steal_max -# TYPE node_cpu_steal_max gauge -node_cpu_steal_max{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_iowait_min -# TYPE node_cpu_iowait_min gauge -node_cpu_iowait_min{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_idle_min -# TYPE node_cpu_idle_min gauge -node_cpu_idle_min{cluster="cluster.local",node="1"} 0.914 -# HELP node_cpu_system_max -# TYPE node_cpu_system_max gauge -node_cpu_system_max{cluster="cluster.local",node="1"} 0.022 -# HELP node_egress_bytes_max -# TYPE node_egress_bytes_max gauge -node_egress_bytes_max{cluster="cluster.local",node="1"} 14291.444 -# HELP node_cpu_nice_max -# TYPE node_cpu_nice_max gauge -node_cpu_nice_max{cluster="cluster.local",node="1"} 0.0 -# HELP node_cpu_system -# TYPE node_cpu_system gauge -node_cpu_system{cluster="cluster.local",node="1"} 0.022 -# HELP node_provisional_memory -# TYPE node_provisional_memory gauge -node_provisional_memory{cluster="cluster.local",node="1"} 5099835456.556 -# HELP node_egress_bytes_median -# TYPE node_egress_bytes_median gauge -node_egress_bytes_median{cluster="cluster.local",node="1"} 14291.444 -# HELP node_cpu_iowait_median -# TYPE node_cpu_iowait_median gauge -node_cpu_iowait_median{cluster="cluster.local",node="1"} 0.0 diff --git a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json deleted file mode 100644 index 8cb7df8873f..00000000000 --- a/metricbeat/module/redis/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "event": { - "dataset": "redis.node", - "duration": 115000, - "module": "redis" - }, - "metricset": { - "name": "node", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:55467", - "job": "prometheus" - }, - "metrics": { - "up": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redis" - } - }, - { - "event": { - "dataset": "redis.node", - "duration": 115000, - "module": "redis" - }, - "metricset": { - "name": "node", - "period": 10000 - }, - "prometheus": { - "labels": { - "cluster": "cluster.local", - "instance": "127.0.0.1:55467", - "job": "redis", - "node": "1" - }, - "metrics": { - "node_available_memory": 6270261475.556, - "node_available_memory_no_overbooking": 6270062136.889, - "node_conns": 0, - "node_cpu_idle": 0.914, - "node_cpu_idle_max": 0.914, - "node_cpu_idle_median": 0.914, - "node_cpu_idle_min": 0.914, - "node_cpu_iowait": 0, - "node_cpu_iowait_max": 0, - "node_cpu_iowait_median": 0, - "node_cpu_iowait_min": 0, - "node_cpu_irqs": 0.001, - "node_cpu_irqs_max": 0.001, - "node_cpu_irqs_median": 0.001, - "node_cpu_irqs_min": 0.001, - "node_cpu_nice": 0, - "node_cpu_nice_max": 0, - "node_cpu_nice_median": 0, - "node_cpu_nice_min": 0, - "node_cpu_steal": 0, - "node_cpu_steal_max": 0, - "node_cpu_steal_median": 0, - "node_cpu_steal_min": 0, - "node_cpu_system": 0.022, - "node_cpu_system_max": 0.022, - "node_cpu_system_median": 0.022, - "node_cpu_system_min": 0.022, - "node_cpu_user": 0.033, - "node_cpu_user_max": 0.033, - "node_cpu_user_median": 0.033, - "node_cpu_user_min": 0.033, - "node_cur_aof_rewrites": 0, - "node_egress_bytes": 14291.444, - "node_egress_bytes_max": 14291.444, - "node_egress_bytes_median": 14291.444, - "node_egress_bytes_min": 14291.444, - "node_ephemeral_storage_avail": 52714645731.556, - "node_ephemeral_storage_free": 55931361507.556, - "node_free_memory": 6268220757.333, - "node_ingress_bytes": 1006.111, - "node_ingress_bytes_max": 1006.111, - "node_ingress_bytes_median": 1006.111, - "node_ingress_bytes_min": 1006.111, - "node_persistent_storage_avail": 52714645731.556, - "node_persistent_storage_free": 55931361507.556, - "node_provisional_memory": 5099835456.556, - "node_provisional_memory_no_overbooking": 5099636117.889, - "node_total_req": 0 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redis" - } - } -] \ No newline at end of file diff --git a/metricbeat/module/redis/node/manifest.yml b/metricbeat/module/redis/node/manifest.yml deleted file mode 100644 index fbb4c5781b3..00000000000 --- a/metricbeat/module/redis/node/manifest.yml +++ /dev/null @@ -1,8 +0,0 @@ -default: true -input: - module: prometheus - metricset: collector - defaults: - metrics_path: / - metrics_filters: - include: ["node_*"] diff --git a/metricbeat/module/redis/node/node_integration_test.go b/metricbeat/module/redis/node/node_integration_test.go deleted file mode 100644 index 152956a5c84..00000000000 --- a/metricbeat/module/redis/node/node_integration_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// +build integration - -package node - -import ( - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "github.com/elastic/beats/libbeat/tests/compose" - "github.com/elastic/beats/metricbeat/mb" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - _ "github.com/elastic/beats/metricbeat/module/prometheus" - _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" -) - -func init() { - // To be moved to some kind of helper - os.Setenv("BEAT_STRICT_PERMS", "false") - mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) -} - -func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(5*time.Minute)) - - f := mbtest.NewFetcher(t, getConfig(service.Host())) - events, errs := f.FetchEvents() - if len(errs) > 0 { - t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) - } - assert.NotEmpty(t, events) - t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) -} - -func getConfig(host string) map[string]interface{} { - return map[string]interface{}{ - "module": "redis", - "metricsets": []string{"node"}, - "hosts": []string{host}, - "ssl.verification_mode": "none", - } -} diff --git a/metricbeat/module/redis/node/node_test.go b/metricbeat/module/redis/node/node_test.go deleted file mode 100644 index 641f2a20c24..00000000000 --- a/metricbeat/module/redis/node/node_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// +build !integration - -package node - -import ( - "os" - "testing" - - "github.com/elastic/beats/libbeat/logp" - "github.com/elastic/beats/metricbeat/mb" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - - // Register input module and metricset - _ "github.com/elastic/beats/metricbeat/module/prometheus" - _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" -) - -func init() { - // To be moved to some kind of helper - os.Setenv("BEAT_STRICT_PERMS", "false") - mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) -} - -func TestEventMapping(t *testing.T) { - logp.TestingSetup() - - mbtest.TestDataFiles(t, "redis", "node") -} diff --git a/metricbeat/module/redis/proxy/_meta/data.json b/metricbeat/module/redis/proxy/_meta/data.json deleted file mode 100644 index 14b32d6262e..00000000000 --- a/metricbeat/module/redis/proxy/_meta/data.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "@timestamp": "2020-02-21T08:25:46.123Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "metricset": { - "period": 60000, - "name": "proxy" - }, - "service": { - "type": "redis", - "address": "127.0.0.1:8070" - }, - "ecs": { - "version": "1.4.0" - }, - "host": { - "hostname": "host", - "architecture": "x86_64", - "os": { - "family": "darwin", - "name": "Mac OS X", - "kernel": "18.7.0", - "build": "18G95", - "platform": "darwin", - "version": "10.14.6" - }, - "name": "host", - "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", - "ip": [ - "fe80::aede:48ff:fe00:1122", - "fe80::1c05:593c:e271:97ed", - "192.168.0.14", - "fe80::488c:55ff:fe4e:3b46", - "fe80::def:1653:5676:ea4e", - "fe80::f191:956a:99ff:1b98", - "fe80::3128:a84c:7b38:e3a9" - ], - "mac": [ - "ac:de:48:00:11:22", - "a6:83:e7:ae:70:01", - "a4:83:e7:ae:70:01", - "06:83:e7:ae:70:01" - ] - }, - "agent": { - "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", - "hostname": "MacBook-Elastic.local", - "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", - "version": "8.0.0", - "type": "metricbeat" - }, - "prometheus": { - "labels": { - "cluster": "cluster.local", - "proxy": "1", - "instance": "127.0.0.1:8070", - "job": "redis" - }, - "metrics": { - "listener_acc_latency": 0, - "listener_acc_latency_max": 0, - "listener_acc_other_latency": 0, - "listener_acc_other_latency_max": 0, - "listener_acc_read_latency": 0, - "listener_acc_read_latency_max": 0, - "listener_acc_write_latency": 0, - "listener_acc_write_latency_max": 0, - "listener_auth_cmds": 0, - "listener_auth_cmds_max": 0, - "listener_auth_errors": 0, - "listener_auth_errors_max": 0, - "listener_cmd_flush": 0, - "listener_cmd_flush_max": 0, - "listener_cmd_get": 0, - "listener_cmd_get_max": 0 - } - }, - "event": { - "dataset": "redis.proxy", - "module": "redis", - "duration": 51870343 - } -} diff --git a/metricbeat/module/redis/proxy/_meta/docs.asciidoc b/metricbeat/module/redis/proxy/_meta/docs.asciidoc deleted file mode 100644 index d88a4165235..00000000000 --- a/metricbeat/module/redis/proxy/_meta/docs.asciidoc +++ /dev/null @@ -1 +0,0 @@ -This is the `proxy` metricset of the redis module. The metricset is compatible with Redis Enterprise Software. diff --git a/metricbeat/module/redis/proxy/_meta/fields.yml b/metricbeat/module/redis/proxy/_meta/fields.yml deleted file mode 100644 index 1c1fa1b036d..00000000000 --- a/metricbeat/module/redis/proxy/_meta/fields.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: proxy - type: group - release: beta - fields: diff --git a/metricbeat/module/redis/proxy/_meta/testdata/config.yml b/metricbeat/module/redis/proxy/_meta/testdata/config.yml deleted file mode 100644 index 361e43c5ccd..00000000000 --- a/metricbeat/module/redis/proxy/_meta/testdata/config.yml +++ /dev/null @@ -1,4 +0,0 @@ -type: http -url: "/" -suffix: plain -remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain deleted file mode 100644 index 423aaadae08..00000000000 --- a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain +++ /dev/null @@ -1,168 +0,0 @@ -# HELP listener_acc_other_latency_max -# TYPE listener_acc_other_latency_max counter -listener_acc_other_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_touch_max -# TYPE listener_cmd_touch_max counter -listener_cmd_touch_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_egress_bytes -# TYPE listener_egress_bytes counter -listener_egress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_req_max -# TYPE listener_read_req_max counter -listener_read_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_monitor_sessions_count -# TYPE listener_monitor_sessions_count counter -listener_monitor_sessions_count{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_req_max -# TYPE listener_write_req_max counter -listener_write_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_res_max -# TYPE listener_write_res_max counter -listener_write_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_started_res_max -# TYPE listener_write_started_res_max counter -listener_write_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_res_max -# TYPE listener_total_res_max counter -listener_total_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_other_latency -# TYPE listener_acc_other_latency counter -listener_acc_other_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_started_res_max -# TYPE listener_total_started_res_max counter -listener_total_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_started_res -# TYPE listener_total_started_res counter -listener_total_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_req_max -# TYPE listener_other_req_max counter -listener_other_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_req -# TYPE listener_write_req counter -listener_write_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_res -# TYPE listener_write_res counter -listener_write_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_flush_max -# TYPE listener_cmd_flush_max counter -listener_cmd_flush_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_touch -# TYPE listener_cmd_touch counter -listener_cmd_touch{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_auth_cmds -# TYPE listener_auth_cmds counter -listener_auth_cmds{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_ingress_bytes -# TYPE listener_ingress_bytes counter -listener_ingress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_write_latency -# TYPE listener_acc_write_latency counter -listener_acc_write_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_conns -# TYPE listener_conns counter -listener_conns{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_write_started_res -# TYPE listener_write_started_res counter -listener_write_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_latency -# TYPE listener_acc_latency counter -listener_acc_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_read_latency_max -# TYPE listener_acc_read_latency_max counter -listener_acc_read_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_ingress_bytes_max -# TYPE listener_ingress_bytes_max counter -listener_ingress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_connections_received -# TYPE listener_total_connections_received counter -listener_total_connections_received{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_last_req_time -# TYPE listener_last_req_time counter -listener_last_req_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_res -# TYPE listener_other_res counter -listener_other_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_started_res_max -# TYPE listener_other_started_res_max counter -listener_other_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_req -# TYPE listener_other_req counter -listener_other_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_max_connections_exceeded -# TYPE listener_max_connections_exceeded counter -listener_max_connections_exceeded{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_get -# TYPE listener_cmd_get counter -listener_cmd_get{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_res -# TYPE listener_total_res counter -listener_total_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_req -# TYPE listener_total_req counter -listener_total_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_res_max -# TYPE listener_read_res_max counter -listener_read_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_latency_max -# TYPE listener_acc_latency_max counter -listener_acc_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_set -# TYPE listener_cmd_set counter -listener_cmd_set{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_connections_received_max -# TYPE listener_total_connections_received_max counter -listener_total_connections_received_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_auth_cmds_max -# TYPE listener_auth_cmds_max counter -listener_auth_cmds_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_write_latency_max -# TYPE listener_acc_write_latency_max counter -listener_acc_write_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_auth_errors_max -# TYPE listener_auth_errors_max counter -listener_auth_errors_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_total_req_max -# TYPE listener_total_req_max counter -listener_total_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_max_connections_exceeded_max -# TYPE listener_max_connections_exceeded_max counter -listener_max_connections_exceeded_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_last_res_time -# TYPE listener_last_res_time counter -listener_last_res_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_flush -# TYPE listener_cmd_flush counter -listener_cmd_flush{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_acc_read_latency -# TYPE listener_acc_read_latency counter -listener_acc_read_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_started_res -# TYPE listener_read_started_res counter -listener_read_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_egress_bytes_max -# TYPE listener_egress_bytes_max counter -listener_egress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_set_max -# TYPE listener_cmd_set_max counter -listener_cmd_set_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_auth_errors -# TYPE listener_auth_errors counter -listener_auth_errors{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_started_res -# TYPE listener_other_started_res counter -listener_other_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_started_res_max -# TYPE listener_read_started_res_max counter -listener_read_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_cmd_get_max -# TYPE listener_cmd_get_max counter -listener_cmd_get_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_other_res_max -# TYPE listener_other_res_max counter -listener_other_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_req -# TYPE listener_read_req counter -listener_read_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 -# HELP listener_read_res -# TYPE listener_read_res counter -listener_read_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 diff --git a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json deleted file mode 100644 index 89607304936..00000000000 --- a/metricbeat/module/redis/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json +++ /dev/null @@ -1,111 +0,0 @@ -[ - { - "event": { - "dataset": "redis.proxy", - "duration": 115000, - "module": "redis" - }, - "metricset": { - "name": "proxy", - "period": 10000 - }, - "prometheus": { - "labels": { - "bdb": "1", - "cluster": "cluster.local", - "endpoint": "1:1", - "instance": "127.0.0.1:58281", - "job": "redis", - "node": "1", - "port": "12000", - "proxy": "1:1:1" - }, - "metrics": { - "listener_acc_latency": 0, - "listener_acc_latency_max": 0, - "listener_acc_other_latency": 0, - "listener_acc_other_latency_max": 0, - "listener_acc_read_latency": 0, - "listener_acc_read_latency_max": 0, - "listener_acc_write_latency": 0, - "listener_acc_write_latency_max": 0, - "listener_auth_cmds": 0, - "listener_auth_cmds_max": 0, - "listener_auth_errors": 0, - "listener_auth_errors_max": 0, - "listener_cmd_flush": 0, - "listener_cmd_flush_max": 0, - "listener_cmd_get": 0, - "listener_cmd_get_max": 0, - "listener_cmd_set": 0, - "listener_cmd_set_max": 0, - "listener_cmd_touch": 0, - "listener_cmd_touch_max": 0, - "listener_conns": 0, - "listener_egress_bytes": 0, - "listener_egress_bytes_max": 0, - "listener_ingress_bytes": 0, - "listener_ingress_bytes_max": 0, - "listener_last_req_time": 0, - "listener_last_res_time": 0, - "listener_max_connections_exceeded": 0, - "listener_max_connections_exceeded_max": 0, - "listener_monitor_sessions_count": 0, - "listener_other_req": 0, - "listener_other_req_max": 0, - "listener_other_res": 0, - "listener_other_res_max": 0, - "listener_other_started_res": 0, - "listener_other_started_res_max": 0, - "listener_read_req": 0, - "listener_read_req_max": 0, - "listener_read_res": 0, - "listener_read_res_max": 0, - "listener_read_started_res": 0, - "listener_read_started_res_max": 0, - "listener_total_connections_received": 0, - "listener_total_connections_received_max": 0, - "listener_total_req": 0, - "listener_total_req_max": 0, - "listener_total_res": 0, - "listener_total_res_max": 0, - "listener_total_started_res": 0, - "listener_total_started_res_max": 0, - "listener_write_req": 0, - "listener_write_req_max": 0, - "listener_write_res": 0, - "listener_write_res_max": 0, - "listener_write_started_res": 0, - "listener_write_started_res_max": 0 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redis" - } - }, - { - "event": { - "dataset": "redis.proxy", - "duration": 115000, - "module": "redis" - }, - "metricset": { - "name": "proxy", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:58281", - "job": "prometheus" - }, - "metrics": { - "up": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redis" - } - } -] \ No newline at end of file diff --git a/metricbeat/module/redis/proxy/manifest.yml b/metricbeat/module/redis/proxy/manifest.yml deleted file mode 100644 index 62327fbd5cc..00000000000 --- a/metricbeat/module/redis/proxy/manifest.yml +++ /dev/null @@ -1,8 +0,0 @@ -default: true -input: - module: prometheus - metricset: collector - defaults: - metrics_path: / - metrics_filters: - include: ["listener_*"] diff --git a/metricbeat/module/redis/proxy/proxy_integration_test.go b/metricbeat/module/redis/proxy/proxy_integration_test.go deleted file mode 100644 index bbfee6e9b3e..00000000000 --- a/metricbeat/module/redis/proxy/proxy_integration_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// +build integration - -package proxy - -import ( - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "github.com/elastic/beats/libbeat/tests/compose" - "github.com/elastic/beats/metricbeat/mb" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - _ "github.com/elastic/beats/metricbeat/module/prometheus" - _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" -) - -func init() { - // To be moved to some kind of helper - os.Setenv("BEAT_STRICT_PERMS", "false") - mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) -} - -func TestFetch(t *testing.T) { - service := compose.EnsureUp(t, "redis-enterprise", compose.UpWithTimeout(5*time.Minute)) - - f := mbtest.NewFetcher(t, getConfig(service.Host())) - events, errs := f.FetchEvents() - if len(errs) > 0 { - t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) - } - assert.NotEmpty(t, events) - t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) -} - -func getConfig(host string) map[string]interface{} { - return map[string]interface{}{ - "module": "redis", - "metricsets": []string{"proxy"}, - "hosts": []string{host}, - "ssl.verification_mode": "none", - } -} diff --git a/metricbeat/module/redis/proxy/proxy_test.go b/metricbeat/module/redis/proxy/proxy_test.go deleted file mode 100644 index b42199cda23..00000000000 --- a/metricbeat/module/redis/proxy/proxy_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// +build !integration - -package proxy - -import ( - "os" - "testing" - - "github.com/elastic/beats/libbeat/logp" - "github.com/elastic/beats/metricbeat/mb" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" - - // Register input module and metricset - _ "github.com/elastic/beats/metricbeat/module/prometheus" - _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" -) - -func init() { - // To be moved to some kind of helper - os.Setenv("BEAT_STRICT_PERMS", "false") - mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) -} - -func TestEventMapping(t *testing.T) { - logp.TestingSetup() - - mbtest.TestDataFiles(t, "redis", "proxy") -} diff --git a/metricbeat/module/redis/redis_integration_test.go b/metricbeat/module/redis/redis_integration_test.go index 280a4af93f9..c33df1556f0 100644 --- a/metricbeat/module/redis/redis_integration_test.go +++ b/metricbeat/module/redis/redis_integration_test.go @@ -33,7 +33,7 @@ import ( func TestFetchRedisInfo(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.HostForPort(6379) + host := service.Host() conn, err := rd.Dial("tcp", host) if err != nil { @@ -69,7 +69,7 @@ func TestFetchRedisInfo(t *testing.T) { func TestFetchKeys(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.HostForPort(6379) + host := service.Host() conn, err := rd.Dial("tcp", host) if err != nil { @@ -96,7 +96,7 @@ func TestFetchKeys(t *testing.T) { func TestFetchKeyInfo(t *testing.T) { service := compose.EnsureUp(t, "redis") - host := service.HostForPort(6379) + host := service.Host() conn, err := rd.Dial("tcp", host) if err != nil { diff --git a/metricbeat/module/redis/test_redis.py b/metricbeat/module/redis/test_redis.py index 2a9b1f828bc..98ffb982ca3 100644 --- a/metricbeat/module/redis/test_redis.py +++ b/metricbeat/module/redis/test_redis.py @@ -35,10 +35,6 @@ def test_info(self): Test redis info metricset """ - if not self.oss_distribution(): - self.skipTest("only oss distribution is supported") - return - self.render_config_template(modules=[{ "name": "redis", "metricsets": ["info"], @@ -69,10 +65,6 @@ def test_keyspace(self): Test redis keyspace metricset """ - if not self.oss_distribution(): - self.skipTest("only oss distribution is supported") - return - # At least one event must be inserted so db stats exist host, port = self.compose_host().split(":") r = redis.StrictRedis( @@ -109,10 +101,6 @@ def test_key(self): Test redis key metricset """ - if not self.oss_distribution(): - self.skipTest("only oss distribution is supported") - return - # At least one event must be inserted so db stats exist host, port = self.compose_host().split(":") r = redis.StrictRedis( @@ -151,10 +139,6 @@ def test_module_processors(self): Test local processors for Redis info event. """ - if not self.oss_distribution(): - self.skipTest("only oss distribution is supported") - return - fields = ["clients", "cpu"] eventFields = ['beat', 'metricset', 'service', 'event'] eventFields += ['redis.info.' + f for f in fields] @@ -182,9 +166,3 @@ def test_module_processors(self): self.assertCountEqual(fields, redis_info.keys()) self.assertCountEqual(self.de_dot(CLIENTS_FIELDS), redis_info["clients"].keys()) self.assertCountEqual(self.de_dot(CPU_FIELDS), redis_info["cpu"].keys()) - - def oss_distribution(self): - if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: - return False - - return self.COMPOSE_ENV['REDIS_DISTRIBUTION'] == 'oss' diff --git a/metricbeat/module/redis/test_redis_enterprise.py b/metricbeat/module/redis/test_redis_enterprise.py deleted file mode 100644 index cad3d128042..00000000000 --- a/metricbeat/module/redis/test_redis_enterprise.py +++ /dev/null @@ -1,60 +0,0 @@ -import os -from parameterized import parameterized -import redis -import sys -import unittest - -sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) -import metricbeat - - -@metricbeat.parameterized_with_supported_versions -class Test(metricbeat.BaseTest): - - COMPOSE_SERVICES = ['redis'] - - @parameterized.expand([ - ("node", "node"), - ("proxy", "listener") - ]) - @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") - def test_metricset(self, metricset, metric_name_prefix): - """ - Test redis enterprise metricset - """ - - if self.oss_distribution(): - self.skipTest("only oss distribution is supported") - return - - self.render_config_template(modules=[{ - "name": "redis", - "metricsets": [metricset], - "hosts": ['https://' + self.compose_host(port='8070/tcp')], - "period": "5s", - "extras": { - "ssl.verification_mode": "none" - } - }]) - proc = self.start_beat(home=self.beat_path) - self.wait_until(lambda: self.output_lines() > 0, max_timeout=120) - proc.check_kill_and_wait() - self.assert_no_logged_warnings(replace=['SSL/TLS verifications disabled.']) - - output = self.read_output_json() - self.assertGreater(len(output), 0) - - for evt in output: - self.assert_fields_are_documented(evt) - self.assertIn("prometheus", evt.keys(), evt) - self.assertIn("metrics", evt["prometheus"].keys(), evt) - self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) - - for metric in evt["prometheus"]["metrics"].keys(): - assert metric == "up" or metric.startswith(metric_name_prefix + "_") - - def oss_distribution(self): - if not 'REDIS_DISTRIBUTION' in self.COMPOSE_ENV: - return False - - return self.COMPOSE_ENV['REDIS_DISTRIBUTION'] == 'oss' diff --git a/metricbeat/modules.d/redis-enterprise.yml.disabled b/metricbeat/modules.d/redis-enterprise.yml.disabled deleted file mode 100644 index d9d409c906b..00000000000 --- a/metricbeat/modules.d/redis-enterprise.yml.disabled +++ /dev/null @@ -1,11 +0,0 @@ -# Module: redis -# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redis.html - -- module: redis - metricsets: - - node - - proxy - period: 1m - - # Metrics endpoint - hosts: ["https://127.0.0.1:8070/"] From e848ed744ecce2e1d50dc52c1d681b863866048b Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 15:00:40 +0100 Subject: [PATCH 21/30] Add redisenterprise to x-pack/metricbeat --- metricbeat/mb/testing/data/data_test.go | 3 - x-pack/metricbeat/include/list.go | 1 + x-pack/metricbeat/metricbeat.reference.yml | 10 ++ .../module/redisenterpise/_meta/Dockerfile | 6 + .../redisenterpise/_meta/config.reference.yml | 8 + .../module/redisenterpise/_meta/config.yml | 8 + .../module/redisenterpise/_meta/docs.asciidoc | 33 ++++ .../module/redisenterpise/_meta/fields.yml | 11 ++ .../redisenterpise/_meta/healthcheck.sh | 21 +++ .../_meta/supported-versions.yml | 2 + .../module/redisenterpise/docker-compose.yml | 12 ++ .../module/redisenterpise/fields.go | 23 +++ .../module/redisenterpise/module.yml | 4 + .../redisenterpise/node/_meta/data.json | 84 +++++++++ .../redisenterpise/node/_meta/docs.asciidoc | 1 + .../redisenterpise/node/_meta/fields.yml | 4 + .../node/_meta/testdata/config.yml | 4 + .../_meta/testdata/redis-node.5.4.10-22.plain | 144 +++++++++++++++ .../redis-node.5.4.10-22.plain-expected.json | 99 +++++++++++ .../module/redisenterpise/node/manifest.yml | 8 + .../node/node_integration_test.go | 48 +++++ .../module/redisenterpise/node/node_test.go | 32 ++++ .../redisenterpise/proxy/_meta/data.json | 86 +++++++++ .../redisenterpise/proxy/_meta/docs.asciidoc | 1 + .../redisenterpise/proxy/_meta/fields.yml | 4 + .../proxy/_meta/testdata/config.yml | 4 + .../testdata/redis-proxy.5.4.10-22.plain | 168 ++++++++++++++++++ .../redis-proxy.5.4.10-22.plain-expected.json | 111 ++++++++++++ .../module/redisenterpise/proxy/manifest.yml | 8 + .../proxy/proxy_integration_test.go | 48 +++++ .../module/redisenterpise/proxy/proxy_test.go | 32 ++++ .../redisenterpise/test_redisenterprise.py | 50 ++++++ .../modules.d/redisenterpise.yml.disabled | 11 ++ 33 files changed, 1086 insertions(+), 3 deletions(-) create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/config.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/fields.yml create mode 100755 x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh create mode 100644 x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/docker-compose.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/fields.go create mode 100644 x-pack/metricbeat/module/redisenterpise/module.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/data.json create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain create mode 100644 x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json create mode 100644 x-pack/metricbeat/module/redisenterpise/node/manifest.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go create mode 100644 x-pack/metricbeat/module/redisenterpise/node/node_test.go create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go create mode 100644 x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go create mode 100644 x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py create mode 100644 x-pack/metricbeat/modules.d/redisenterpise.yml.disabled diff --git a/metricbeat/mb/testing/data/data_test.go b/metricbeat/mb/testing/data/data_test.go index 8e330a3216b..a6d1f468127 100644 --- a/metricbeat/mb/testing/data/data_test.go +++ b/metricbeat/mb/testing/data/data_test.go @@ -25,13 +25,10 @@ import ( "testing" _ "github.com/elastic/beats/metricbeat/include" - "github.com/elastic/beats/metricbeat/mb" mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) func TestAll(t *testing.T) { - mb.Registry.SetSecondarySource(mb.NewLightModulesSource(getModulesPath())) - configFiles, _ := filepath.Glob(getModulesPath() + "/*/*/_meta/testdata/config.yml") for _, f := range configFiles { diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index 590accfd862..78a66ace793 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -41,6 +41,7 @@ import ( _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/performance" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/tablespace" + _ "github.com/elastic/beats/x-pack/metricbeat/module/redisenterpise" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql/query" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 26e24fcdb8c..c45be746cad 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -955,6 +955,16 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared +#-------------------------------- Redis Module -------------------------------- +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] + #--------------------------------- Sql Module --------------------------------- - module: sql metricsets: diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile b/x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile new file mode 100644 index 00000000000..9b9dfeaed7e --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile @@ -0,0 +1,6 @@ +ARG REDIS_VERSION +FROM redislabs/redis:${REDIS_VERSION} + +# Wait for the health endpoint to have monitors information +ADD healthcheck.sh / +HEALTHCHECK --interval=1s --retries=300 CMD /healthcheck.sh diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml b/x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml new file mode 100644 index 00000000000..e1f77b45723 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml @@ -0,0 +1,8 @@ +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/config.yml b/x-pack/metricbeat/module/redisenterpise/_meta/config.yml new file mode 100644 index 00000000000..e1f77b45723 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/config.yml @@ -0,0 +1,8 @@ +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc new file mode 100644 index 00000000000..7e7ed912924 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc @@ -0,0 +1,33 @@ +This module periodically fetches metrics from http://redis.io/[Redis] servers. + +The defaut metricsets are `info` and `keyspace`. + +[float] +=== Module-specific configuration notes + +The Redis module has these additional config options: + +*`hosts`*:: URLs that are used to connect to Redis. +URL format: +redis://[:password@]host[:port][/db-number][?option=value] +redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] +*`password`*:: The password to authenticate, by default it's empty. +*`idle_timeout`*:: The duration to remain idle before closing connections. If + the value is zero, then idle connections are not closed. The default value + is 2 times the module period to allow a connection to be reused across + fetches. The `idle_timeout` should be set to less than the server's connection + timeout. +*`network`*:: The network type to be used for the Redis connection. The default value is + `tcp`. +*`maxconn`*:: The maximum number of concurrent connections to Redis. The default value + is 10. + + +[float] +=== Compatibility + +The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were +tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/fields.yml b/x-pack/metricbeat/module/redisenterpise/_meta/fields.yml new file mode 100644 index 00000000000..8e54892eb64 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/fields.yml @@ -0,0 +1,11 @@ +- key: redisenterprise + title: "Redis" + description: > + Redis metrics collected from Redis Enterprise Server. + release: ga + fields: + - name: redisenterprise + type: group + description: > + `redisenterprise` contains the information and statistics from Redis Enterprise Server. + fields: diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh b/x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh new file mode 100755 index 00000000000..12b298e60c6 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +CHECK_CLUSTER_CREATED=/opt/redislabs/config/check_cluster_created +CHECK_DATABASE_CREATED=/opt/redislabs/config/check_database_created + +if [[ ! -f "${CHECK_CLUSTER_CREATED}" ]]; then + rladmin cluster create name cluster.local username cihan@redislabs.com password redislabs123 + touch ${CHECK_CLUSTER_CREATED} +fi + +if [[ ! -f "${CHECK_DATABASE_CREATED}" ]]; then + curl -s -k -u "cihan@redislabs.com:redislabs123" --request POST \ + --url "https://localhost:9443/v1/bdbs" \ + --header 'content-type: application/json' \ + --data '{"name":"db1","type":"redis","memory_size":102400,"port":12000}' + touch ${CHECK_DATABASE_CREATED} +fi + +curl -s --insecure https://127.0.0.1:8070 >/dev/null diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml b/x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml new file mode 100644 index 00000000000..05f8c81f7ed --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml @@ -0,0 +1,2 @@ +variants: + - REDIS_VERSION: 5.4.10-22 diff --git a/x-pack/metricbeat/module/redisenterpise/docker-compose.yml b/x-pack/metricbeat/module/redisenterpise/docker-compose.yml new file mode 100644 index 00000000000..b05addd1940 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/docker-compose.yml @@ -0,0 +1,12 @@ +version: '2.3' + +services: + redisenterprise: + image: docker.elastic.co/integrations-ci/beats-redisenterprise:${REDIS_VERSION:-5.4.10-22}-3 + build: + context: ./_meta + args: + REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} + privileged: true + ports: + - 8070 diff --git a/x-pack/metricbeat/module/redisenterpise/fields.go b/x-pack/metricbeat/module/redisenterpise/fields.go new file mode 100644 index 00000000000..fc80548b76a --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/fields.go @@ -0,0 +1,23 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// Code generated by beats/dev-tools/cmd/asset/asset.go - DO NOT EDIT. + +package redisenterpise + +import ( + "github.com/elastic/beats/libbeat/asset" +) + +func init() { + if err := asset.SetFields("metricbeat", "redisenterpise", asset.ModuleFieldsPri, AssetRedisenterpise); err != nil { + panic(err) + } +} + +// AssetRedisenterpise returns asset data. +// This is the base64 encoded gzipped contents of module/redisenterpise. +func AssetRedisenterpise() string { + return "eJykj0FOxDAUQ/c9hTX74QBZsOMCcIEJiQtfpEn0/wfR26OMRlWFiliMl7ZsPZ/xwTVAmcVYndpVjBPg4oUBp+eRnCYg05JKd2k14HECgGuGha6SDKmVwuTMmLUtt/Bp28QL9Yv6MAHKwmgMeIsTMAtLtnBdPKPGhUc8Q772UdL22W/OAdTQ5Vf/gtSqR6kGfyekzk2XOFqINcM8upiPE/+hD+2B99C1ZW7mEe3Q9v2VHnf+X6Nd2/d69+pPAAAA//9a0ZKZ" +} diff --git a/x-pack/metricbeat/module/redisenterpise/module.yml b/x-pack/metricbeat/module/redisenterpise/module.yml new file mode 100644 index 00000000000..2722441f03c --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/module.yml @@ -0,0 +1,4 @@ +name: redis +metricsets: + - node + - proxy diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/data.json b/x-pack/metricbeat/module/redisenterpise/node/_meta/data.json new file mode 100644 index 00000000000..2b77561b5f7 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/data.json @@ -0,0 +1,84 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "node" + }, + "service": { + "type": "redisenterprise", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "node": "1", + "instance": "127.0.0.1:8070", + "job": "redisenterprise" + }, + "metrics": { + "node_cpu_steal_median": 0, + "node_cpu_irqs_max": 0.001, + "node_cpu_user_min": 0.021, + "node_cpu_iowait_median": 0, + "node_cur_aof_rewrites": 0, + "node_ingress_bytes_min": 0, + "node_ingress_bytes_median": 0, + "node_cpu_idle_min": 0.929, + "node_cpu_iowait_max": 0, + "node_cpu_irqs": 0.0003333333333333333, + "node_available_memory": 6.262083584e+09, + "node_provisional_memory_no_overbooking": 4.757468584333e+09, + "node_cpu_idle": 0.9303333333333335, + "node_cpu_steal_max": 0 + } + }, + "event": { + "dataset": "redisenterprise.node", + "module": "redisenterprise", + "duration": 51870343 + } +} diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc new file mode 100644 index 00000000000..90e351883f4 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `node` metricset of the redisenterprise module. The metricset is compatible with Redis Enterprise Software. diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml b/x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml new file mode 100644 index 00000000000..4d523079ac9 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml @@ -0,0 +1,4 @@ +- name: node + type: group + release: beta + fields: diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml new file mode 100644 index 00000000000..361e43c5ccd --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain new file mode 100644 index 00000000000..d1b94f28efd --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain @@ -0,0 +1,144 @@ +# HELP node_cpu_nice_min +# TYPE node_cpu_nice_min gauge +node_cpu_nice_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_max +# TYPE node_cpu_idle_max gauge +node_cpu_idle_max{cluster="cluster.local",node="1"} 0.914 +# HELP node_egress_bytes +# TYPE node_egress_bytes gauge +node_egress_bytes{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_idle +# TYPE node_cpu_idle gauge +node_cpu_idle{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_irqs +# TYPE node_cpu_irqs gauge +node_cpu_irqs{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_system_median +# TYPE node_cpu_system_median gauge +node_cpu_system_median{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_user +# TYPE node_cpu_user gauge +node_cpu_user{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_irqs_min +# TYPE node_cpu_irqs_min gauge +node_cpu_irqs_min{cluster="cluster.local",node="1"} 0.001 +# HELP node_ingress_bytes_min +# TYPE node_ingress_bytes_min gauge +node_ingress_bytes_min{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_system_min +# TYPE node_cpu_system_min gauge +node_cpu_system_min{cluster="cluster.local",node="1"} 0.022 +# HELP node_cpu_irqs_median +# TYPE node_cpu_irqs_median gauge +node_cpu_irqs_median{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal +# TYPE node_cpu_steal gauge +node_cpu_steal{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_min +# TYPE node_cpu_user_min gauge +node_cpu_user_min{cluster="cluster.local",node="1"} 0.033 +# HELP node_persistent_storage_free +# TYPE node_persistent_storage_free gauge +node_persistent_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_ephemeral_storage_free +# TYPE node_ephemeral_storage_free gauge +node_ephemeral_storage_free{cluster="cluster.local",node="1"} 55931361507.556 +# HELP node_cpu_idle_median +# TYPE node_cpu_idle_median gauge +node_cpu_idle_median{cluster="cluster.local",node="1"} 0.914 +# HELP node_provisional_memory_no_overbooking +# TYPE node_provisional_memory_no_overbooking gauge +node_provisional_memory_no_overbooking{cluster="cluster.local",node="1"} 5099636117.889 +# HELP node_free_memory +# TYPE node_free_memory gauge +node_free_memory{cluster="cluster.local",node="1"} 6268220757.333 +# HELP node_ingress_bytes +# TYPE node_ingress_bytes gauge +node_ingress_bytes{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_steal_median +# TYPE node_cpu_steal_median gauge +node_cpu_steal_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_conns +# TYPE node_conns gauge +node_conns{cluster="cluster.local",node="1"} 0.0 +# HELP node_ephemeral_storage_avail +# TYPE node_ephemeral_storage_avail gauge +node_ephemeral_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_cpu_nice +# TYPE node_cpu_nice gauge +node_cpu_nice{cluster="cluster.local",node="1"} 0.0 +# HELP node_ingress_bytes_median +# TYPE node_ingress_bytes_median gauge +node_ingress_bytes_median{cluster="cluster.local",node="1"} 1006.111 +# HELP node_ingress_bytes_max +# TYPE node_ingress_bytes_max gauge +node_ingress_bytes_max{cluster="cluster.local",node="1"} 1006.111 +# HELP node_cpu_iowait +# TYPE node_cpu_iowait gauge +node_cpu_iowait{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_user_median +# TYPE node_cpu_user_median gauge +node_cpu_user_median{cluster="cluster.local",node="1"} 0.033 +# HELP node_available_memory_no_overbooking +# TYPE node_available_memory_no_overbooking gauge +node_available_memory_no_overbooking{cluster="cluster.local",node="1"} 6270062136.889 +# HELP node_cpu_nice_median +# TYPE node_cpu_nice_median gauge +node_cpu_nice_median{cluster="cluster.local",node="1"} 0.0 +# HELP node_total_req +# TYPE node_total_req gauge +node_total_req{cluster="cluster.local",node="1"} 0.0 +# HELP node_cur_aof_rewrites +# TYPE node_cur_aof_rewrites gauge +node_cur_aof_rewrites{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_max +# TYPE node_cpu_iowait_max gauge +node_cpu_iowait_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_persistent_storage_avail +# TYPE node_persistent_storage_avail gauge +node_persistent_storage_avail{cluster="cluster.local",node="1"} 52714645731.556 +# HELP node_available_memory +# TYPE node_available_memory gauge +node_available_memory{cluster="cluster.local",node="1"} 6270261475.556 +# HELP node_egress_bytes_min +# TYPE node_egress_bytes_min gauge +node_egress_bytes_min{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_user_max +# TYPE node_cpu_user_max gauge +node_cpu_user_max{cluster="cluster.local",node="1"} 0.033 +# HELP node_cpu_steal_min +# TYPE node_cpu_steal_min gauge +node_cpu_steal_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_irqs_max +# TYPE node_cpu_irqs_max gauge +node_cpu_irqs_max{cluster="cluster.local",node="1"} 0.001 +# HELP node_cpu_steal_max +# TYPE node_cpu_steal_max gauge +node_cpu_steal_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_iowait_min +# TYPE node_cpu_iowait_min gauge +node_cpu_iowait_min{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_idle_min +# TYPE node_cpu_idle_min gauge +node_cpu_idle_min{cluster="cluster.local",node="1"} 0.914 +# HELP node_cpu_system_max +# TYPE node_cpu_system_max gauge +node_cpu_system_max{cluster="cluster.local",node="1"} 0.022 +# HELP node_egress_bytes_max +# TYPE node_egress_bytes_max gauge +node_egress_bytes_max{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_nice_max +# TYPE node_cpu_nice_max gauge +node_cpu_nice_max{cluster="cluster.local",node="1"} 0.0 +# HELP node_cpu_system +# TYPE node_cpu_system gauge +node_cpu_system{cluster="cluster.local",node="1"} 0.022 +# HELP node_provisional_memory +# TYPE node_provisional_memory gauge +node_provisional_memory{cluster="cluster.local",node="1"} 5099835456.556 +# HELP node_egress_bytes_median +# TYPE node_egress_bytes_median gauge +node_egress_bytes_median{cluster="cluster.local",node="1"} 14291.444 +# HELP node_cpu_iowait_median +# TYPE node_cpu_iowait_median gauge +node_cpu_iowait_median{cluster="cluster.local",node="1"} 0.0 diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json new file mode 100644 index 00000000000..b38dd1b67f2 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json @@ -0,0 +1,99 @@ +[ + { + "event": { + "dataset": "redisenterprise.node", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "node", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:55467", + "job": "prometheus" + }, + "metrics": { + "up": 1 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + }, + { + "event": { + "dataset": "redisenterprise.node", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "node", + "period": 10000 + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "instance": "127.0.0.1:55467", + "job": "redisenterprise", + "node": "1" + }, + "metrics": { + "node_available_memory": 6270261475.556, + "node_available_memory_no_overbooking": 6270062136.889, + "node_conns": 0, + "node_cpu_idle": 0.914, + "node_cpu_idle_max": 0.914, + "node_cpu_idle_median": 0.914, + "node_cpu_idle_min": 0.914, + "node_cpu_iowait": 0, + "node_cpu_iowait_max": 0, + "node_cpu_iowait_median": 0, + "node_cpu_iowait_min": 0, + "node_cpu_irqs": 0.001, + "node_cpu_irqs_max": 0.001, + "node_cpu_irqs_median": 0.001, + "node_cpu_irqs_min": 0.001, + "node_cpu_nice": 0, + "node_cpu_nice_max": 0, + "node_cpu_nice_median": 0, + "node_cpu_nice_min": 0, + "node_cpu_steal": 0, + "node_cpu_steal_max": 0, + "node_cpu_steal_median": 0, + "node_cpu_steal_min": 0, + "node_cpu_system": 0.022, + "node_cpu_system_max": 0.022, + "node_cpu_system_median": 0.022, + "node_cpu_system_min": 0.022, + "node_cpu_user": 0.033, + "node_cpu_user_max": 0.033, + "node_cpu_user_median": 0.033, + "node_cpu_user_min": 0.033, + "node_cur_aof_rewrites": 0, + "node_egress_bytes": 14291.444, + "node_egress_bytes_max": 14291.444, + "node_egress_bytes_median": 14291.444, + "node_egress_bytes_min": 14291.444, + "node_ephemeral_storage_avail": 52714645731.556, + "node_ephemeral_storage_free": 55931361507.556, + "node_free_memory": 6268220757.333, + "node_ingress_bytes": 1006.111, + "node_ingress_bytes_max": 1006.111, + "node_ingress_bytes_median": 1006.111, + "node_ingress_bytes_min": 1006.111, + "node_persistent_storage_avail": 52714645731.556, + "node_persistent_storage_free": 55931361507.556, + "node_provisional_memory": 5099835456.556, + "node_provisional_memory_no_overbooking": 5099636117.889, + "node_total_req": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + } +] diff --git a/x-pack/metricbeat/module/redisenterpise/node/manifest.yml b/x-pack/metricbeat/module/redisenterpise/node/manifest.yml new file mode 100644 index 00000000000..fbb4c5781b3 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/manifest.yml @@ -0,0 +1,8 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + metrics_filters: + include: ["node_*"] diff --git a/x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go b/x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go new file mode 100644 index 00000000000..3eda84a1cf1 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go @@ -0,0 +1,48 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package node + +import ( + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redisenterprise", compose.UpWithTimeout(5*time.Minute)) + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redisenterprise", + "metricsets": []string{"node"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/x-pack/metricbeat/module/redisenterpise/node/node_test.go b/x-pack/metricbeat/module/redisenterpise/node/node_test.go new file mode 100644 index 00000000000..3c64e38e84e --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/node/node_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package node + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redis", "node") +} diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json new file mode 100644 index 00000000000..f58ad718622 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json @@ -0,0 +1,86 @@ +{ + "@timestamp": "2020-02-21T08:25:46.123Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "metricset": { + "period": 60000, + "name": "proxy" + }, + "service": { + "type": "redisenterprise", + "address": "127.0.0.1:8070" + }, + "ecs": { + "version": "1.4.0" + }, + "host": { + "hostname": "host", + "architecture": "x86_64", + "os": { + "family": "darwin", + "name": "Mac OS X", + "kernel": "18.7.0", + "build": "18G95", + "platform": "darwin", + "version": "10.14.6" + }, + "name": "host", + "id": "24F065F8-4274-521D-8DD5-5D27557E15B4", + "ip": [ + "fe80::aede:48ff:fe00:1122", + "fe80::1c05:593c:e271:97ed", + "192.168.0.14", + "fe80::488c:55ff:fe4e:3b46", + "fe80::def:1653:5676:ea4e", + "fe80::f191:956a:99ff:1b98", + "fe80::3128:a84c:7b38:e3a9" + ], + "mac": [ + "ac:de:48:00:11:22", + "a6:83:e7:ae:70:01", + "a4:83:e7:ae:70:01", + "06:83:e7:ae:70:01" + ] + }, + "agent": { + "ephemeral_id": "de3a043f-a71f-441e-b730-ca12a8f7fc49", + "hostname": "MacBook-Elastic.local", + "id": "993db589-f9d8-40f3-94cb-43b2b69fa9f4", + "version": "8.0.0", + "type": "metricbeat" + }, + "prometheus": { + "labels": { + "cluster": "cluster.local", + "proxy": "1", + "instance": "127.0.0.1:8070", + "job": "redisenterprise" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0 + } + }, + "event": { + "dataset": "redisenterprise.proxy", + "module": "redisenterprise", + "duration": 51870343 + } +} diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc new file mode 100644 index 00000000000..948e0e38ab2 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc @@ -0,0 +1 @@ +This is the `proxy` metricset of the redisenterprise module. The metricset is compatible with Redis Enterprise Software. diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml new file mode 100644 index 00000000000..1c1fa1b036d --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml @@ -0,0 +1,4 @@ +- name: proxy + type: group + release: beta + fields: diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml new file mode 100644 index 00000000000..361e43c5ccd --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml @@ -0,0 +1,4 @@ +type: http +url: "/" +suffix: plain +remove_fields_from_comparison: ["prometheus.labels.instance"] diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain new file mode 100644 index 00000000000..423aaadae08 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain @@ -0,0 +1,168 @@ +# HELP listener_acc_other_latency_max +# TYPE listener_acc_other_latency_max counter +listener_acc_other_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch_max +# TYPE listener_cmd_touch_max counter +listener_cmd_touch_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes +# TYPE listener_egress_bytes counter +listener_egress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req_max +# TYPE listener_read_req_max counter +listener_read_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_monitor_sessions_count +# TYPE listener_monitor_sessions_count counter +listener_monitor_sessions_count{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req_max +# TYPE listener_write_req_max counter +listener_write_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res_max +# TYPE listener_write_res_max counter +listener_write_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res_max +# TYPE listener_write_started_res_max counter +listener_write_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res_max +# TYPE listener_total_res_max counter +listener_total_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_other_latency +# TYPE listener_acc_other_latency counter +listener_acc_other_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res_max +# TYPE listener_total_started_res_max counter +listener_total_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_started_res +# TYPE listener_total_started_res counter +listener_total_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req_max +# TYPE listener_other_req_max counter +listener_other_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_req +# TYPE listener_write_req counter +listener_write_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_res +# TYPE listener_write_res counter +listener_write_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush_max +# TYPE listener_cmd_flush_max counter +listener_cmd_flush_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_touch +# TYPE listener_cmd_touch counter +listener_cmd_touch{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds +# TYPE listener_auth_cmds counter +listener_auth_cmds{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes +# TYPE listener_ingress_bytes counter +listener_ingress_bytes{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency +# TYPE listener_acc_write_latency counter +listener_acc_write_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_conns +# TYPE listener_conns counter +listener_conns{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_write_started_res +# TYPE listener_write_started_res counter +listener_write_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency +# TYPE listener_acc_latency counter +listener_acc_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency_max +# TYPE listener_acc_read_latency_max counter +listener_acc_read_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_ingress_bytes_max +# TYPE listener_ingress_bytes_max counter +listener_ingress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received +# TYPE listener_total_connections_received counter +listener_total_connections_received{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_req_time +# TYPE listener_last_req_time counter +listener_last_req_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res +# TYPE listener_other_res counter +listener_other_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res_max +# TYPE listener_other_started_res_max counter +listener_other_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_req +# TYPE listener_other_req counter +listener_other_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded +# TYPE listener_max_connections_exceeded counter +listener_max_connections_exceeded{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get +# TYPE listener_cmd_get counter +listener_cmd_get{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_res +# TYPE listener_total_res counter +listener_total_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req +# TYPE listener_total_req counter +listener_total_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res_max +# TYPE listener_read_res_max counter +listener_read_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_latency_max +# TYPE listener_acc_latency_max counter +listener_acc_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set +# TYPE listener_cmd_set counter +listener_cmd_set{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_connections_received_max +# TYPE listener_total_connections_received_max counter +listener_total_connections_received_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_cmds_max +# TYPE listener_auth_cmds_max counter +listener_auth_cmds_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_write_latency_max +# TYPE listener_acc_write_latency_max counter +listener_acc_write_latency_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors_max +# TYPE listener_auth_errors_max counter +listener_auth_errors_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_total_req_max +# TYPE listener_total_req_max counter +listener_total_req_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_max_connections_exceeded_max +# TYPE listener_max_connections_exceeded_max counter +listener_max_connections_exceeded_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_last_res_time +# TYPE listener_last_res_time counter +listener_last_res_time{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_flush +# TYPE listener_cmd_flush counter +listener_cmd_flush{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_acc_read_latency +# TYPE listener_acc_read_latency counter +listener_acc_read_latency{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res +# TYPE listener_read_started_res counter +listener_read_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_egress_bytes_max +# TYPE listener_egress_bytes_max counter +listener_egress_bytes_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_set_max +# TYPE listener_cmd_set_max counter +listener_cmd_set_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_auth_errors +# TYPE listener_auth_errors counter +listener_auth_errors{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_started_res +# TYPE listener_other_started_res counter +listener_other_started_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_started_res_max +# TYPE listener_read_started_res_max counter +listener_read_started_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_cmd_get_max +# TYPE listener_cmd_get_max counter +listener_cmd_get_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_other_res_max +# TYPE listener_other_res_max counter +listener_other_res_max{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_req +# TYPE listener_read_req counter +listener_read_req{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 +# HELP listener_read_res +# TYPE listener_read_res counter +listener_read_res{bdb="1",cluster="cluster.local",endpoint="1:1",node="1",port="12000",proxy="1:1:1"} 0.0 diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json new file mode 100644 index 00000000000..34bb26749de --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json @@ -0,0 +1,111 @@ +[ + { + "event": { + "dataset": "redisenterprise.proxy", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "bdb": "1", + "cluster": "cluster.local", + "endpoint": "1:1", + "instance": "127.0.0.1:58281", + "job": "redisenterprise", + "node": "1", + "port": "12000", + "proxy": "1:1:1" + }, + "metrics": { + "listener_acc_latency": 0, + "listener_acc_latency_max": 0, + "listener_acc_other_latency": 0, + "listener_acc_other_latency_max": 0, + "listener_acc_read_latency": 0, + "listener_acc_read_latency_max": 0, + "listener_acc_write_latency": 0, + "listener_acc_write_latency_max": 0, + "listener_auth_cmds": 0, + "listener_auth_cmds_max": 0, + "listener_auth_errors": 0, + "listener_auth_errors_max": 0, + "listener_cmd_flush": 0, + "listener_cmd_flush_max": 0, + "listener_cmd_get": 0, + "listener_cmd_get_max": 0, + "listener_cmd_set": 0, + "listener_cmd_set_max": 0, + "listener_cmd_touch": 0, + "listener_cmd_touch_max": 0, + "listener_conns": 0, + "listener_egress_bytes": 0, + "listener_egress_bytes_max": 0, + "listener_ingress_bytes": 0, + "listener_ingress_bytes_max": 0, + "listener_last_req_time": 0, + "listener_last_res_time": 0, + "listener_max_connections_exceeded": 0, + "listener_max_connections_exceeded_max": 0, + "listener_monitor_sessions_count": 0, + "listener_other_req": 0, + "listener_other_req_max": 0, + "listener_other_res": 0, + "listener_other_res_max": 0, + "listener_other_started_res": 0, + "listener_other_started_res_max": 0, + "listener_read_req": 0, + "listener_read_req_max": 0, + "listener_read_res": 0, + "listener_read_res_max": 0, + "listener_read_started_res": 0, + "listener_read_started_res_max": 0, + "listener_total_connections_received": 0, + "listener_total_connections_received_max": 0, + "listener_total_req": 0, + "listener_total_req_max": 0, + "listener_total_res": 0, + "listener_total_res_max": 0, + "listener_total_started_res": 0, + "listener_total_started_res_max": 0, + "listener_write_req": 0, + "listener_write_req_max": 0, + "listener_write_res": 0, + "listener_write_res_max": 0, + "listener_write_started_res": 0, + "listener_write_started_res_max": 0 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + }, + { + "event": { + "dataset": "redisenterprise.proxy", + "duration": 115000, + "module": "redisenterprise" + }, + "metricset": { + "name": "proxy", + "period": 10000 + }, + "prometheus": { + "labels": { + "instance": "127.0.0.1:58281", + "job": "prometheus" + }, + "metrics": { + "up": 1 + } + }, + "service": { + "address": "127.0.0.1:55555", + "type": "redisenterprise" + } + } +] diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml b/x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml new file mode 100644 index 00000000000..62327fbd5cc --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml @@ -0,0 +1,8 @@ +default: true +input: + module: prometheus + metricset: collector + defaults: + metrics_path: / + metrics_filters: + include: ["listener_*"] diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go b/x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go new file mode 100644 index 00000000000..f103b99ee32 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go @@ -0,0 +1,48 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build integration + +package proxy + +import ( + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/elastic/beats/libbeat/tests/compose" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "redisenterprise", compose.UpWithTimeout(5*time.Minute)) + + f := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := f.FetchEvents() + if len(errs) > 0 { + t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) + } + assert.NotEmpty(t, events) + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "redisenterprise", + "metricsets": []string{"proxy"}, + "hosts": []string{host}, + "ssl.verification_mode": "none", + } +} diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go b/x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go new file mode 100644 index 00000000000..c652e2ed3a2 --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go @@ -0,0 +1,32 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +// +build !integration + +package proxy + +import ( + "os" + "testing" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/mb" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + + // Register input module and metricset + _ "github.com/elastic/beats/metricbeat/module/prometheus" + _ "github.com/elastic/beats/metricbeat/module/prometheus/collector" +) + +func init() { + // To be moved to some kind of helper + os.Setenv("BEAT_STRICT_PERMS", "false") + mb.Registry.SetSecondarySource(mb.NewLightModulesSource("../../../module")) +} + +func TestEventMapping(t *testing.T) { + logp.TestingSetup() + + mbtest.TestDataFiles(t, "redis", "proxy") +} diff --git a/x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py b/x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py new file mode 100644 index 00000000000..85b05c55a6b --- /dev/null +++ b/x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py @@ -0,0 +1,50 @@ +import os +from parameterized import parameterized +import redis +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) +import metricbeat + + +@metricbeat.parameterized_with_supported_versions +class Test(metricbeat.BaseTest): + + COMPOSE_SERVICES = ['redisenterprise'] + + @parameterized.expand([ + ("node", "node"), + ("proxy", "listener") + ]) + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_metricset(self, metricset, metric_name_prefix): + """ + Test redis enterprise metricset + """ + + self.render_config_template(modules=[{ + "name": "redisenterprise", + "metricsets": [metricset], + "hosts": ['https://' + self.compose_host(port='8070/tcp')], + "period": "5s", + "extras": { + "ssl.verification_mode": "none" + } + }]) + proc = self.start_beat(home=self.beat_path) + self.wait_until(lambda: self.output_lines() > 0, max_timeout=120) + proc.check_kill_and_wait() + self.assert_no_logged_warnings(replace=['SSL/TLS verifications disabled.']) + + output = self.read_output_json() + self.assertGreater(len(output), 0) + + for evt in output: + self.assert_fields_are_documented(evt) + self.assertIn("prometheus", evt.keys(), evt) + self.assertIn("metrics", evt["prometheus"].keys(), evt) + self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) + + for metric in evt["prometheus"]["metrics"].keys(): + assert metric == "up" or metric.startswith(metric_name_prefix + "_") diff --git a/x-pack/metricbeat/modules.d/redisenterpise.yml.disabled b/x-pack/metricbeat/modules.d/redisenterpise.yml.disabled new file mode 100644 index 00000000000..5884b3a64d3 --- /dev/null +++ b/x-pack/metricbeat/modules.d/redisenterpise.yml.disabled @@ -0,0 +1,11 @@ +# Module: redisenterpise +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redisenterpise.html + +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] From 99c18325fd8596be25af09c630b7b08ba1f94e32 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 15:16:19 +0100 Subject: [PATCH 22/30] Fix: typo --- x-pack/metricbeat/include/list.go | 2 +- .../_meta/Dockerfile | 0 .../_meta/config.reference.yml | 0 .../_meta/config.yml | 0 .../_meta/docs.asciidoc | 0 .../_meta/fields.yml | 0 .../_meta/healthcheck.sh | 0 .../_meta/supported-versions.yml | 0 .../docker-compose.yml | 0 .../{redisenterpise => redisenterprise}/fields.go | 10 +++++----- .../{redisenterpise => redisenterprise}/module.yml | 2 +- .../node/_meta/data.json | 0 .../node/_meta/docs.asciidoc | 0 .../node/_meta/fields.yml | 0 .../node/_meta/testdata/config.yml | 0 .../node/_meta/testdata/redis-node.5.4.10-22.plain | 0 .../testdata/redis-node.5.4.10-22.plain-expected.json | 0 .../node/manifest.yml | 0 .../node/node_integration_test.go | 0 .../node/node_test.go | 0 .../proxy/_meta/data.json | 0 .../proxy/_meta/docs.asciidoc | 0 .../proxy/_meta/fields.yml | 0 .../proxy/_meta/testdata/config.yml | 0 .../proxy/_meta/testdata/redis-proxy.5.4.10-22.plain | 0 .../testdata/redis-proxy.5.4.10-22.plain-expected.json | 0 .../proxy/manifest.yml | 0 .../proxy/proxy_integration_test.go | 0 .../proxy/proxy_test.go | 0 .../test_redisenterprise.py | 4 ++-- ...rpise.yml.disabled => redisenterprise.yml.disabled} | 4 ++-- 31 files changed, 11 insertions(+), 11 deletions(-) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/Dockerfile (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/config.reference.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/config.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/docs.asciidoc (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/fields.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/healthcheck.sh (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/_meta/supported-versions.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/docker-compose.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/fields.go (75%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/module.yml (58%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/data.json (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/docs.asciidoc (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/fields.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/testdata/config.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/testdata/redis-node.5.4.10-22.plain (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/manifest.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/node_integration_test.go (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/node/node_test.go (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/data.json (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/docs.asciidoc (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/fields.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/testdata/config.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/manifest.yml (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/proxy_integration_test.go (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/proxy/proxy_test.go (100%) rename x-pack/metricbeat/module/{redisenterpise => redisenterprise}/test_redisenterprise.py (95%) rename x-pack/metricbeat/modules.d/{redisenterpise.yml.disabled => redisenterprise.yml.disabled} (75%) diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index 78a66ace793..5dd93240c1d 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -41,7 +41,7 @@ import ( _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/performance" _ "github.com/elastic/beats/x-pack/metricbeat/module/oracle/tablespace" - _ "github.com/elastic/beats/x-pack/metricbeat/module/redisenterpise" + _ "github.com/elastic/beats/x-pack/metricbeat/module/redisenterprise" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql" _ "github.com/elastic/beats/x-pack/metricbeat/module/sql/query" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan" diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile b/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/Dockerfile rename to x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml b/x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/config.reference.yml rename to x-pack/metricbeat/module/redisenterprise/_meta/config.reference.yml diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/config.yml b/x-pack/metricbeat/module/redisenterprise/_meta/config.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/config.yml rename to x-pack/metricbeat/module/redisenterprise/_meta/config.yml diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/docs.asciidoc rename to x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/fields.yml rename to x-pack/metricbeat/module/redisenterprise/_meta/fields.yml diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh b/x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/healthcheck.sh rename to x-pack/metricbeat/module/redisenterprise/_meta/healthcheck.sh diff --git a/x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml b/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/_meta/supported-versions.yml rename to x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml diff --git a/x-pack/metricbeat/module/redisenterpise/docker-compose.yml b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/docker-compose.yml rename to x-pack/metricbeat/module/redisenterprise/docker-compose.yml diff --git a/x-pack/metricbeat/module/redisenterpise/fields.go b/x-pack/metricbeat/module/redisenterprise/fields.go similarity index 75% rename from x-pack/metricbeat/module/redisenterpise/fields.go rename to x-pack/metricbeat/module/redisenterprise/fields.go index fc80548b76a..5ae32e6d1d7 100644 --- a/x-pack/metricbeat/module/redisenterpise/fields.go +++ b/x-pack/metricbeat/module/redisenterprise/fields.go @@ -4,20 +4,20 @@ // Code generated by beats/dev-tools/cmd/asset/asset.go - DO NOT EDIT. -package redisenterpise +package redisenterprise import ( "github.com/elastic/beats/libbeat/asset" ) func init() { - if err := asset.SetFields("metricbeat", "redisenterpise", asset.ModuleFieldsPri, AssetRedisenterpise); err != nil { + if err := asset.SetFields("metricbeat", "redisenterprise", asset.ModuleFieldsPri, AssetRedisenterprise); err != nil { panic(err) } } -// AssetRedisenterpise returns asset data. -// This is the base64 encoded gzipped contents of module/redisenterpise. -func AssetRedisenterpise() string { +// AssetRedisenterprise returns asset data. +// This is the base64 encoded gzipped contents of module/redisenterprise. +func AssetRedisenterprise() string { return "eJykj0FOxDAUQ/c9hTX74QBZsOMCcIEJiQtfpEn0/wfR26OMRlWFiliMl7ZsPZ/xwTVAmcVYndpVjBPg4oUBp+eRnCYg05JKd2k14HECgGuGha6SDKmVwuTMmLUtt/Bp28QL9Yv6MAHKwmgMeIsTMAtLtnBdPKPGhUc8Q772UdL22W/OAdTQ5Vf/gtSqR6kGfyekzk2XOFqINcM8upiPE/+hD+2B99C1ZW7mEe3Q9v2VHnf+X6Nd2/d69+pPAAAA//9a0ZKZ" } diff --git a/x-pack/metricbeat/module/redisenterpise/module.yml b/x-pack/metricbeat/module/redisenterprise/module.yml similarity index 58% rename from x-pack/metricbeat/module/redisenterpise/module.yml rename to x-pack/metricbeat/module/redisenterprise/module.yml index 2722441f03c..85a7bfbae06 100644 --- a/x-pack/metricbeat/module/redisenterpise/module.yml +++ b/x-pack/metricbeat/module/redisenterprise/module.yml @@ -1,4 +1,4 @@ -name: redis +name: redisenterprise metricsets: - node - proxy diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/data.json b/x-pack/metricbeat/module/redisenterprise/node/_meta/data.json similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/data.json rename to x-pack/metricbeat/module/redisenterprise/node/_meta/data.json diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/docs.asciidoc rename to x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/fields.yml rename to x-pack/metricbeat/module/redisenterprise/node/_meta/fields.yml diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/config.yml rename to x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/config.yml diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain rename to x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain diff --git a/x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json rename to x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json diff --git a/x-pack/metricbeat/module/redisenterpise/node/manifest.yml b/x-pack/metricbeat/module/redisenterprise/node/manifest.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/manifest.yml rename to x-pack/metricbeat/module/redisenterprise/node/manifest.yml diff --git a/x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go b/x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/node_integration_test.go rename to x-pack/metricbeat/module/redisenterprise/node/node_integration_test.go diff --git a/x-pack/metricbeat/module/redisenterpise/node/node_test.go b/x-pack/metricbeat/module/redisenterprise/node/node_test.go similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/node/node_test.go rename to x-pack/metricbeat/module/redisenterprise/node/node_test.go diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/data.json rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/docs.asciidoc rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/fields.yml rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/fields.yml diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/config.yml rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/config.yml diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json rename to x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml b/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/manifest.yml rename to x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/proxy_integration_test.go rename to x-pack/metricbeat/module/redisenterprise/proxy/proxy_integration_test.go diff --git a/x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go similarity index 100% rename from x-pack/metricbeat/module/redisenterpise/proxy/proxy_test.go rename to x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go diff --git a/x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py similarity index 95% rename from x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py rename to x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py index 85b05c55a6b..2d7d01dd979 100644 --- a/x-pack/metricbeat/module/redisenterpise/test_redisenterprise.py +++ b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py @@ -5,11 +5,11 @@ import unittest sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) -import metricbeat +from xpack_metricbeat import XPackTest, metricbeat @metricbeat.parameterized_with_supported_versions -class Test(metricbeat.BaseTest): +class Test(XPackTest): COMPOSE_SERVICES = ['redisenterprise'] diff --git a/x-pack/metricbeat/modules.d/redisenterpise.yml.disabled b/x-pack/metricbeat/modules.d/redisenterprise.yml.disabled similarity index 75% rename from x-pack/metricbeat/modules.d/redisenterpise.yml.disabled rename to x-pack/metricbeat/modules.d/redisenterprise.yml.disabled index 5884b3a64d3..c3121d7c2fb 100644 --- a/x-pack/metricbeat/modules.d/redisenterpise.yml.disabled +++ b/x-pack/metricbeat/modules.d/redisenterprise.yml.disabled @@ -1,5 +1,5 @@ -# Module: redisenterpise -# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redisenterpise.html +# Module: redisenterprise +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-redisenterprise.html - module: redisenterprise metricsets: From 58367446ccf61ff6316dba0ff8db7142a35e5aa4 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 15:22:48 +0100 Subject: [PATCH 23/30] Fix: rename to redisenterprise --- x-pack/metricbeat/module/redisenterprise/node/node_test.go | 2 +- x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/metricbeat/module/redisenterprise/node/node_test.go b/x-pack/metricbeat/module/redisenterprise/node/node_test.go index 3c64e38e84e..153a589d7a6 100644 --- a/x-pack/metricbeat/module/redisenterprise/node/node_test.go +++ b/x-pack/metricbeat/module/redisenterprise/node/node_test.go @@ -28,5 +28,5 @@ func init() { func TestEventMapping(t *testing.T) { logp.TestingSetup() - mbtest.TestDataFiles(t, "redis", "node") + mbtest.TestDataFiles(t, "redisenterprise", "node") } diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go index c652e2ed3a2..fb68fdbeb12 100644 --- a/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go +++ b/x-pack/metricbeat/module/redisenterprise/proxy/proxy_test.go @@ -28,5 +28,5 @@ func init() { func TestEventMapping(t *testing.T) { logp.TestingSetup() - mbtest.TestDataFiles(t, "redis", "proxy") + mbtest.TestDataFiles(t, "redisenterprise", "proxy") } From 001332499189b078ff0795f430fd06521fe918d1 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 16:27:07 +0100 Subject: [PATCH 24/30] Update docs --- metricbeat/docs/fields.asciidoc | 1327 +---------------- metricbeat/docs/modules/redis.asciidoc | 12 - metricbeat/docs/modules/redis/info.asciidoc | 5 +- metricbeat/docs/modules/redis/key.asciidoc | 4 +- .../docs/modules/redis/keyspace.asciidoc | 5 +- .../docs/modules/redisenterprise.asciidoc | 60 + .../{redis => redisenterprise}/node.asciidoc | 8 +- .../{redis => redisenterprise}/proxy.asciidoc | 8 +- metricbeat/docs/modules_list.asciidoc | 11 +- .../redisenterprise/_meta/docs.asciidoc | 21 +- 10 files changed, 88 insertions(+), 1373 deletions(-) create mode 100644 metricbeat/docs/modules/redisenterprise.asciidoc rename metricbeat/docs/modules/{redis => redisenterprise}/node.asciidoc (56%) rename metricbeat/docs/modules/{redis => redisenterprise}/proxy.asciidoc (56%) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 07220608d61..45bd5188ef8 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -65,7 +65,7 @@ grouped in the following categories: * <> * <> * <> -* <> +* <> * <> * <> * <> @@ -32473,1337 +32473,20 @@ type: long -- -[[exported-fields-redis]] +[[exported-fields-redisenterprise]] == Redis fields -Redis metrics collected from Redis. - - - -[float] -=== redis - -`redis` contains the information and statistics from Redis. - - - -[float] -=== info - -`info` contains the information and statistics returned by the `INFO` command. - - - -[float] -=== clients - -Redis client stats. - - - -*`redis.info.clients.connected`*:: -+ --- -Number of client connections (excluding connections from slaves). - - -type: long - --- - -*`redis.info.clients.longest_output_list`*:: -+ --- - -deprecated:[6.5.0] - -Longest output list among current client connections (replaced by max_output_buffer). - - -type: long - --- - -*`redis.info.clients.max_output_buffer`*:: -+ --- -Longest output list among current client connections. - - -type: long - --- - -*`redis.info.clients.biggest_input_buf`*:: -+ --- - -deprecated:[6.5.0] - -Biggest input buffer among current client connections (replaced by max_input_buffer). - - -type: long - --- - -*`redis.info.clients.max_input_buffer`*:: -+ --- -Biggest input buffer among current client connections (on redis 5.0). - - -type: long - --- - -*`redis.info.clients.blocked`*:: -+ --- -Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH). - - -type: long - --- - -[float] -=== cluster - -Redis cluster information. - - - -*`redis.info.cluster.enabled`*:: -+ --- -Indicates that the Redis cluster is enabled. - - -type: boolean - --- - -[float] -=== cpu - -Redis CPU stats - - - -*`redis.info.cpu.used.sys`*:: -+ --- -System CPU consumed by the Redis server. - - -type: scaled_float - --- - -*`redis.info.cpu.used.sys_children`*:: -+ --- -User CPU consumed by the Redis server. - - -type: scaled_float - --- - -*`redis.info.cpu.used.user`*:: -+ --- -System CPU consumed by the background processes. - - -type: scaled_float - --- - -*`redis.info.cpu.used.user_children`*:: -+ --- -User CPU consumed by the background processes. - - -type: scaled_float - --- - -[float] -=== memory - -Redis memory stats. - - - -*`redis.info.memory.used.value`*:: -+ --- -Total number of bytes allocated by Redis. - - -type: long - -format: bytes - --- - -*`redis.info.memory.used.rss`*:: -+ --- -Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size). - - -type: long - -format: bytes - --- - -*`redis.info.memory.used.peak`*:: -+ --- -Peak memory consumed by Redis. - - -type: long - -format: bytes - --- - -*`redis.info.memory.used.lua`*:: -+ --- -Used memory by the Lua engine. - - -type: long - -format: bytes - --- - -*`redis.info.memory.used.dataset`*:: -+ --- -The size in bytes of the dataset - - -type: long - -format: bytes - --- - -*`redis.info.memory.max.value`*:: -+ --- -Memory limit. - - -type: long - -format: bytes - --- - -*`redis.info.memory.max.policy`*:: -+ --- -Eviction policy to use when memory limit is reached. - - -type: keyword - --- - -*`redis.info.memory.fragmentation.ratio`*:: -+ --- -Ratio between used_memory_rss and used_memory - - -type: float - --- - -*`redis.info.memory.fragmentation.bytes`*:: -+ --- -Bytes between used_memory_rss and used_memory - - -type: long - -format: bytes - --- - -*`redis.info.memory.active_defrag.is_running`*:: -+ --- -Flag indicating if active defragmentation is active - - -type: boolean - --- - -*`redis.info.memory.allocator`*:: -+ --- -Memory allocator. - - -type: keyword - --- - - -*`redis.info.memory.allocator_stats.allocated`*:: -+ --- -Allocated memory - - -type: long - -format: bytes - --- - -*`redis.info.memory.allocator_stats.active`*:: -+ --- -Active memeory - - -type: long - -format: bytes - --- - -*`redis.info.memory.allocator_stats.resident`*:: -+ --- -Resident memory - - -type: long - -format: bytes - --- - -*`redis.info.memory.allocator_stats.fragmentation.ratio`*:: -+ --- -Fragmentation ratio - - -type: float - --- - -*`redis.info.memory.allocator_stats.fragmentation.bytes`*:: -+ --- -Fragmented bytes - - -type: long - -format: bytes - --- - -*`redis.info.memory.allocator_stats.rss.ratio`*:: -+ --- -Resident ratio - - -type: float - --- - -*`redis.info.memory.allocator_stats.rss.bytes`*:: -+ --- -Resident bytes - - -type: long - -format: bytes - --- - -[float] -=== persistence - -Redis CPU stats. - - - -*`redis.info.persistence.loading`*:: -+ --- -Flag indicating if the load of a dump file is on-going - - -type: boolean - --- - -[float] -=== rdb - -Provides information about RDB persistence - - - -*`redis.info.persistence.rdb.last_save.changes_since`*:: -+ --- -Number of changes since the last dump - - -type: long - --- - -*`redis.info.persistence.rdb.last_save.time`*:: -+ --- -Epoch-based timestamp of last successful RDB save - - -type: long - --- - -*`redis.info.persistence.rdb.bgsave.in_progress`*:: -+ --- -Flag indicating a RDB save is on-going - - -type: boolean - --- - -*`redis.info.persistence.rdb.bgsave.last_status`*:: -+ --- -Status of the last RDB save operation - - -type: keyword - --- - -*`redis.info.persistence.rdb.bgsave.last_time.sec`*:: -+ --- -Duration of the last RDB save operation in seconds - - -type: long - -format: duration - --- - -*`redis.info.persistence.rdb.bgsave.current_time.sec`*:: -+ --- -Duration of the on-going RDB save operation if any - - -type: long - -format: duration - --- - -*`redis.info.persistence.rdb.copy_on_write.last_size`*:: -+ --- -The size in bytes of copy-on-write allocations during the last RBD save operation - - -type: long +Redis metrics collected from Redis Enterprise Server. -format: bytes --- [float] -=== aof - -Provides information about AOF persitence - - - -*`redis.info.persistence.aof.enabled`*:: -+ --- -Flag indicating AOF logging is activated - - -type: boolean - --- - -*`redis.info.persistence.aof.rewrite.in_progress`*:: -+ --- -Flag indicating a AOF rewrite operation is on-going - - -type: boolean - --- - -*`redis.info.persistence.aof.rewrite.scheduled`*:: -+ --- -Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete. +=== redisenterprise +`redisenterprise` contains the information and statistics from Redis Enterprise Server. -type: boolean - --- - -*`redis.info.persistence.aof.rewrite.last_time.sec`*:: -+ --- -Duration of the last AOF rewrite operation in seconds -type: long - -format: duration - --- - -*`redis.info.persistence.aof.rewrite.current_time.sec`*:: -+ --- -Duration of the on-going AOF rewrite operation if any - - -type: long - -format: duration - --- - -*`redis.info.persistence.aof.rewrite.buffer.size`*:: -+ --- -Size of the AOF rewrite buffer - - -type: long - -format: bytes - --- - -*`redis.info.persistence.aof.bgrewrite.last_status`*:: -+ --- -Status of the last AOF rewrite operatio - - -type: keyword - --- - -*`redis.info.persistence.aof.write.last_status`*:: -+ --- -Status of the last write operation to the AOF - - -type: keyword - --- - -*`redis.info.persistence.aof.copy_on_write.last_size`*:: -+ --- -The size in bytes of copy-on-write allocations during the last RBD save operation - - -type: long - -format: bytes - --- - -*`redis.info.persistence.aof.buffer.size`*:: -+ --- -Size of the AOF buffer - - -type: long - -format: bytes - --- - -*`redis.info.persistence.aof.size.current`*:: -+ --- -AOF current file size - - -type: long - -format: bytes - --- - -*`redis.info.persistence.aof.size.base`*:: -+ --- -AOF file size on latest startup or rewrite - - -type: long - -format: bytes - --- - -*`redis.info.persistence.aof.fsync.pending`*:: -+ --- -Number of fsync pending jobs in background I/O queue - - -type: long - --- - -*`redis.info.persistence.aof.fsync.delayed`*:: -+ --- -Delayed fsync counter - - -type: long - --- - -[float] -=== replication - -Replication - - - -*`redis.info.replication.role`*:: -+ --- -Role of the instance (can be "master", or "slave"). - - -type: keyword - --- - -*`redis.info.replication.connected_slaves`*:: -+ --- -Number of connected slaves - - -type: long - --- - -*`redis.info.replication.master_offset`*:: -+ --- - -deprecated:[6.5] - -The server's current replication offset - - -type: long - --- - -*`redis.info.replication.backlog.active`*:: -+ --- -Flag indicating replication backlog is active - - -type: long - --- - -*`redis.info.replication.backlog.size`*:: -+ --- -Total size in bytes of the replication backlog buffer - - -type: long - -format: bytes - --- - -*`redis.info.replication.backlog.first_byte_offset`*:: -+ --- -The master offset of the replication backlog buffer - - -type: long - --- - -*`redis.info.replication.backlog.histlen`*:: -+ --- -Size in bytes of the data in the replication backlog buffer - - -type: long - --- - -*`redis.info.replication.master.offset`*:: -+ --- -The server's current replication offset - - -type: long - --- - -*`redis.info.replication.master.second_offset`*:: -+ --- -The offset up to which replication IDs are accepted - - -type: long - --- - -*`redis.info.replication.master.link_status`*:: -+ --- -Status of the link (up/down) - - -type: keyword - --- - -*`redis.info.replication.master.last_io_seconds_ago`*:: -+ --- -Number of seconds since the last interaction with master - - -type: long - -format: duration - --- - -*`redis.info.replication.master.sync.in_progress`*:: -+ --- -Indicate the master is syncing to the slave - - -type: boolean - --- - -*`redis.info.replication.master.sync.left_bytes`*:: -+ --- -Number of bytes left before syncing is complete - - -type: long - -format: bytes - --- - -*`redis.info.replication.master.sync.last_io_seconds_ago`*:: -+ --- -Number of seconds since last transfer I/O during a SYNC operation - - -type: long - -format: duration - --- - -*`redis.info.replication.slave.offset`*:: -+ --- -The replication offset of the slave instance - - -type: long - --- - -*`redis.info.replication.slave.priority`*:: -+ --- -The priority of the instance as a candidate for failover - - -type: long - --- - -*`redis.info.replication.slave.is_readonly`*:: -+ --- -Flag indicating if the slave is read-only - - -type: boolean - --- - -[float] -=== server - -Server info - - - -*`redis.info.server.version`*:: -+ --- -None - -type: alias - -alias to: service.version - --- - -*`redis.info.server.git_sha1`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.git_dirty`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.build_id`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.mode`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.os`*:: -+ --- -None - -type: alias - -alias to: os.full - --- - -*`redis.info.server.arch_bits`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.multiplexing_api`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.gcc_version`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.process_id`*:: -+ --- -None - -type: alias - -alias to: process.pid - --- - -*`redis.info.server.run_id`*:: -+ --- -None - -type: keyword - --- - -*`redis.info.server.tcp_port`*:: -+ --- -None - -type: long - --- - -*`redis.info.server.uptime`*:: -+ --- -None - -type: long - --- - -*`redis.info.server.hz`*:: -+ --- -None - -type: long - --- - -*`redis.info.server.lru_clock`*:: -+ --- -None - -type: long - --- - -*`redis.info.server.config_file`*:: -+ --- -None - -type: keyword - --- - -[float] -=== stats - -Redis stats. - - - -*`redis.info.stats.connections.received`*:: -+ --- -Total number of connections received. - -type: long - --- - -*`redis.info.stats.connections.rejected`*:: -+ --- -Total number of connections rejected. - -type: long - --- - -*`redis.info.stats.commands_processed`*:: -+ --- -Total number of commands processed. - -type: long - --- - -*`redis.info.stats.net.input.bytes`*:: -+ --- -Total network input in bytes. - -type: long - --- - -*`redis.info.stats.net.output.bytes`*:: -+ --- -Total network output in bytes. - -type: long - --- - -*`redis.info.stats.instantaneous.ops_per_sec`*:: -+ --- -Number of commands processed per second - - -type: long - --- - -*`redis.info.stats.instantaneous.input_kbps`*:: -+ --- -The network's read rate per second in KB/sec - - -type: scaled_float - --- - -*`redis.info.stats.instantaneous.output_kbps`*:: -+ --- -The network's write rate per second in KB/sec - - -type: scaled_float - --- - -*`redis.info.stats.sync.full`*:: -+ --- -The number of full resyncs with slaves - - -type: long - --- - -*`redis.info.stats.sync.partial.ok`*:: -+ --- -The number of accepted partial resync requests - - -type: long - --- - -*`redis.info.stats.sync.partial.err`*:: -+ --- -The number of denied partial resync requests - - -type: long - --- - -*`redis.info.stats.keys.expired`*:: -+ --- -Total number of key expiration events - - -type: long - --- - -*`redis.info.stats.keys.evicted`*:: -+ --- -Number of evicted keys due to maxmemory limit - - -type: long - --- - -*`redis.info.stats.keyspace.hits`*:: -+ --- -Number of successful lookup of keys in the main dictionary - - -type: long - --- - -*`redis.info.stats.keyspace.misses`*:: -+ --- -Number of failed lookup of keys in the main dictionary - - -type: long - --- - -*`redis.info.stats.pubsub.channels`*:: -+ --- -Global number of pub/sub channels with client subscriptions - - -type: long - --- - -*`redis.info.stats.pubsub.patterns`*:: -+ --- -Global number of pub/sub pattern with client subscriptions - - -type: long - --- - -*`redis.info.stats.latest_fork_usec`*:: -+ --- -Duration of the latest fork operation in microseconds - - -type: long - --- - -*`redis.info.stats.migrate_cached_sockets`*:: -+ --- -The number of sockets open for MIGRATE purposes - - -type: long - --- - -*`redis.info.stats.slave_expires_tracked_keys`*:: -+ --- -The number of keys tracked for expiry purposes (applicable only to writable slaves) - - -type: long - --- - -*`redis.info.stats.active_defrag.hits`*:: -+ --- -Number of value reallocations performed by active the defragmentation process - - -type: long - --- - -*`redis.info.stats.active_defrag.misses`*:: -+ --- -Number of aborted value reallocations started by the active defragmentation process - - -type: long - --- - -*`redis.info.stats.active_defrag.key_hits`*:: -+ --- -Number of keys that were actively defragmented - - -type: long - --- - -*`redis.info.stats.active_defrag.key_misses`*:: -+ --- -Number of keys that were skipped by the active defragmentation process - - -type: long - --- - -*`redis.info.slowlog.count`*:: -+ --- -Count of slow operations - - -type: long - --- - -[float] -=== key - -`key` contains information about keys. - - - -*`redis.key.name`*:: -+ --- -Key name. - - -type: keyword - --- - -*`redis.key.id`*:: -+ --- -Unique id for this key (With the form :). - - -type: keyword - --- - -*`redis.key.type`*:: -+ --- -Key type as shown by `TYPE` command. - - -type: keyword - --- - -*`redis.key.length`*:: -+ --- -Length of the key (Number of elements for lists, length for strings, cardinality for sets). - - -type: long - --- - -*`redis.key.expire.ttl`*:: -+ --- -Seconds to expire. - - -type: long - --- - -[float] -=== keyspace - -`keyspace` contains the information about the keyspaces returned by the `INFO` command. - - - -*`redis.keyspace.id`*:: -+ --- -Keyspace identifier. - - -type: keyword - --- - -*`redis.keyspace.avg_ttl`*:: -+ --- -Average ttl. - - -type: long - --- - -*`redis.keyspace.keys`*:: -+ --- -Number of keys in the keyspace. - - -type: long - --- - -*`redis.keyspace.expires`*:: -+ --- - - -type: long - --- - [[exported-fields-sql]] == sql fields diff --git a/metricbeat/docs/modules/redis.asciidoc b/metricbeat/docs/modules/redis.asciidoc index 885c9c3023b..50f466f928b 100644 --- a/metricbeat/docs/modules/redis.asciidoc +++ b/metricbeat/docs/modules/redis.asciidoc @@ -3,7 +3,6 @@ This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-module-redis]] -[role="xpack"] == Redis module This module periodically fetches metrics from http://redis.io/[Redis] servers. @@ -37,9 +36,6 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. -The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES -5.4.10-22 and are expected to work with all versions >= 5.0.2. - [float] === Example configuration @@ -93,17 +89,9 @@ The following metricsets are available: * <> -* <> - -* <> - include::redis/info.asciidoc[] include::redis/key.asciidoc[] include::redis/keyspace.asciidoc[] -include::redis/node.asciidoc[] - -include::redis/proxy.asciidoc[] - diff --git a/metricbeat/docs/modules/redis/info.asciidoc b/metricbeat/docs/modules/redis/info.asciidoc index 9a3e5dbc70e..cf13ce7f6f5 100644 --- a/metricbeat/docs/modules/redis/info.asciidoc +++ b/metricbeat/docs/modules/redis/info.asciidoc @@ -5,8 +5,9 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-info]] === Redis info metricset -include::../../../../x-pack/metricbeat/module/redis/info/_meta/docs.asciidoc[] +include::../../../module/redis/info/_meta/docs.asciidoc[] +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields @@ -17,5 +18,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/redis/info/_meta/data.json[] +include::../../../module/redis/info/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/key.asciidoc b/metricbeat/docs/modules/redis/key.asciidoc index d6949aba9ab..b5e569957c5 100644 --- a/metricbeat/docs/modules/redis/key.asciidoc +++ b/metricbeat/docs/modules/redis/key.asciidoc @@ -5,7 +5,7 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-key]] === Redis key metricset -include::../../../../x-pack/metricbeat/module/redis/key/_meta/docs.asciidoc[] +include::../../../module/redis/key/_meta/docs.asciidoc[] ==== Fields @@ -17,5 +17,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/redis/key/_meta/data.json[] +include::../../../module/redis/key/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/keyspace.asciidoc b/metricbeat/docs/modules/redis/keyspace.asciidoc index 77e35a0d81a..fe842062054 100644 --- a/metricbeat/docs/modules/redis/keyspace.asciidoc +++ b/metricbeat/docs/modules/redis/keyspace.asciidoc @@ -5,8 +5,9 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-metricset-redis-keyspace]] === Redis keyspace metricset -include::../../../../x-pack/metricbeat/module/redis/keyspace/_meta/docs.asciidoc[] +include::../../../module/redis/keyspace/_meta/docs.asciidoc[] +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields @@ -17,5 +18,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/redis/keyspace/_meta/data.json[] +include::../../../module/redis/keyspace/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redisenterprise.asciidoc b/metricbeat/docs/modules/redisenterprise.asciidoc new file mode 100644 index 00000000000..662771ab732 --- /dev/null +++ b/metricbeat/docs/modules/redisenterprise.asciidoc @@ -0,0 +1,60 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-module-redisenterprise]] +[role="xpack"] +== Redis module + +This module periodically fetches metrics from https://redislabs.com/redis-enterprise/[Redis Enterprise Software]. + +The defaut metricsets are `node` and `proxy`. + +[float] +=== Module-specific configuration notes + +The Redis module has these additional config options: + +*`hosts`*:: URLs that are used to connect to Redis. +URL format: +https://HOST[:PORT] + +[float] +=== Compatibility + +The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES +5.4.10-22 and are expected to work with all versions >= 5.0.2. + + +[float] +=== Example configuration + +The Redis module supports the standard configuration options that are described +in <>. Here is an example configuration: + +[source,yaml] +---- +metricbeat.modules: +- module: redisenterprise + metricsets: + - node + - proxy + period: 1m + + # Metrics endpoint + hosts: ["https://127.0.0.1:8070/"] +---- + +[float] +=== Metricsets + +The following metricsets are available: + +* <> + +* <> + +include::redisenterprise/node.asciidoc[] + +include::redisenterprise/proxy.asciidoc[] + diff --git a/metricbeat/docs/modules/redis/node.asciidoc b/metricbeat/docs/modules/redisenterprise/node.asciidoc similarity index 56% rename from metricbeat/docs/modules/redis/node.asciidoc rename to metricbeat/docs/modules/redisenterprise/node.asciidoc index a3cb5ee6742..ead2b30c9d6 100644 --- a/metricbeat/docs/modules/redis/node.asciidoc +++ b/metricbeat/docs/modules/redisenterprise/node.asciidoc @@ -2,23 +2,23 @@ This file is generated! See scripts/mage/docs_collector.go //// -[[metricbeat-metricset-redis-node]] +[[metricbeat-metricset-redisenterprise-node]] === Redis node metricset beta[] -include::../../../../x-pack/metricbeat/module/redis/node/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redisenterprise/node/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields For a description of each field in the metricset, see the -<> section. +<> section. Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/redis/node/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redisenterprise/node/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/redis/proxy.asciidoc b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc similarity index 56% rename from metricbeat/docs/modules/redis/proxy.asciidoc rename to metricbeat/docs/modules/redisenterprise/proxy.asciidoc index 85cb2029348..e996c1c2220 100644 --- a/metricbeat/docs/modules/redis/proxy.asciidoc +++ b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc @@ -2,23 +2,23 @@ This file is generated! See scripts/mage/docs_collector.go //// -[[metricbeat-metricset-redis-proxy]] +[[metricbeat-metricset-redisenterprise-proxy]] === Redis proxy metricset beta[] -include::../../../../x-pack/metricbeat/module/redis/proxy/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/redisenterprise/proxy/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields For a description of each field in the metricset, see the -<> section. +<> section. Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/redis/proxy/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/redisenterprise/proxy/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 9da750ba196..d754442b4f0 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -196,15 +196,12 @@ This file is generated! See scripts/mage/docs_collector.go |<> |<> |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> -|<> -|<> -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | .3+| .3+| |<> |<> |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> beta[] +|<> beta[] |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | @@ -299,7 +296,7 @@ include::modules/postgresql.asciidoc[] include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] -include::modules/redis.asciidoc[] +include::modules/redisenterprise.asciidoc[] include::modules/sql.asciidoc[] include::modules/stan.asciidoc[] include::modules/statsd.asciidoc[] diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc b/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc index 7e7ed912924..4484f89df91 100644 --- a/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/redisenterprise/_meta/docs.asciidoc @@ -1,6 +1,6 @@ -This module periodically fetches metrics from http://redis.io/[Redis] servers. +This module periodically fetches metrics from https://redislabs.com/redis-enterprise/[Redis Enterprise Software]. -The defaut metricsets are `info` and `keyspace`. +The defaut metricsets are `node` and `proxy`. [float] === Module-specific configuration notes @@ -9,25 +9,10 @@ The Redis module has these additional config options: *`hosts`*:: URLs that are used to connect to Redis. URL format: -redis://[:password@]host[:port][/db-number][?option=value] -redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] -*`password`*:: The password to authenticate, by default it's empty. -*`idle_timeout`*:: The duration to remain idle before closing connections. If - the value is zero, then idle connections are not closed. The default value - is 2 times the module period to allow a connection to be reused across - fetches. The `idle_timeout` should be set to less than the server's connection - timeout. -*`network`*:: The network type to be used for the Redis connection. The default value is - `tcp`. -*`maxconn`*:: The maximum number of concurrent connections to Redis. The default value - is 10. - +https://HOST[:PORT] [float] === Compatibility -The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were -tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. - The metricsets `node` and `proxy` are compatible with Redis Enterprise Software (RES). There were tested with RES 5.4.10-22 and are expected to work with all versions >= 5.0.2. From 65ea1b50e3a024049e55abdecb5c41484bb2008a Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 16:32:56 +0100 Subject: [PATCH 25/30] Fix --- x-pack/metricbeat/metricbeat.reference.yml | 2 +- x-pack/metricbeat/module/redisenterprise/_meta/fields.yml | 4 ++-- x-pack/metricbeat/module/redisenterprise/fields.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index c45be746cad..25f8beb38f2 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -955,7 +955,7 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared -#-------------------------------- Redis Module -------------------------------- +#--------------------------- Redis Enterprise Module --------------------------- - module: redisenterprise metricsets: - node diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml b/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml index 8e54892eb64..7f697324521 100644 --- a/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml +++ b/x-pack/metricbeat/module/redisenterprise/_meta/fields.yml @@ -1,8 +1,8 @@ - key: redisenterprise - title: "Redis" + title: "Redis Enterprise" description: > Redis metrics collected from Redis Enterprise Server. - release: ga + release: beta fields: - name: redisenterprise type: group diff --git a/x-pack/metricbeat/module/redisenterprise/fields.go b/x-pack/metricbeat/module/redisenterprise/fields.go index 5ae32e6d1d7..7695ff24329 100644 --- a/x-pack/metricbeat/module/redisenterprise/fields.go +++ b/x-pack/metricbeat/module/redisenterprise/fields.go @@ -19,5 +19,5 @@ func init() { // AssetRedisenterprise returns asset data. // This is the base64 encoded gzipped contents of module/redisenterprise. func AssetRedisenterprise() string { - return "eJykj0FOxDAUQ/c9hTX74QBZsOMCcIEJiQtfpEn0/wfR26OMRlWFiliMl7ZsPZ/xwTVAmcVYndpVjBPg4oUBp+eRnCYg05JKd2k14HECgGuGha6SDKmVwuTMmLUtt/Bp28QL9Yv6MAHKwmgMeIsTMAtLtnBdPKPGhUc8Q772UdL22W/OAdTQ5Vf/gtSqR6kGfyekzk2XOFqINcM8upiPE/+hD+2B99C1ZW7mEe3Q9v2VHnf+X6Nd2/d69+pPAAAA//9a0ZKZ" + return "eJykjztOBDEQRHOforT5cgAHZFwALrDGroUWHtvqbhBze2Q+q9VoEAEv7E/p1REvXCOURYzNqUPFGAAXr4w43M8N7i6rQwAKLasMl94ibgMAfJ0tdJVsyL1WZmfBWfuCbQYeqG/UmwAoK5Mx4pGeAnAW1mLxM/OIlhbuyU18HYx40v46vic7WpPT5v+E3JsnaQZ/JqSduy5pfiG1AvPkYj5r/CU/uRa+lm698DLcs51s2//wW+jQ/r7+O/UjAAD//wOWl64=" } From 44b2ce4cc8c479ba0b3453cadabc7c34edfb8433 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 16:44:47 +0100 Subject: [PATCH 26/30] Use capability: SYS_RESOURCE --- x-pack/metricbeat/module/redisenterprise/docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/redisenterprise/docker-compose.yml b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml index b05addd1940..1932478c840 100644 --- a/x-pack/metricbeat/module/redisenterprise/docker-compose.yml +++ b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml @@ -7,6 +7,7 @@ services: context: ./_meta args: REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} - privileged: true + cap_add: + - SYS_RESOURCE ports: - 8070 From 80382f4c4b9b0b3c5b427e22c1bb9bfff16c6082 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 17:15:52 +0100 Subject: [PATCH 27/30] mage check --- metricbeat/docs/fields.asciidoc | 2 +- metricbeat/docs/modules/redisenterprise.asciidoc | 6 ++++-- metricbeat/docs/modules/redisenterprise/node.asciidoc | 2 +- metricbeat/docs/modules/redisenterprise/proxy.asciidoc | 2 +- metricbeat/docs/modules_list.asciidoc | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 45bd5188ef8..20358e1a84e 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -32474,7 +32474,7 @@ type: long -- [[exported-fields-redisenterprise]] -== Redis fields +== Redis Enterprise fields Redis metrics collected from Redis Enterprise Server. diff --git a/metricbeat/docs/modules/redisenterprise.asciidoc b/metricbeat/docs/modules/redisenterprise.asciidoc index 662771ab732..63cc4b39bc5 100644 --- a/metricbeat/docs/modules/redisenterprise.asciidoc +++ b/metricbeat/docs/modules/redisenterprise.asciidoc @@ -4,7 +4,9 @@ This file is generated! See scripts/mage/docs_collector.go [[metricbeat-module-redisenterprise]] [role="xpack"] -== Redis module +== Redis Enterprise module + +beta[] This module periodically fetches metrics from https://redislabs.com/redis-enterprise/[Redis Enterprise Software]. @@ -29,7 +31,7 @@ The metricsets `node` and `proxy` are compatible with Redis Enterprise Software [float] === Example configuration -The Redis module supports the standard configuration options that are described +The Redis Enterprise module supports the standard configuration options that are described in <>. Here is an example configuration: [source,yaml] diff --git a/metricbeat/docs/modules/redisenterprise/node.asciidoc b/metricbeat/docs/modules/redisenterprise/node.asciidoc index ead2b30c9d6..90103d11923 100644 --- a/metricbeat/docs/modules/redisenterprise/node.asciidoc +++ b/metricbeat/docs/modules/redisenterprise/node.asciidoc @@ -3,7 +3,7 @@ This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-metricset-redisenterprise-node]] -=== Redis node metricset +=== Redis Enterprise node metricset beta[] diff --git a/metricbeat/docs/modules/redisenterprise/proxy.asciidoc b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc index e996c1c2220..cee1e06ebd4 100644 --- a/metricbeat/docs/modules/redisenterprise/proxy.asciidoc +++ b/metricbeat/docs/modules/redisenterprise/proxy.asciidoc @@ -3,7 +3,7 @@ This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-metricset-redisenterprise-proxy]] -=== Redis proxy metricset +=== Redis Enterprise proxy metricset beta[] diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index d754442b4f0..bcaabdc4de0 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -199,7 +199,7 @@ This file is generated! See scripts/mage/docs_collector.go .3+| .3+| |<> |<> |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .2+| .2+| |<> beta[] |<> beta[] |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | From 806a89b8f2e1141bfe7c2a8b7e19fd4fad7a7079 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 19:11:42 +0100 Subject: [PATCH 28/30] Exclude 'up' --- x-pack/metricbeat/module/redisenterprise/node/manifest.yml | 1 + x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml | 1 + .../metricbeat/module/redisenterprise/test_redisenterprise.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/redisenterprise/node/manifest.yml b/x-pack/metricbeat/module/redisenterprise/node/manifest.yml index fbb4c5781b3..3cf6f512a44 100644 --- a/x-pack/metricbeat/module/redisenterprise/node/manifest.yml +++ b/x-pack/metricbeat/module/redisenterprise/node/manifest.yml @@ -6,3 +6,4 @@ input: metrics_path: / metrics_filters: include: ["node_*"] + exclude: ["up"] diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml b/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml index 62327fbd5cc..20a090d9da3 100644 --- a/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml +++ b/x-pack/metricbeat/module/redisenterprise/proxy/manifest.yml @@ -6,3 +6,4 @@ input: metrics_path: / metrics_filters: include: ["listener_*"] + exclude: ["up"] diff --git a/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py index 2d7d01dd979..806f7a37c7a 100644 --- a/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py +++ b/x-pack/metricbeat/module/redisenterprise/test_redisenterprise.py @@ -47,4 +47,4 @@ def test_metricset(self, metricset, metric_name_prefix): self.assertGreater(len(evt["prometheus"]["metrics"].keys()), 0) for metric in evt["prometheus"]["metrics"].keys(): - assert metric == "up" or metric.startswith(metric_name_prefix + "_") + assert metric.startswith(metric_name_prefix + "_") From 514cec0acbab06ef24688a2d9ed215ee44d4392a Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 27 Feb 2020 20:44:20 +0100 Subject: [PATCH 29/30] Adjust source after review --- CHANGELOG.next.asciidoc | 1 + libbeat/tests/compose/wrapper.go | 2 +- metricbeat/docs/modules/redis.asciidoc | 4 ++-- metricbeat/module/redis/_meta/docs.asciidoc | 4 ++-- x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile | 4 ++-- .../module/redisenterprise/_meta/supported-versions.yml | 2 +- x-pack/metricbeat/module/redisenterprise/docker-compose.yml | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index d0fb43689a4..98a30512188 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -193,6 +193,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add filtering option for prometheus collector. {pull}16420[16420] - Add metricsets based on Ceph Manager Daemon to the `ceph` module. {issue}7723[7723] {pull}16254[16254] - Release `statsd` module as GA. {pull}16447[16447] {issue}14280[14280] +- Add `redisenterprise` module. {pull}16482[16482] {issue}15269[15269] *Packetbeat* diff --git a/libbeat/tests/compose/wrapper.go b/libbeat/tests/compose/wrapper.go index d5bb53869fc..646900edab7 100644 --- a/libbeat/tests/compose/wrapper.go +++ b/libbeat/tests/compose/wrapper.go @@ -391,7 +391,7 @@ func (d *wrapperDriver) Inspect(ctx context.Context, serviceName string) (string } if !found { - return "", errors.Wrap(err, "container not found") + return "", errors.Errorf("container not found for service '%s'", serviceName) } inspect, err := d.client.ContainerInspect(ctx, c.ID) diff --git a/metricbeat/docs/modules/redis.asciidoc b/metricbeat/docs/modules/redis.asciidoc index 50f466f928b..84377c51d50 100644 --- a/metricbeat/docs/modules/redis.asciidoc +++ b/metricbeat/docs/modules/redis.asciidoc @@ -33,8 +33,8 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were -tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with all distributions of Redis (OSS and enterprise). +They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. [float] diff --git a/metricbeat/module/redis/_meta/docs.asciidoc b/metricbeat/module/redis/_meta/docs.asciidoc index 91489e2d575..8947ff6ec21 100644 --- a/metricbeat/module/redis/_meta/docs.asciidoc +++ b/metricbeat/module/redis/_meta/docs.asciidoc @@ -26,5 +26,5 @@ redis://HOST[:PORT][?password=PASSWORD[&db=DATABASE]] [float] === Compatibility -The redis metricsets `info`, `key` and `keyspace` are compatible with the open source distribution of Redis. They were -tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. +The redis metricsets `info`, `key` and `keyspace` are compatible with all distributions of Redis (OSS and enterprise). +They were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work with all versions >= 3.0. diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile b/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile index 9b9dfeaed7e..4081ad4ee31 100644 --- a/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile +++ b/x-pack/metricbeat/module/redisenterprise/_meta/Dockerfile @@ -1,5 +1,5 @@ -ARG REDIS_VERSION -FROM redislabs/redis:${REDIS_VERSION} +ARG REDISENTERPRISE_VERSION +FROM redislabs/redis:${REDISENTERPRISE_VERSION} # Wait for the health endpoint to have monitors information ADD healthcheck.sh / diff --git a/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml b/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml index 05f8c81f7ed..b24c80b47a0 100644 --- a/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml +++ b/x-pack/metricbeat/module/redisenterprise/_meta/supported-versions.yml @@ -1,2 +1,2 @@ variants: - - REDIS_VERSION: 5.4.10-22 + - REDISENTERPRISE_VERSION: 5.4.10-22 diff --git a/x-pack/metricbeat/module/redisenterprise/docker-compose.yml b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml index 1932478c840..55ae81cc584 100644 --- a/x-pack/metricbeat/module/redisenterprise/docker-compose.yml +++ b/x-pack/metricbeat/module/redisenterprise/docker-compose.yml @@ -2,11 +2,11 @@ version: '2.3' services: redisenterprise: - image: docker.elastic.co/integrations-ci/beats-redisenterprise:${REDIS_VERSION:-5.4.10-22}-3 + image: docker.elastic.co/integrations-ci/beats-redisenterprise:${REDISENTERPRISE_VERSION:-5.4.10-22}-3 build: context: ./_meta args: - REDIS_VERSION: ${REDIS_VERSION:-5.4.10-22} + REDISENTERPRISE_VERSION: ${REDISENTERPRISE_VERSION:-5.4.10-22} cap_add: - SYS_RESOURCE ports: From 30f7afcebd3bec03fee404748619f4f2f5cf4842 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 28 Feb 2020 12:28:53 +0100 Subject: [PATCH 30/30] Fix --- .travis.yml | 1 - .../redis-node.5.4.10-22.plain-expected.json | 24 ------------------- .../redis-proxy.5.4.10-22.plain-expected.json | 24 ------------------- 3 files changed, 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06ccbfa4e89..a3171ff7061 100644 --- a/.travis.yml +++ b/.travis.yml @@ -235,7 +235,6 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv==16.7.9; fi - - if [ $TRAVIS_OS_NAME = osx ]; then ulimit -n 1024; fi # Skips installations step diff --git a/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json index b38dd1b67f2..cd9d76d60bb 100644 --- a/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json +++ b/x-pack/metricbeat/module/redisenterprise/node/_meta/testdata/redis-node.5.4.10-22.plain-expected.json @@ -1,28 +1,4 @@ [ - { - "event": { - "dataset": "redisenterprise.node", - "duration": 115000, - "module": "redisenterprise" - }, - "metricset": { - "name": "node", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:55467", - "job": "prometheus" - }, - "metrics": { - "up": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redisenterprise" - } - }, { "event": { "dataset": "redisenterprise.node", diff --git a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json index 34bb26749de..0d155f6664c 100644 --- a/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json +++ b/x-pack/metricbeat/module/redisenterprise/proxy/_meta/testdata/redis-proxy.5.4.10-22.plain-expected.json @@ -83,29 +83,5 @@ "address": "127.0.0.1:55555", "type": "redisenterprise" } - }, - { - "event": { - "dataset": "redisenterprise.proxy", - "duration": 115000, - "module": "redisenterprise" - }, - "metricset": { - "name": "proxy", - "period": 10000 - }, - "prometheus": { - "labels": { - "instance": "127.0.0.1:58281", - "job": "prometheus" - }, - "metrics": { - "up": 1 - } - }, - "service": { - "address": "127.0.0.1:55555", - "type": "redisenterprise" - } } ]