From 10bca48e1764d9a790a3d79d660f0699ba4cf6fa Mon Sep 17 00:00:00 2001 From: Devon Kim Date: Wed, 14 Aug 2019 14:32:37 -0400 Subject: [PATCH 01/34] Add STAN metricbeat module (#1) Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 289 ++- metricbeat/docs/modules/stan.asciidoc | 62 + .../docs/modules/stan/channels.asciidoc | 23 + metricbeat/docs/modules/stan/stats.asciidoc | 23 + metricbeat/docs/modules_list.asciidoc | 421 ++-- metricbeat/include/list_common.go | 4 + metricbeat/metricbeat.reference.yml | 11 +- metricbeat/module/stan/_meta/Dockerfile | 14 + .../module/stan/_meta/config.reference.yml | 7 + metricbeat/module/stan/_meta/config.yml | 10 + metricbeat/module/stan/_meta/docs.asciidoc | 16 + metricbeat/module/stan/_meta/fields.yml | 19 + .../7/dashboard/Metricbeat-stan-overview.json | 1689 ++++++++++++++ .../module/stan/channels/_meta/data.json | 0 .../module/stan/channels/_meta/docs.asciidoc | 1 + .../module/stan/channels/_meta/fields.yml | 31 + .../stan/channels/_meta/test/channels.json | 1965 +++++++++++++++++ metricbeat/module/stan/channels/channels.go | 96 + .../module/stan/channels/channels_test.go | 92 + metricbeat/module/stan/channels/data.go | 124 ++ metricbeat/module/stan/doc.go | 21 + metricbeat/module/stan/fields.go | 36 + metricbeat/module/stan/module.yml | 3 + metricbeat/module/stan/stats/_meta/data.json | 23 + .../module/stan/stats/_meta/docs.asciidoc | 1 + metricbeat/module/stan/stats/_meta/fields.yml | 35 + .../stan/stats/_meta/test/serversz.json | 15 + metricbeat/module/stan/stats/data.go | 67 + metricbeat/module/stan/stats/docs.asciidoc | 1 + metricbeat/module/stan/stats/stats.go | 92 + metricbeat/module/stan/stats/stats_test.go | 67 + .../stan/subscriptions/_meta/docs.asciidoc | 1 + .../stan/subscriptions/_meta/fields.yml | 36 + .../_meta/test/subscriptions.json | 1965 +++++++++++++++++ metricbeat/module/stan/subscriptions/data.go | 104 + .../stan/subscriptions/subscriptions.go | 96 + .../stan/subscriptions/subscriptions_test.go | 53 + metricbeat/modules.d/stan.yml.disabled | 13 + 38 files changed, 7305 insertions(+), 221 deletions(-) create mode 100644 metricbeat/docs/modules/stan.asciidoc create mode 100644 metricbeat/docs/modules/stan/channels.asciidoc create mode 100644 metricbeat/docs/modules/stan/stats.asciidoc create mode 100644 metricbeat/module/stan/_meta/Dockerfile create mode 100644 metricbeat/module/stan/_meta/config.reference.yml create mode 100644 metricbeat/module/stan/_meta/config.yml create mode 100644 metricbeat/module/stan/_meta/docs.asciidoc create mode 100644 metricbeat/module/stan/_meta/fields.yml create mode 100644 metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json create mode 100644 metricbeat/module/stan/channels/_meta/data.json create mode 100644 metricbeat/module/stan/channels/_meta/docs.asciidoc create mode 100644 metricbeat/module/stan/channels/_meta/fields.yml create mode 100644 metricbeat/module/stan/channels/_meta/test/channels.json create mode 100644 metricbeat/module/stan/channels/channels.go create mode 100644 metricbeat/module/stan/channels/channels_test.go create mode 100644 metricbeat/module/stan/channels/data.go create mode 100644 metricbeat/module/stan/doc.go create mode 100644 metricbeat/module/stan/fields.go create mode 100644 metricbeat/module/stan/module.yml create mode 100644 metricbeat/module/stan/stats/_meta/data.json create mode 100644 metricbeat/module/stan/stats/_meta/docs.asciidoc create mode 100644 metricbeat/module/stan/stats/_meta/fields.yml create mode 100644 metricbeat/module/stan/stats/_meta/test/serversz.json create mode 100644 metricbeat/module/stan/stats/data.go create mode 100644 metricbeat/module/stan/stats/docs.asciidoc create mode 100644 metricbeat/module/stan/stats/stats.go create mode 100644 metricbeat/module/stan/stats/stats_test.go create mode 100644 metricbeat/module/stan/subscriptions/_meta/docs.asciidoc create mode 100644 metricbeat/module/stan/subscriptions/_meta/fields.yml create mode 100644 metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json create mode 100644 metricbeat/module/stan/subscriptions/data.go create mode 100644 metricbeat/module/stan/subscriptions/subscriptions.go create mode 100644 metricbeat/module/stan/subscriptions/subscriptions_test.go create mode 100644 metricbeat/modules.d/stan.yml.disabled diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 086c928db710..2e3d06ab4ac1 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -63,6 +63,7 @@ grouped in the following categories: * <> * <> * <> +* <> * <> * <> * <> @@ -24818,7 +24819,7 @@ type: long *`mysql.status.handler.read.last`*:: + -- -The number of requests to read the last key in an index. +The number of requests to read the last key in an index. type: long @@ -24848,7 +24849,7 @@ type: long *`mysql.status.handler.read.rnd`*:: + -- -The number of requests to read a row based on a fixed position. +The number of requests to read a row based on a fixed position. type: long @@ -24858,7 +24859,7 @@ type: long *`mysql.status.handler.read.rnd_next`*:: + -- -The number of requests to read the next row in the data file. +The number of requests to read the next row in the data file. type: long @@ -24956,7 +24957,7 @@ type: long *`mysql.status.innodb.buffer_pool.bytes.data`*:: + -- -The total number of bytes in the InnoDB buffer pool containing data. +The total number of bytes in the InnoDB buffer pool containing data. type: long @@ -28214,7 +28215,7 @@ format: bytes *`redis.info.memory.used.lua`*:: + -- -Used memory by the Lua engine. +Used memory by the Lua engine. type: long @@ -28226,7 +28227,7 @@ format: bytes *`redis.info.memory.used.dataset`*:: + -- -The size in bytes of the dataset +The size in bytes of the dataset type: long @@ -28471,7 +28472,7 @@ 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 +The size in bytes of copy-on-write allocations during the last RBD save operation type: long @@ -28600,7 +28601,7 @@ format: bytes *`redis.info.persistence.aof.size.current`*:: + -- -AOF current file size +AOF current file size type: long @@ -28706,7 +28707,7 @@ format: bytes *`redis.info.replication.backlog.first_byte_offset`*:: + -- -The master offset of the replication backlog buffer +The master offset of the replication backlog buffer type: long @@ -30005,6 +30006,270 @@ type: float + -- The number of write requests merged per second that were queued to the device. +======= +[[exported-fields-stan]] +== Stan fields + +stan Module + + + +[float] +== stan fields + +`stan` contains statistics that were read from Nats Streaming server (STAN) + + + +*`stan.server.id`*:: ++ +-- +type: keyword + +The server ID + + +-- + +*`stan.server.time`*:: ++ +-- +type: date + +Server time of metric creation + + +-- + +[float] +== channels fields + +Contains stan / nats streaming/serverz endpoint metrics + + + +*`stan.channels.name`*:: ++ +-- +type: keyword + +The name of the STAN streaming channel + + +-- + +*`stan.channels.msgs`*:: ++ +-- +type: long + +The number of STAN streaming messages + + +-- + +*`stan.channels.bytes`*:: ++ +-- +type: long + +The number of STAN bytes in the channel + + +-- + +*`stan.channels.first_seq`*:: ++ +-- +type: long + +First sequence number stored in the channel + + +-- + +*`stan.channels.last_seq`*:: ++ +-- +type: long + +Last sequence number stored in the channel + + +-- + +*`stan.channels.depth`*:: ++ +-- +type: long + +Queue depth based upon current sequence number and highest reported subscriber sequence number + + +-- + +[float] +== stats fields + +Contains only high-level stan / nats streaming server related metrics + + + +*`stan.stats.state`*:: ++ +-- +type: keyword + +The cluster / streaming configuration state (STANDALONE, CLUSTERED) + + +-- + +*`stan.stats.role`*:: ++ +-- +type: keyword + +If clustered, role of this node in the cluster (Leader, Follower, Candidate) + + +-- + +*`stan.stats.clients`*:: ++ +-- +type: integer + +The number of STAN clients + + +-- + +*`stan.stats.subscriptions`*:: ++ +-- +type: integer + +The number of STAN streaming subscriptions + + +-- + +*`stan.stats.channels`*:: ++ +-- +type: integer + +The number of STAN channels + + +-- + +*`stan.stats.messages`*:: ++ +-- +type: long + +Number of messages across all STAN queues + + +-- + +*`stan.stats.bytes`*:: ++ +-- +type: long + +Number of bytes consumed across all STAN queues + + +-- + +[float] +== subscriptions fields + +Contains stan / nats streaming/serverz endpoint subscription metrics + + + +*`stan.subscriptions.id`*:: ++ +-- +type: keyword + +The name of the STAN channel subscription (client_id) + + +-- + +*`stan.subscriptions.channel`*:: ++ +-- +type: keyword + +The name of the STAN channel the subscription is associated with + + +-- + +*`stan.subscriptions.queue`*:: ++ +-- +type: keyword + +The name of the NATS queue that the STAN channel subscription is associated with, if any + + +-- + +*`stan.subscriptions.last_sent`*:: ++ +-- +type: long + +Last known sequence number of the subscription that was acked + + +-- + +*`stan.subscriptions.pending`*:: ++ +-- +type: long + +Number of pending messages from / to the subscriber + + +-- + +*`stan.subscriptions.offline`*:: ++ +-- +type: bool + +Is the subscriber marked as offline? + + +-- + +*`stan.subscriptions.stalled`*:: ++ +-- +type: bool + +Is the subscriber known to be stalled? + + +-- + +[[exported-fields-system]] +== System fields + +System status metrics, like CPU and memory usage, that are collected from the operating system. + + + +[float] type: float @@ -31842,7 +32107,7 @@ type: keyword *`system.raid.sync_action`*:: + -- -Current sync action, if the RAID array is redundant +Current sync action, if the RAID array is redundant type: keyword @@ -32265,7 +32530,7 @@ All TCP connections *`system.socket.summary.tcp.memory`*:: + -- -Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. +Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. type: integer @@ -32411,7 +32676,7 @@ All UDP connections *`system.socket.summary.udp.memory`*:: + -- -Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. +Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. type: integer diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc new file mode 100644 index 000000000000..7ecd9b095aed --- /dev/null +++ b/metricbeat/docs/modules/stan.asciidoc @@ -0,0 +1,62 @@ +//// +This file is generated! See scripts/docs_collector.py +//// + +[[metricbeat-module-stan]] +== Stan module + +beta[] + +This is the Nats module. The Nats module uses https://nats.io/documentation/managing_the_server/monitoring/[Nats monitoring server APIs] to collect metrics. + +The default metricsets are `stats`, `connections`, `routes` and `subscriptions`. `streaming` was added by Endgame engineers + +[float] +=== Compatibility + +The Nats module is tested with Nats 1.3.0. + + +[float] +=== Dashboard + +The Nats module comes with a predefined dashboard. For example: + +image::./images/metricbeat_nats_dashboard.png[] + + +[float] +=== Example configuration + +The Stan module supports the standard configuration options that are described +in <>. Here is an example configuration: + +[source,yaml] +---- +metricbeat.modules: +- module: stan + metricsets: ["stats", "channels", "subscriptions"] + period: 60s + hosts: ["localhost:8222"] + #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint +---- + +[float] +=== Metricsets + +The following metricsets are available: + +* <> + +* <> + +* <> + +include::stan/channels.asciidoc[] + +include::stan/stats.asciidoc[] + +include::stan/subscriptions.asciidoc[] + diff --git a/metricbeat/docs/modules/stan/channels.asciidoc b/metricbeat/docs/modules/stan/channels.asciidoc new file mode 100644 index 000000000000..1f0995970a13 --- /dev/null +++ b/metricbeat/docs/modules/stan/channels.asciidoc @@ -0,0 +1,23 @@ +//// +This file is generated! See scripts/docs_collector.py +//// + +[[metricbeat-metricset-stan-channels]] +=== Stan channels metricset + +beta[] + +include::../../../module/stan/channels/_meta/docs.asciidoc[] + + +==== 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/stan/channels/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules/stan/stats.asciidoc b/metricbeat/docs/modules/stan/stats.asciidoc new file mode 100644 index 000000000000..d3322a7e0949 --- /dev/null +++ b/metricbeat/docs/modules/stan/stats.asciidoc @@ -0,0 +1,23 @@ +//// +This file is generated! See scripts/docs_collector.py +//// + +[[metricbeat-metricset-stan-stats]] +=== Stan stats metricset + +beta[] + +include::../../../module/stan/stats/_meta/docs.asciidoc[] + + +==== 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/stan/stats/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 2468016086c0..1c489a149bcf 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -4,214 +4,218 @@ This file is generated! See scripts/mage/docs_collector.go [options="header"] |=== -|Modules |Dashboards |Metricsets -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.8+| .8+| |<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.7+| .7+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.9+| .9+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.11+| .11+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> -|<> beta[] -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> -|<> -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.18+| .18+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.16+| .16+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> -|<> +|Modules |Dashboards |Metricsets +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.8+| .8+| |<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.7+| .7+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.9+| .9+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.11+| .11+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> +|<> beta[] +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> +|<> +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.18+| .18+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |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] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.16+| .16+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> +|<> |=== -- @@ -258,6 +262,7 @@ include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] include::modules/statsd.asciidoc[] +include::modules/stan.asciidoc[] include::modules/system.asciidoc[] include::modules/tomcat.asciidoc[] include::modules/traefik.asciidoc[] diff --git a/metricbeat/include/list_common.go b/metricbeat/include/list_common.go index 26db25d57441..1d6fab2ea93d 100644 --- a/metricbeat/include/list_common.go +++ b/metricbeat/include/list_common.go @@ -128,6 +128,10 @@ import ( _ "github.com/elastic/beats/metricbeat/module/redis/info" _ "github.com/elastic/beats/metricbeat/module/redis/key" _ "github.com/elastic/beats/metricbeat/module/redis/keyspace" + _ "github.com/elastic/beats/metricbeat/module/stan" + _ "github.com/elastic/beats/metricbeat/module/stan/channels" + _ "github.com/elastic/beats/metricbeat/module/stan/stats" + _ "github.com/elastic/beats/metricbeat/module/stan/subscriptions" _ "github.com/elastic/beats/metricbeat/module/system" _ "github.com/elastic/beats/metricbeat/module/system/core" _ "github.com/elastic/beats/metricbeat/module/system/cpu" diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 0577bdfbcaa8..76d467cf8152 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -744,7 +744,16 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared -#------------------------------- Traefik Module ------------------------------- +#-------------------------------- Stan Module -------------------------------- +- module: stan + metricsets: ["stats", "channels", "subscriptions"] + period: 60s + hosts: ["localhost:8222"] + #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint + +#------------------------------- traefik Module ------------------------------ - module: traefik metricsets: ["health"] period: 10s diff --git a/metricbeat/module/stan/_meta/Dockerfile b/metricbeat/module/stan/_meta/Dockerfile new file mode 100644 index 000000000000..1f22d91e99d9 --- /dev/null +++ b/metricbeat/module/stan/_meta/Dockerfile @@ -0,0 +1,14 @@ +ARG STAN_VERSION=0.15.1 +FROM nats-streaming:$STAN_VERSION + +# create an enhanced container with nc command available since nats is based +# on scratch image making healthcheck impossible +FROM alpine:latest +COPY --from=0 /gnatsd /gnatsd +COPY --from=0 gnatsd.conf gnatsd.conf +# Expose client, management, and cluster ports +EXPOSE 4222 8222 6222 +HEALTHCHECK --interval=1s --retries=10 CMD nc -w 1 0.0.0.0 8222 + stan Module + release: beta + fields: + - name: stan + type: group + description: > + `stan` contains statistics that were read from Nats Streaming server (STAN) + fields: + - name: server.id + type: keyword + description: > + The server ID + - name: server.time + type: date + description: > + Server time of metric creation diff --git a/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json b/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json new file mode 100644 index 000000000000..e02b36b6ffca --- /dev/null +++ b/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json @@ -0,0 +1,1689 @@ +{ + "objects": [ + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Subscriptions Info [Metricbeat STAN] ECS", + "uiStateJSON": { + "vis": { + "params": { + "sort": { + "columnIndex": null, + "direction": null + } + } + } + }, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Cache Fanout Avg", + "field": "stan.subscriptions.cache.fanout.avg" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customLabel": "Cache Fanout Max", + "field": "stan.subscriptions.cache.fanout.max" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "3", + "params": { + "customLabel": "Cache Hit Rate", + "field": "stan.subscriptions.cache.hit_rate" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "4", + "params": { + "customLabel": "Cache Size", + "field": "stan.subscriptions.cache.size" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "5", + "params": { + "customLabel": "Inserts", + "field": "stan.subscriptions.inserts" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "6", + "params": { + "customLabel": "Matches", + "field": "stan.subscriptions.matches" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "7", + "params": { + "customLabel": "Removes", + "field": "stan.subscriptions.removes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "8", + "params": { + "customLabel": "Total", + "field": "stan.subscriptions.total" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "perPage": 1, + "showMeticsAtAllLevels": false, + "showMetricsAtAllLevels": false, + "showPartialRows": false, + "showTotal": false, + "sort": { + "columnIndex": null, + "direction": null + }, + "totalFunc": "sum" + }, + "title": "Subscriptions Info [Metricbeat STAN] ECS", + "type": "table" + } + }, + "id": "b129b220-1e44-11e9-a1b4-79a7ae42ab60-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:54:30.301Z", + "version": 3 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Current Memory Usage [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Memory (Bytes)", + "field": "stan.stats.mem.bytes" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "addLegend": false, + "addTooltip": true, + "metric": { + "colorSchema": "Green to Red", + "colorsRange": [ + { + "from": 0, + "to": 10000 + } + ], + "invertColors": false, + "labels": { + "show": true + }, + "metricColorMode": "None", + "percentageMode": false, + "style": { + "bgColor": false, + "bgFill": "#000", + "fontSize": 42, + "labelColor": false, + "subText": "" + }, + "useRanges": false + }, + "type": "metric" + }, + "title": "Current Memory Usage [Metricbeat NATS] ECS", + "type": "metric" + } + }, + "id": "30a61c00-1e45-11e9-a1b4-79a7ae42ab61-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:56:32.097Z", + "version": 4 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Server Uptime [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Server Uptime", + "field": "stan.stats.uptime" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "addLegend": false, + "addTooltip": true, + "metric": { + "colorSchema": "Green to Red", + "colorsRange": [ + { + "from": 0, + "to": 10000 + } + ], + "invertColors": false, + "labels": { + "show": true + }, + "metricColorMode": "None", + "percentageMode": false, + "style": { + "bgColor": false, + "bgFill": "#000", + "fontSize": 42, + "labelColor": false, + "subText": "" + }, + "useRanges": false + }, + "type": "metric" + }, + "title": "Server Uptime [Metricbeat STAN] ECS", + "type": "metric" + } + }, + "id": "206f1bc0-1e45-11e9-a1b4-79a7ae42ab61-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:57:04.084Z", + "version": 4 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Total Connections [Metricbeat STAN] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Total Connections", + "field": "stan.stats.total_connections" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "addLegend": false, + "addTooltip": true, + "metric": { + "colorSchema": "Green to Red", + "colorsRange": [ + { + "from": 0, + "to": 10000 + } + ], + "invertColors": false, + "labels": { + "show": true + }, + "metricColorMode": "None", + "percentageMode": false, + "style": { + "bgColor": false, + "bgFill": "#000", + "fontSize": 42, + "labelColor": false, + "subText": "" + }, + "useRanges": false + }, + "type": "metric" + }, + "title": "Total Connections [Metricbeat STAN] ECS", + "type": "metric" + } + }, + "id": "4c380ff0-1e45-11e9-a1b4-79a7af42ab61-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:57:32.006Z", + "version": 4 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat STAN] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Connections", + "field": "stan.connections.total" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + }, + { + "enabled": true, + "id": "3", + "params": { + "customLabel": "Routes", + "field": "stan.routes.total" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "4", + "params": { + "customLabel": "Remotes", + "field": "stan.stats.remotes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "5", + "params": { + "customLabel": "Subscriptions", + "field": "stan.subscriptions.total" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Connections" + }, + "drawLinesBetweenPoints": true, + "interpolate": "linear", + "mode": "stacked", + "show": "true", + "showCircles": true, + "type": "area", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "3", + "label": "Routes" + }, + "drawLinesBetweenPoints": true, + "interpolate": "linear", + "mode": "stacked", + "show": true, + "showCircles": true, + "type": "area", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "4", + "label": "Remotes" + }, + "drawLinesBetweenPoints": true, + "interpolate": "linear", + "mode": "stacked", + "show": true, + "showCircles": true, + "type": "area", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "5", + "label": "Subscriptions" + }, + "drawLinesBetweenPoints": true, + "interpolate": "linear", + "mode": "stacked", + "show": true, + "showCircles": true, + "type": "area", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "area", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Connections" + }, + "type": "value" + } + ] + }, + "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat NATS] ECS", + "type": "area" + } + }, + "id": "199d3d30-1e46-11e9-a1b4-79a7ae42ab61-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:53:31.785Z", + "version": 3 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Subscription Stats Timeline [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Cache Fanout Avg", + "field": "stan.subscriptions.cache.fanout.avg" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + }, + { + "enabled": true, + "id": "3", + "params": { + "customLabel": "Cache Fanout Max", + "field": "stan.subscriptions.cache.fanout.max" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "5", + "params": { + "customLabel": "Inserts", + "field": "stan.subscriptions.inserts" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "6", + "params": { + "customLabel": "Removes", + "field": "stan.subscriptions.removes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "7", + "params": { + "customLabel": "Matches", + "field": "stan.subscriptions.matches" + }, + "schema": "metric", + "type": "avg" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Cache Fanout Avg" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "3", + "label": "Cache Fanout Max" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "5", + "label": "Inserts" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "6", + "label": "Removes" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "7", + "label": "Matches" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Cache Fanout Avg" + }, + "type": "value" + } + ] + }, + "title": "Subscription Stats Timeline [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "754215c0-1e46-11e9-a1b4-79a7ae42ab61-ecs", + "type": "visualization", + "updated_at": "2019-01-23T14:55:04.899Z", + "version": 3 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Slow Consumers Timeline [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Slow Consumers", + "field": "stan.stats.slow_consumers" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Slow Consumers" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Slow Consumers" + }, + "type": "value" + } + ] + }, + "title": "Slow Consumers Timeline [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "94534190-1e97-11e9-b9e7-93b3bd2eec90-ecs", + "type": "visualization", + "updated_at": "2019-01-23T14:53:57.137Z", + "version": 2 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "IO Bytes Stats [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "In Bytes", + "field": "stan.stats.in.bytes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customLabel": "Out Bytes", + "field": "stan.stats.out.bytes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "3", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "In Bytes" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "2", + "label": "Out Bytes" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "IO Bytes" + }, + "type": "value" + } + ] + }, + "title": "IO Bytes Stats [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "be1d8a20-1e98-11e9-b9e7-93b3bd2eec90-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:48:22.914Z", + "version": 4 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Memory Utilization Timeline [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Memory Avg", + "field": "stan.stats.mem.bytes" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Memory Avg" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Memory Avg (Bytes)" + }, + "type": "value" + } + ] + }, + "title": "Memory Utilization Timeline [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "8204e820-1e99-11e9-b9e7-93b3bd2eec90-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:52:55.445Z", + "version": 5 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "IO Messages Stats [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "In Messages", + "field": "stan.stats.in.messages" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customLabel": "Out Messages", + "field": "stan.stats.out.messages" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "3", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "In Messages" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "2", + "label": "Out Messages" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": true, + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "IO Messages" + }, + "type": "value" + } + ] + }, + "title": "IO Messages Stats [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "cdbf4110-1f0d-11e9-a673-d9577e5e50eb-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:47:25.774Z", + "version": 2 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "CPU Utilization Timeline [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "CPU Avg", + "field": "stan.stats.cpu" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "CPU Avg" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "CPU Avg (%)" + }, + "type": "value" + } + ] + }, + "title": "CPU Utilization Timeline [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "138dc660-1f1a-11e9-a673-d9577e5e50eb-ecs", + "type": "visualization", + "updated_at": "2019-01-24T07:51:51.767Z", + "version": 2 + }, + { + "attributes": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "index": "metricbeat-*", + "query": { + "language": "kuery", + "query": "" + } + } + }, + "title": "Cache Hit Rate Timeline [Metricbeat NATS] ECS", + "uiStateJSON": {}, + "version": 1, + "visState": { + "aggs": [ + { + "enabled": true, + "id": "1", + "params": { + "customLabel": "Cache Hit Rate", + "field": "stan.subscriptions.cache.hit_rate" + }, + "schema": "metric", + "type": "avg" + }, + { + "enabled": true, + "id": "2", + "params": { + "customInterval": "2h", + "extended_bounds": {}, + "field": "@timestamp", + "interval": "auto", + "min_doc_count": 1 + }, + "schema": "segment", + "type": "date_histogram" + } + ], + "params": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Cache Hit Rate" + }, + "drawLinesBetweenPoints": true, + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "line", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Cache Hit Rate (%)" + }, + "type": "value" + } + ] + }, + "title": "Cache Hit Rate Timeline [Metricbeat NATS] ECS", + "type": "line" + } + }, + "id": "dff743a0-1f1c-11e9-a673-d9577e5e50eb-ecs", + "type": "visualization", + "updated_at": "2019-01-23T14:57:20.994Z", + "version": 2 + }, + { + "attributes": { + "description": "Overview of NATS server status", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": { + "filter": [], + "highlightAll": true, + "query": { + "language": "kuery", + "query": "" + }, + "version": true + } + }, + "optionsJSON": { + "darkTheme": false, + "hidePanelTitles": false, + "useMargins": true + }, + "panelsJSON": [ + { + "embeddableConfig": {}, + "gridData": { + "h": 11, + "i": "6", + "w": 24, + "x": 0, + "y": 45 + }, + "id": "b129b220-1e44-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "6", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 7, + "i": "7", + "w": 13, + "x": 24, + "y": 34 + }, + "id": "30a61c00-1e45-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "7", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 7, + "i": "8", + "w": 11, + "x": 37, + "y": 34 + }, + "id": "206f1bc0-1e45-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "8", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 8, + "i": "9", + "w": 8, + "x": 24, + "y": 41 + }, + "id": "4c380ff0-1e45-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "9", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 11, + "i": "11", + "w": 24, + "x": 0, + "y": 34 + }, + "id": "199d3d30-1e46-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "11", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 10, + "i": "12", + "w": 18, + "x": 15, + "y": 0 + }, + "id": "754215c0-1e46-11e9-a1b4-79a7ae42ab61-ecs", + "panelIndex": "12", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 10, + "i": "13", + "w": 15, + "x": 0, + "y": 0 + }, + "id": "94534190-1e97-11e9-b9e7-93b3bd2eec90-ecs", + "panelIndex": "13", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 12, + "i": "14", + "w": 24, + "x": 24, + "y": 10 + }, + "id": "be1d8a20-1e98-11e9-b9e7-93b3bd2eec90-ecs", + "panelIndex": "14", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": { + "vis": { + "legendOpen": true + } + }, + "gridData": { + "h": 12, + "i": "15", + "w": 24, + "x": 24, + "y": 22 + }, + "id": "8204e820-1e99-11e9-b9e7-93b3bd2eec90-ecs", + "panelIndex": "15", + "type": "visualization", + "version": "6.5.4" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 12, + "i": "16", + "w": 24, + "x": 0, + "y": 10 + }, + "id": "cdbf4110-1f0d-11e9-a673-d9577e5e50eb-ecs", + "panelIndex": "16", + "type": "visualization", + "version": "6.3.2" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 12, + "i": "17", + "w": 24, + "x": 0, + "y": 22 + }, + "id": "138dc660-1f1a-11e9-a673-d9577e5e50eb-ecs", + "panelIndex": "17", + "type": "visualization", + "version": "6.3.2" + }, + { + "embeddableConfig": {}, + "gridData": { + "h": 10, + "i": "18", + "w": 15, + "x": 33, + "y": 0 + }, + "id": "dff743a0-1f1c-11e9-a673-d9577e5e50eb-ecs", + "panelIndex": "18", + "type": "visualization", + "version": "6.3.2" + } + ], + "timeRestore": false, + "title": "[Metricbeat NATS] Overview ECS", + "version": 1 + }, + "id": "Metricbeat-Nats-Dashboard-ecs", + "type": "dashboard", + "updated_at": "2019-01-24T08:13:29.732Z", + "version": 4 + } + ], + "version": "6.3.2" +} diff --git a/metricbeat/module/stan/channels/_meta/data.json b/metricbeat/module/stan/channels/_meta/data.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/metricbeat/module/stan/channels/_meta/docs.asciidoc b/metricbeat/module/stan/channels/_meta/docs.asciidoc new file mode 100644 index 000000000000..16149e39da0b --- /dev/null +++ b/metricbeat/module/stan/channels/_meta/docs.asciidoc @@ -0,0 +1 @@ +Top-level streaming server (STAN) channel statistics \ No newline at end of file diff --git a/metricbeat/module/stan/channels/_meta/fields.yml b/metricbeat/module/stan/channels/_meta/fields.yml new file mode 100644 index 000000000000..d261959797cf --- /dev/null +++ b/metricbeat/module/stan/channels/_meta/fields.yml @@ -0,0 +1,31 @@ +- name: channels + type: group + description: > + Contains stan / nats streaming/serverz endpoint metrics + release: beta + fields: + - name: name + type: keyword + description: > + The name of the STAN streaming channel + - name: msgs + type: long + description: > + The number of STAN streaming messages + - name: bytes + type: long + description: > + The number of STAN bytes in the channel +# If first_seq > min([seq in subscriptions]) data loss has possibly occurred + - name: first_seq + type: long + description: > + First sequence number stored in the channel + - name: last_seq + type: long + description: > + Last sequence number stored in the channel + - name: depth + type: long + description: > + Queue depth based upon current sequence number and highest reported subscriber sequence number diff --git a/metricbeat/module/stan/channels/_meta/test/channels.json b/metricbeat/module/stan/channels/_meta/test/channels.json new file mode 100644 index 000000000000..b7522cdc1b2c --- /dev/null +++ b/metricbeat/module/stan/channels/_meta/test/channels.json @@ -0,0 +1,1965 @@ +{ + "cluster_id": "nats-smp", + "server_id": "drE5wVcRP3jvBrUbu2i48E", + "now": "2019-07-28T14:39:53.765831341Z", + "offset": 0, + "limit": 1024, + "count": 55, + "total": 55, + "channels": [ + { + "name": "evmon.sync", + "msgs": 4, + "bytes": 2606, + "first_seq": 1, + "last_seq": 4, + "subscriptions": [ + { + "client_id": "PolicySync_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slElun", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ia", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 4, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.alerts", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMcd", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAFa", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.artemis", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMeN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAHA", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.census-policy.1c0d2330-4f16-454f-b818-246c6f14ae32", + "msgs": 10, + "bytes": 2654, + "first_seq": 1, + "last_seq": 10, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMxX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAYY", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 10, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.census-sensor.1c0d2330-4f16-454f-b818-246c6f14ae32", + "msgs": 117, + "bytes": 40874, + "first_seq": 1, + "last_seq": 117, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMzH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAa8", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 117, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.endpoint-health", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMsJ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iATo", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.events-collection", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMvn", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAWy", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.events-stats", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMop", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAQe", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.generic-response", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMn5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAP4", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.login", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMg7", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAIk", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.rules", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMu3", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAVO", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.sensor-statistics-v2", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMqZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iASE", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.stats", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMat", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAE0", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.system-survey", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMlL", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iANU", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.timeline", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMjb", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iALu", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.whitelist", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMhr", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAKK", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "iris.task", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbJL", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5dU", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6OS", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5us", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScGC", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i62m", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNLJ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ag", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "policy.sync", + "msgs": 5, + "bytes": 865, + "first_seq": 1, + "last_seq": 5, + "subscriptions": [ + { + "client_id": "EvmonSync_18597", + "inbox": "_INBOX.Gew6Kgyo267QciQcrXYGI1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Vw", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 5, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "37e5e4faff53c7a17e31c6", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5B2", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "d0be381d44197f5e3679d", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5KW", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "6860a88df228e1c8a6d076", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5U0", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtEE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5my", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.feedback.endpoint-health", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtqI", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5tI", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.feedback.sensor-statistics", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtgm", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5ri", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.file", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "kratos_consumer_18602", + "inbox": "22fa46f205f94a6befe1a5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4nK", + "queue_name": "krotos_sensor.file_qg:krotos_sensor.file_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.fraggo", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_3", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeZT4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4G8", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_4", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeZwU", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Hi", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_5", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeaPu", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4JI", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_6", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeatK", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Ks", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "bd5cd5be5c4b71a1828a40", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Iw", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "ab4f18095efc9c36e694e7", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5SQ", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "5405be5a758c5ae8763ce5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5bu", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtNk", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5oY", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.policyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "7b6061e5f3b8d818c7db57", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5EC", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "4c2e54659b9b8464c1181", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Ng", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "b76e072a562ee3ef8e35c4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5XA", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "PolicyStatus_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEnLd", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6S4", + "queue_name": "sensor.message.policyResponse:sensor.message.policyResponse.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.shutdownResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "67d4a14b449ef135ee8d86", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Fm", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "eba867033c5a24d50fe33a", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5PG", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "668d672fc35fdeef08739a", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Yk", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "assets_consumer_18646", + "inbox": "9c2b7d2e3e8d0c7d443490", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4s4", + "queue_name": "assets_sensor.message.shutdownResponse_qg:assets_sensor.message.shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.systemNetworkSurveyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "152fac7b57ff5403f79aa0", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Cc", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "8ca6551be87c3e15de0529", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5M6", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "de18cad520f4dc5363c1af", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Va", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "assets_consumer_18646", + "inbox": "1fe98d38982bc66fd7613c", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4qU", + "queue_name": "assets_sensor.message.systemNetworkSurveyResponse_qg:assets_sensor.message.systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.systemSurveyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "assets_consumer_18646", + "inbox": "deca00d0dc0ab84879b4d8", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ou", + "queue_name": "assets_sensor.message.systemSurveyResponse_qg:assets_sensor.message.systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19854", + "inbox": "d07b52e1f109675f59f598", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5HM", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "321a353199867a3e478f91", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Qq", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "a2627ef32aa6ea9d197c22", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5aK", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtXG", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5q8", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.out.dead", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbLH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5f4", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6SU", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5wS", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScM4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i64M", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNOX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6CG", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.ack", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "AckBot_19683_12eae663", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGRe", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4yO", + "queue_name": "sensor.session.ack:sensor.session.ack.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "AckBot_19683_5f59b864", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGtQ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4zy", + "queue_name": "sensor.session.ack:sensor.session.ack.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.close", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "SessBotClose_19683_109cb6db", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTH1M", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i538", + "queue_name": "sensor.session.close:sensor.session.closeSessBotClose.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.open", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "ActiveMon_18597", + "inbox": "_INBOX.Gew6Kgyo267QciQcrXYFF1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4O2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "HiggoBot_19445_2d574335", + "inbox": "_INBOX.4cX5QV4YzWusN2hoe6j7uH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4te", + "queue_name": "sensor.session.open:sensor.session.openhiggo.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SessBotOpen_19683_7e937fb5", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTHHE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i51Y", + "queue_name": "sensor.session.open:sensor.session.openSessBotOpen.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 64, + "ack_wait": 60, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.alertDismiss", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "alert_dismisser_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIXTz", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4dq", + "queue_name": "alertDismisser:stan.alertDismiss.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 4, + "ack_wait": 120, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.default-whitelist-macos", + "msgs": 1, + "bytes": 46869, + "first_seq": 1, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "9b45e0f79cf60c1a981a71", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6NK", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 1, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.default-whitelist-win", + "msgs": 1, + "bytes": 468380, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "a585d6b05cf852210377df", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6l2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacho", + "msgs": 1, + "bytes": 1679250, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "ee2f6aa8c92b1f26bf4731", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6QU", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacho-whitelist", + "msgs": 1, + "bytes": 65106, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "ab644250d31251a8c41ae3", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6hs", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacro", + "msgs": 1, + "bytes": 187130, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "72ed357b7010f10ad7d530", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Lk", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacro-whitelist", + "msgs": 1, + "bytes": 60852, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "23455b15790f0fbc61f72e", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ou", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe", + "msgs": 1, + "bytes": 13400830, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "4069ec27b679b6a2969851", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i7AK", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe-blacklist", + "msgs": 1, + "bytes": 5243033, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "rugo", + "inbox": "_INBOX.tuwUxYDi38CbqlJbn1NllX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4fQ", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe-whitelist", + "msgs": 1, + "bytes": 5240348, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "b0205277c87d5193600905", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6jS", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.rules", + "msgs": 1, + "bytes": 1050028, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "rugo", + "inbox": "_INBOX.tuwUxYDi38CbqlJbn1Nlqs", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4lk", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.smp-policy-defaults", + "msgs": 1, + "bytes": 228, + "first_seq": 1, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "SyncArbiter_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEmi9", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6KA", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 1, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.private.gorat.delete", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_remover_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWqN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Z6", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.sensor.blacklist", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbND", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5ge", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6WW", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5y2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScRw", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i65w", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNRl", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Dq", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.silent.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qt4i", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5lO", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.system.delete", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_remover_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWMf", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4RC", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8lbI", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i56I", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7IfqZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4MS", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmeY", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4h0", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.endpoint", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8luO", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i59S", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7IgB1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4XW", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmuE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4kA", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.endpoint_change", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8lkq", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i57s", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbR5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5jo", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6ea", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i61C", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScdg", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i696", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNYD", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6H0", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7Ig0n", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Pc", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmmO", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ia", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.hostIsolation", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "PolicyStatus_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEnVV", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Te", + "queue_name": "system.hostIsolation:system.hostIsolation.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.index", + "msgs": 1, + "bytes": 20, + "first_seq": 0, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "gorat_1", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIW7o", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Sm", + "queue_name": "gorat:system.index.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "gorat_0", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIVsx", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4UM", + "queue_name": "gorat:system.index.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.index.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_1", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWgT", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ag", + "queue_name": "gorat:system.index.alert.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "gorat_0", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWWZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4cG", + "queue_name": "gorat:system.index.alert.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.sensor", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbP9", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5iE", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6aY", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5zc", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScXo", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i67W", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNUz", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6FQ", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SirgoSysBot19683_8c7b9706", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGhW", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i54i", + "queue_name": "system.sensor:system.sensorSirgoSysBot.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_0", + "inbox": "_INBOX.aATevIULHA7Va0i0slEo8z", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6VE", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_1", + "inbox": "_INBOX.aATevIULHA7Va0i0slEomT", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Wo", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_2", + "inbox": "_INBOX.aATevIULHA7Va0i0slEpPx", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6YO", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_3", + "inbox": "_INBOX.aATevIULHA7Va0i0slEq3R", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Zy", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_4", + "inbox": "_INBOX.aATevIULHA7Va0i0slEqgv", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6bY", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_5", + "inbox": "_INBOX.aATevIULHA7Va0i0slErKP", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6d8", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_6", + "inbox": "_INBOX.aATevIULHA7Va0i0slErxt", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6ei", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_7", + "inbox": "_INBOX.aATevIULHA7Va0i0slEsbN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6gI", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.task.indexed", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "IdxBot_19683_98975eae", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTHPA", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4vE", + "queue_name": "system.task.indexed:system.task.indexed.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "IdxBot_19683_5651ebb7", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTH9I", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4wo", + "queue_name": "system.task.indexed:system.task.indexed.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + } + ] +} \ No newline at end of file diff --git a/metricbeat/module/stan/channels/channels.go b/metricbeat/module/stan/channels/channels.go new file mode 100644 index 000000000000..6a8c31f31351 --- /dev/null +++ b/metricbeat/module/stan/channels/channels.go @@ -0,0 +1,96 @@ +// 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. + +package channels + +import ( + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/helper" + "github.com/elastic/beats/metricbeat/mb" + "github.com/elastic/beats/metricbeat/mb/parse" + + "github.com/elastic/beats/metricbeat/module/stan" +) + +const ( + defaultScheme = "http" + defaultPath = "/streaming/channelsz" + queryParams = "subs=1" +) + +var ( + hostParser = parse.URLHostParserBuilder{ + DefaultScheme: defaultScheme, + DefaultPath: defaultPath, + PathConfigKey: "streaming.metrics_path", + QueryParams: queryParams, + }.Build() +) + +func init() { + mb.Registry.MustAddMetricSet("stan", "channels", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) +} + +// MetricSet holds any configuration or state information. It must implement +// the mb.MetricSet interface. And this is best achieved by embedding +// mb.BaseMetricSet because it implements all of the required mb.MetricSet +// interface methods except for Fetch. +type MetricSet struct { + mb.BaseMetricSet + http *helper.HTTP + Log *logp.Logger +} + +// New creates a new instance of the MetricSet. New is responsible for unpacking +// any MetricSet specific configuration options if there are any. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + config := struct{}{} + if err := base.Module().UnpackConfig(&config); err != nil { + return nil, err + } + + http, err := helper.NewHTTP(base) + if err != nil { + return nil, err + } + return &MetricSet{ + base, + http, + logp.NewLogger("stan"), + }, nil +} + +// Fetch methods implements the data gathering and data conversion to the right +// format. It publishes the event which is then forwarded to the output. In case +// of an error set the Error field of mb.Event or simply call report.Error(). +func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { + _ = stan.AssetStan() + content, err := m.http.FetchContent() + if err != nil { + return errors.Wrap(err, "error in fetch") + } + if err = eventsMapping(content, r); err != nil { + return errors.Wrap(err, "error in mapping") + } + + return nil +} diff --git a/metricbeat/module/stan/channels/channels_test.go b/metricbeat/module/stan/channels/channels_test.go new file mode 100644 index 000000000000..ae856643c608 --- /dev/null +++ b/metricbeat/module/stan/channels/channels_test.go @@ -0,0 +1,92 @@ +// 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. + +package channels + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + "github.com/stretchr/testify/assert" +) + +func TestEventMapping(t *testing.T) { + content, err := ioutil.ReadFile("./_meta/test/channels.json") + assert.NoError(t, err) + reporter := &mbtest.CapturingReporterV2{} + err = eventsMapping(content, reporter) + assert.NoError(t, err) + const total = 55 + // 55 per-channel events in the sample + assert.Equal(t, len(reporter.GetEvents()), total) + // the last one having non-zero bytes + bytes, _ := reporter.GetEvents()[0].MetricSetFields.GetValue("bytes") + assert.True(t, bytes.(int64) > 0) + // check for existence of any non-zero channel / queue depth on known entities + events := reporter.GetEvents() + var maxDepth int64 + for _, evt := range events { + fields := evt.MetricSetFields + name, nameErr := fields.GetValue("name") + assert.NoError(t, nameErr) + depthIfc, depthErr := evt.MetricSetFields.GetValue("depth") + depth := depthIfc.(int64) + if depth > maxDepth { + maxDepth = depth + } + assert.NoError(t, depthErr) + if name == "system.index" { + assert.Equal(t, depth, int64(1)) + } + + } + // hacked in ONE queue where depth was exactly one + // so maxDepth should be 1 as well + assert.Equal(t, maxDepth, int64(1)) +} + +func TestFetchEventContent(t *testing.T) { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/channels.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + defer server.Close() + + config := map[string]interface{}{ + "module": "stan", + "metricsets": []string{"channels"}, + "hosts": []string{server.URL}, + } + reporter := &mbtest.CapturingReporterV2{} + + metricSet := mbtest.NewReportingMetricSetV2Error(t, config) + metricSet.Fetch(reporter) + + for idx, evt := range reporter.GetEvents() { + e := mbtest.StandardizeEvent(metricSet, evt) + t.Logf("[%d] %s/%s event: %+v", idx, metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) + } + +} diff --git a/metricbeat/module/stan/channels/data.go b/metricbeat/module/stan/channels/data.go new file mode 100644 index 000000000000..983544847cf6 --- /dev/null +++ b/metricbeat/module/stan/channels/data.go @@ -0,0 +1,124 @@ +// 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. + +package channels + +import ( + + // "github.com/pkg/errors" + + // "github.com/elastic/beats/libbeat/common" + "encoding/json" + + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/common" + s "github.com/elastic/beats/libbeat/common/schema" + c "github.com/elastic/beats/libbeat/common/schema/mapstriface" + "github.com/elastic/beats/metricbeat/mb" +) + +var channelSchema = s.Schema{ + "cluster_id": c.Str("cluster_id"), + "server_id": c.Str("server_id"), + "name": c.Str("name"), + "msgs": c.Int("msgs"), + "bytes": c.Int("bytes"), + "first_seq": c.Int("first_seq"), + "last_seq": c.Int("last_seq"), + "depth": c.Int("depth", s.Optional), // aggregated by the module +} + +type Subscription struct { + QueueName string `json:"queue_name"` + IsDurable bool `json:"is_durable"` + IsOffline bool `json:"is_offline"` + IsStalled bool `json:"is_stalled"` + PendingCount int64 `json:"pending_count"` + LastSent int64 `json:"last_sent"` +} +type Channel struct { + Name string `json:"name"` + Msgs int64 `json:"msgs"` + Bytes int64 `json:"bytes"` + FirstSeq int64 `json:"first_seq"` + LastSeq int64 `json:"last_seq"` + Subscriptions []Subscription `json:"subscriptions,omitempty"` +} + +type Channels struct { + ClusterID string `json:"cluster_id"` + ServerID string `json:"server_id"` + Limit uint64 `json:"limit"` + Total uint64 `json:"total"` + Channels []Channel `json:"channels,omitempty"` +} + +// eventMapping map a channel to a Metricbeat event +func eventMapping(content map[string]interface{}) (mb.Event, error) { + fields, err := channelSchema.Apply(content) + if err != nil { + return mb.Event{}, err + } + if err != nil { + return mb.Event{}, errors.Wrap(err, "failure applying channels schema") + } + + event := mb.Event{ + MetricSetFields: fields, + ModuleFields: common.MapStr{}, + } + return event, nil +} + +// eventsMapping maps the top-level channel metrics AND also per-channel metrics AND subscriptions +func eventsMapping(content []byte, r mb.ReporterV2) error { + channelsIn := Channels{} + if err := json.Unmarshal(content, &channelsIn); err != nil { + return errors.Wrap(err, "failure unmarshaling Nats streaming channels response to JSON") + } + + for _, ch := range channelsIn.Channels { + var evt mb.Event + var err error + var maxSubSeq int64 + for _, sub := range ch.Subscriptions { + if sub.LastSent > maxSubSeq { + maxSubSeq = sub.LastSent + } + } + chWrapper := map[string]interface{}{ + "cluster_id": channelsIn.ClusterID, + "server_id": channelsIn.ServerID, + "name": ch.Name, + "msgs": ch.Msgs, + "bytes": ch.Bytes, + "first_seq": ch.FirstSeq, + "last_seq": ch.LastSeq, + "depth": ch.LastSeq - maxSubSeq, // queue depth is known channel seq number - maximum consumed by subscribers + } + + if evt, err = eventMapping(chWrapper); err != nil { + r.Error(errors.Wrap(err, "failure to map channel to its schema")) + } + if !r.Event(evt) { + r.Error(errors.New("error emitting event")) + } + } + + return nil +} diff --git a/metricbeat/module/stan/doc.go b/metricbeat/module/stan/doc.go new file mode 100644 index 000000000000..858931666636 --- /dev/null +++ b/metricbeat/module/stan/doc.go @@ -0,0 +1,21 @@ +// 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. + +/* +Package stan is a Metricbeat module that contains MetricSets. +*/ +package stan diff --git a/metricbeat/module/stan/fields.go b/metricbeat/module/stan/fields.go new file mode 100644 index 000000000000..04b6589fa079 --- /dev/null +++ b/metricbeat/module/stan/fields.go @@ -0,0 +1,36 @@ +// 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. + +// Code generated by beats/dev-tools/cmd/asset/asset.go - DO NOT EDIT. + +package stan + +import ( + "github.com/elastic/beats/libbeat/asset" +) + +func init() { + if err := asset.SetFields("metricbeat", "stan", asset.ModuleFieldsPri, AssetStan); err != nil { + panic(err) + } +} + +// AssetStan returns asset data. +// This is the base64 encoded gzipped contents of ../metricbeat/module/stan. +func AssetStan() string { + return "eJy8l0tv20YQx+/6FIP0YgN2fdchhWE7gAFVRSv1VBTJkjskF1rO0jvDCOqnL5YvU3zERkKFB0Og6Pn/5qH/LG/hgKc1sChaAYgRi2v4sBNFH1YAGjn2phDjaA0fVwBQPQm/O11aXAF4tKgY1xChqBVAYtBqXldP3gKpHLvY4ZJTgWtIvSuL5s6EQri+hH/6ArEjUYY4xBDDYmIGyZTAET2CR6Uh8S6HrRKGnXhUuaEUGP1X9HC1299vr5uYfbIzuurZX43uvmkxD3g6Ot+/PwMbrn2Grezz45yImBxHMloJvk9jV8cPUcAlkKN4E0PsUYWnR6JxpojQ8kixX/83JB96DSC4AwqF5rbQd3Ve/wGSLpwhaZj6ksMJaa9hP/rk4e/ZF/MteYO/bU2IGGomGUKYitcc2jJNguSc8iSIdZR+B0WZR+gDx4AhR2aVIk9CRCfBC1JU4cFQVZthMX6B5wQS41k+M77AR8gNXf0TPhoCLqNOjP+9DpOswDpmyBRD4ZhNZE/g4rj0HvVkcl3shRL8FOIB40uJFHe5sjiPei7JPo9Vi+Js1A/RaCwkWwjlzxJLrCNCpBg1lIUjqHpDY0hFGjKTZsgCHgvnBXXb8SqJ8+fHlidKlrEeR/ZUodxa/Ip22opa8/VoVSBdxohCEgs7UWxLFvRw17cgR4lJS1/5eC1aL6/H+80f26cbeNj8vds//fX0eD2J6Z1dkPI5aSFR31Sxa+c0DOQ0dnPbJHK1QaXR38AnZ607hk8PirQJe20aN7YGSaYtzZBg2hund9d14GpTGl1X+751UYreeM5qfmNdX6AsUyLdtpvaQt9vONtOug0MKvZhPShra5yX4EmX33qvJPWyix1xmaN+D8/Y2GY6efGzVV94IX8zQ2tY+pjVzNs5+1X94/xs9Iw/TGzEy6GFG2d4hkExu9hUi+RoBhu4paxm5XKM2/v9rtao33i+XdIx8w2YBBSdft5Rrjk6kSx5djqQO9LocNLU6KwE9XuhCiZzmCEskLQZYfy4qzRxX32ueim9A3F9zGjg3y2VSxJraHqUIueGv4O3tjcPNCFX/hC8jlul3+bOOtbitCEsgVF3UhxE2Gqdg6z+DwAA//93AYgj" +} diff --git a/metricbeat/module/stan/module.yml b/metricbeat/module/stan/module.yml new file mode 100644 index 000000000000..0caa73538c9e --- /dev/null +++ b/metricbeat/module/stan/module.yml @@ -0,0 +1,3 @@ +dashboards: + - id: Metricbeat-Stan-Dashboard + file: Metricbeat-stan-overview.json diff --git a/metricbeat/module/stan/stats/_meta/data.json b/metricbeat/module/stan/stats/_meta/data.json new file mode 100644 index 000000000000..3d87dbbf5012 --- /dev/null +++ b/metricbeat/module/stan/stats/_meta/data.json @@ -0,0 +1,23 @@ +{ + "@timestamp":"2019-07-30T08:05:34.853Z", + "beat":{ + "hostname":"beathost", + "name":"beathost" + }, + "metricset":{ + "host":"localhost", + "module":"stan", + "name":"stats", + "rtt":44269 + }, + "nats":{ + "stats":{ + "clients": 52, + "subscriptions": 109, + "channels": 55, + "msgs": 101, + "bytes": 27473416 + } + }, + "type":"metricsets" +} diff --git a/metricbeat/module/stan/stats/_meta/docs.asciidoc b/metricbeat/module/stan/stats/_meta/docs.asciidoc new file mode 100644 index 000000000000..8d1fc9549581 --- /dev/null +++ b/metricbeat/module/stan/stats/_meta/docs.asciidoc @@ -0,0 +1 @@ +Streaming server statistics (STAN) diff --git a/metricbeat/module/stan/stats/_meta/fields.yml b/metricbeat/module/stan/stats/_meta/fields.yml new file mode 100644 index 000000000000..8dadcc13ff60 --- /dev/null +++ b/metricbeat/module/stan/stats/_meta/fields.yml @@ -0,0 +1,35 @@ +- name: stats + type: group + description: > + Contains only high-level stan / nats streaming server related metrics + release: beta + fields: + - name: state + type: keyword + description: > + The cluster / streaming configuration state (STANDALONE, CLUSTERED) + - name: role + type: keyword + description: > + If clustered, role of this node in the cluster (Leader, Follower, Candidate) + - name: clients + type: integer + description: > + The number of STAN clients + - name: subscriptions + type: integer + description: > + The number of STAN streaming subscriptions + - name: channels + type: integer + description: > + The number of STAN channels + - name: messages + type: long + description: > + Number of messages across all STAN queues + - name: bytes + type: long + description: > + Number of bytes consumed across all STAN queues + diff --git a/metricbeat/module/stan/stats/_meta/test/serversz.json b/metricbeat/module/stan/stats/_meta/test/serversz.json new file mode 100644 index 000000000000..f6319ea45874 --- /dev/null +++ b/metricbeat/module/stan/stats/_meta/test/serversz.json @@ -0,0 +1,15 @@ +{ + "cluster_id": "nats-smp", + "server_id": "drE5wVcRP3jvBrUbu2i48E", + "version": "0.11.2", + "go": "go1.11.1", + "state": "STANDALONE", + "now": "2019-07-26T21:04:58.54617639Z", + "start_time": "2019-07-23T18:14:58.113267661Z", + "uptime": "3d2h50m0s", + "clients": 52, + "subscriptions": 109, + "channels": 55, + "total_msgs": 101, + "total_bytes": 27473416 + } \ No newline at end of file diff --git a/metricbeat/module/stan/stats/data.go b/metricbeat/module/stan/stats/data.go new file mode 100644 index 000000000000..a1cc099e0b8d --- /dev/null +++ b/metricbeat/module/stan/stats/data.go @@ -0,0 +1,67 @@ +// 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. + +package streaming + +import ( + "encoding/json" + + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/common" + s "github.com/elastic/beats/libbeat/common/schema" + c "github.com/elastic/beats/libbeat/common/schema/mapstriface" + "github.com/elastic/beats/metricbeat/mb" +) + +var ( + clientsSchema = s.Schema{ + "cluster_id": c.Str("cluster_id"), + "server_id": c.Str("server_id"), + "state": c.Str("state"), + "role": c.Str("role", s.Optional), // cluster role is optional + "clients": c.Int("clients"), + "subscriptions": c.Int("subscriptions"), + "channels": c.Int("channels"), + "msgs": c.Int("total_msgs"), + "bytes": c.Int("total_bytes"), + } +) + +func eventMapping(content []byte, r mb.ReporterV2) error { + var streaming = make(map[string]interface{}) + if err := json.Unmarshal(content, &streaming); err != nil { + return errors.Wrap(err, "error in streaming server mapping") + } + + fields, err := clientsSchema.Apply(streaming) + if err != nil { + return errors.Wrap(err, "failure parsing Nats streaming server API response") + } + + moduleFields := common.MapStr{} + event := mb.Event{ + MetricSetFields: fields, + ModuleFields: moduleFields, + } + if !r.Event(event) { + err := errors.New("Failed to report event") + r.Error(err) + return err + } + return nil +} diff --git a/metricbeat/module/stan/stats/docs.asciidoc b/metricbeat/module/stan/stats/docs.asciidoc new file mode 100644 index 000000000000..8ae7b999aab2 --- /dev/null +++ b/metricbeat/module/stan/stats/docs.asciidoc @@ -0,0 +1 @@ +This is the top-level streaming metricset of the nats module \ No newline at end of file diff --git a/metricbeat/module/stan/stats/stats.go b/metricbeat/module/stan/stats/stats.go new file mode 100644 index 000000000000..c1b62b765b6c --- /dev/null +++ b/metricbeat/module/stan/stats/stats.go @@ -0,0 +1,92 @@ +// 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. + +package streaming + +import ( + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/helper" + "github.com/elastic/beats/metricbeat/mb" + "github.com/elastic/beats/metricbeat/mb/parse" +) + +const ( + defaultScheme = "http" + defaultPath = "/streaming/serverz" +) + +var ( + hostParser = parse.URLHostParserBuilder{ + DefaultScheme: defaultScheme, + DefaultPath: defaultPath, + PathConfigKey: "stats.metrics_path", + }.Build() +) + +func init() { + mb.Registry.MustAddMetricSet("stan", "stats", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) +} + +// MetricSet holds any configuration or state information. It must implement +// the mb.MetricSet interface. And this is best achieved by embedding +// mb.BaseMetricSet because it implements all of the required mb.MetricSet +// interface methods except for Fetch. +type MetricSet struct { + mb.BaseMetricSet + http *helper.HTTP + Log *logp.Logger +} + +// New creates a new instance of the MetricSet. New is responsible for unpacking +// any MetricSet specific configuration options if there are any. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + config := struct{}{} + if err := base.Module().UnpackConfig(&config); err != nil { + return nil, err + } + + http, err := helper.NewHTTP(base) + if err != nil { + return nil, err + } + return &MetricSet{ + base, + http, + logp.NewLogger("stan"), + }, nil +} + +// Fetch methods implements the data gathering and data conversion to the right +// format. It publishes the event which is then forwarded to the output. In case +// of an error set the Error field of mb.Event or simply call report.Error(). +func (m *MetricSet) Fetch(r mb.ReporterV2) error { + content, err := m.http.FetchContent() + if err != nil { + return errors.Wrap(err, "error in fetch") + } + err = eventMapping(content, r) + if err != nil { + return errors.Wrap(err, "error in mapping") + } + + return nil +} diff --git a/metricbeat/module/stan/stats/stats_test.go b/metricbeat/module/stan/stats/stats_test.go new file mode 100644 index 000000000000..bebec698d8f0 --- /dev/null +++ b/metricbeat/module/stan/stats/stats_test.go @@ -0,0 +1,67 @@ +// 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. + +package streaming + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + + mbtest "github.com/elastic/beats/metricbeat/mb/testing" +) + +func TestEventMapping(t *testing.T) { + content, err := ioutil.ReadFile("./_meta/test/serversz.json") + assert.NoError(t, err) + reporter := &mbtest.CapturingReporterV2{} + err = eventMapping(content, reporter) + assert.NoError(t, err) + event := reporter.GetEvents()[0] + d, _ := event.MetricSetFields.GetValue("channels") + assert.Equal(t, d, int64(55)) +} + +func TestFetchEventContent(t *testing.T) { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/serversz.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + defer server.Close() + + config := map[string]interface{}{ + "module": "stan", + "metricsets": []string{"stats"}, + "hosts": []string{server.URL}, + } + reporter := &mbtest.CapturingReporterV2{} + + metricSet := mbtest.NewReportingMetricSetV2Error(t, config) + metricSet.Fetch(reporter) + + events := reporter.GetEvents() + e := mbtest.StandardizeEvent(metricSet, events[0]) + t.Logf("%s/%s event: %+v", metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) +} diff --git a/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc b/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc new file mode 100644 index 000000000000..62b907290630 --- /dev/null +++ b/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc @@ -0,0 +1 @@ +NATS streaming server (STAN) subscription statistics \ No newline at end of file diff --git a/metricbeat/module/stan/subscriptions/_meta/fields.yml b/metricbeat/module/stan/subscriptions/_meta/fields.yml new file mode 100644 index 000000000000..463666e2287f --- /dev/null +++ b/metricbeat/module/stan/subscriptions/_meta/fields.yml @@ -0,0 +1,36 @@ +- name: subscriptions + type: group + description: > + Contains stan / nats streaming/serverz endpoint subscription metrics + release: beta + fields: + - name: id + type: keyword + description: > + The name of the STAN channel subscription (client_id) + - name: channel + type: keyword + description: > + The name of the STAN channel the subscription is associated with + - name: queue + type: keyword + description: > + The name of the NATS queue that the STAN channel subscription is associated with, if any +# If first_seq > min([seq in subscriptions]) data loss has possibly occurred + - name: last_sent + type: long + description: > + Last known sequence number of the subscription that was acked + - name: pending + type: long + description: > + Number of pending messages from / to the subscriber + - name: offline + type: bool + description: > + Is the subscriber marked as offline? + - name: stalled + type: bool + description: > + Is the subscriber known to be stalled? + diff --git a/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json b/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json new file mode 100644 index 000000000000..9150207e8e92 --- /dev/null +++ b/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json @@ -0,0 +1,1965 @@ +{ + "cluster_id": "nats-smp", + "server_id": "drE5wVcRP3jvBrUbu2i48E", + "now": "2019-07-28T14:39:53.765831341Z", + "offset": 0, + "limit": 1024, + "count": 55, + "total": 55, + "channels": [ + { + "name": "evmon.sync", + "msgs": 4, + "bytes": 2606, + "first_seq": 1, + "last_seq": 4, + "subscriptions": [ + { + "client_id": "PolicySync_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slElun", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ia", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 4, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.alerts", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMcd", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAFa", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.artemis", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMeN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAHA", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.census-policy.1c0d2330-4f16-454f-b818-246c6f14ae32", + "msgs": 10, + "bytes": 2654, + "first_seq": 1, + "last_seq": 10, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMxX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAYY", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 10, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.census-sensor.1c0d2330-4f16-454f-b818-246c6f14ae32", + "msgs": 117, + "bytes": 40874, + "first_seq": 1, + "last_seq": 117, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMzH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAa8", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 117, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.endpoint-health", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMsJ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iATo", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.events-collection", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMvn", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAWy", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.events-stats", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMop", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAQe", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.generic-response", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMn5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAP4", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.login", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMg7", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAIk", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.rules", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMu3", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAVO", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.sensor-statistics-v2", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMqZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iASE", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.stats", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMat", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAE0", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.system-survey", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMlL", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iANU", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.timeline", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMjb", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iALu", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "feedback.whitelist", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "jetstream", + "inbox": "_INBOX.hFr9qdcbbz7uAVmOvUvMhr", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2iAKK", + "queue_name": "jetstream:jetstream", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "iris.task", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbJL", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5dU", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6OS", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5us", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScGC", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i62m", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNLJ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ag", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "policy.sync", + "msgs": 5, + "bytes": 865, + "first_seq": 1, + "last_seq": 5, + "subscriptions": [ + { + "client_id": "EvmonSync_18597", + "inbox": "_INBOX.Gew6Kgyo267QciQcrXYGI1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Vw", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 5, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "37e5e4faff53c7a17e31c6", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5B2", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "d0be381d44197f5e3679d", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5KW", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "6860a88df228e1c8a6d076", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5U0", + "queue_name": "packrat:packrat_alert_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtEE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5my", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.feedback.endpoint-health", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtqI", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5tI", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.feedback.sensor-statistics", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtgm", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5ri", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.file", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "kratos_consumer_18602", + "inbox": "22fa46f205f94a6befe1a5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4nK", + "queue_name": "krotos_sensor.file_qg:krotos_sensor.file_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.fraggo", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_3", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeZT4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4G8", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_4", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeZwU", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Hi", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_5", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeaPu", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4JI", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "fraggo_bkrku0dklpukhg54ofqg_6", + "inbox": "_INBOX.NM8SUzN1Wxanob4pCWeatK", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Ks", + "queue_name": "fraggo_qg:qconsume", + "is_durable": true, + "is_offline": false, + "max_inflight": 256, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "bd5cd5be5c4b71a1828a40", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Iw", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "ab4f18095efc9c36e694e7", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5SQ", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "5405be5a758c5ae8763ce5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5bu", + "queue_name": "packrat:packrat_message_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtNk", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5oY", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.policyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "7b6061e5f3b8d818c7db57", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5EC", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "4c2e54659b9b8464c1181", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Ng", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "b76e072a562ee3ef8e35c4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5XA", + "queue_name": "packrat:packrat_policyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "PolicyStatus_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEnLd", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6S4", + "queue_name": "sensor.message.policyResponse:sensor.message.policyResponse.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.shutdownResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "67d4a14b449ef135ee8d86", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Fm", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "eba867033c5a24d50fe33a", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5PG", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "668d672fc35fdeef08739a", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Yk", + "queue_name": "packrat:packrat_shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "assets_consumer_18646", + "inbox": "9c2b7d2e3e8d0c7d443490", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4s4", + "queue_name": "assets_sensor.message.shutdownResponse_qg:assets_sensor.message.shutdownResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.systemNetworkSurveyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "packrat_consumer_19854", + "inbox": "152fac7b57ff5403f79aa0", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Cc", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "8ca6551be87c3e15de0529", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5M6", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "de18cad520f4dc5363c1af", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Va", + "queue_name": "packrat:packrat_systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "assets_consumer_18646", + "inbox": "1fe98d38982bc66fd7613c", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4qU", + "queue_name": "assets_sensor.message.systemNetworkSurveyResponse_qg:assets_sensor.message.systemNetworkSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.message.systemSurveyResponse", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "assets_consumer_18646", + "inbox": "deca00d0dc0ab84879b4d8", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ou", + "queue_name": "assets_sensor.message.systemSurveyResponse_qg:assets_sensor.message.systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19854", + "inbox": "d07b52e1f109675f59f598", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5HM", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19853", + "inbox": "321a353199867a3e478f91", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5Qq", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "packrat_consumer_19855", + "inbox": "a2627ef32aa6ea9d197c22", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5aK", + "queue_name": "packrat:packrat_systemSurveyResponse_qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 128, + "ack_wait": 128, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qtXG", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5q8", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.out.dead", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbLH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5f4", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6SU", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5wS", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScM4", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i64M", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNOX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6CG", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.ack", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "AckBot_19683_12eae663", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGRe", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4yO", + "queue_name": "sensor.session.ack:sensor.session.ack.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "AckBot_19683_5f59b864", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGtQ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4zy", + "queue_name": "sensor.session.ack:sensor.session.ack.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.close", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "SessBotClose_19683_109cb6db", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTH1M", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i538", + "queue_name": "sensor.session.close:sensor.session.closeSessBotClose.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "sensor.session.open", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "ActiveMon_18597", + "inbox": "_INBOX.Gew6Kgyo267QciQcrXYFF1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4O2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "HiggoBot_19445_2d574335", + "inbox": "_INBOX.4cX5QV4YzWusN2hoe6j7uH", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4te", + "queue_name": "sensor.session.open:sensor.session.openhiggo.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SessBotOpen_19683_7e937fb5", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTHHE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i51Y", + "queue_name": "sensor.session.open:sensor.session.openSessBotOpen.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 64, + "ack_wait": 60, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.alertDismiss", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "alert_dismisser_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIXTz", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4dq", + "queue_name": "alertDismisser:stan.alertDismiss.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 4, + "ack_wait": 120, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.default-whitelist-macos", + "msgs": 1, + "bytes": 46869, + "first_seq": 1, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "9b45e0f79cf60c1a981a71", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6NK", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 1, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.default-whitelist-win", + "msgs": 1, + "bytes": 468380, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "a585d6b05cf852210377df", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6l2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacho", + "msgs": 1, + "bytes": 1679250, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "ee2f6aa8c92b1f26bf4731", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6QU", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacho-whitelist", + "msgs": 1, + "bytes": 65106, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "ab644250d31251a8c41ae3", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6hs", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacro", + "msgs": 1, + "bytes": 187130, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "72ed357b7010f10ad7d530", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Lk", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointmacro-whitelist", + "msgs": 1, + "bytes": 60852, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "23455b15790f0fbc61f72e", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Ou", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe", + "msgs": 1, + "bytes": 13400830, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "4069ec27b679b6a2969851", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i7AK", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe-blacklist", + "msgs": 1, + "bytes": 5243033, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "rugo", + "inbox": "_INBOX.tuwUxYDi38CbqlJbn1NllX", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4fQ", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.endpointpe-whitelist", + "msgs": 1, + "bytes": 5240348, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "smeagol_connector_19734", + "inbox": "b0205277c87d5193600905", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6jS", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.rules", + "msgs": 1, + "bytes": 1050028, + "first_seq": 2, + "last_seq": 2, + "subscriptions": [ + { + "client_id": "rugo", + "inbox": "_INBOX.tuwUxYDi38CbqlJbn1Nlqs", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4lk", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 2, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.artifact.smp-policy-defaults", + "msgs": 1, + "bytes": 228, + "first_seq": 1, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "SyncArbiter_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEmi9", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6KA", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 1, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.private.gorat.delete", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_remover_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWqN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Z6", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.sensor.blacklist", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbND", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5ge", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6WW", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5y2", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScRw", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i65w", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNRl", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Dq", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.silent.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "cargoplane", + "inbox": "_INBOX.dKNSAXz01qhTUI8ie3qt4i", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5lO", + "queue_name": "cargoplane", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "stan.system.delete", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_remover_18605", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWMf", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4RC", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8lbI", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i56I", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7IfqZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4MS", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmeY", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4h0", + "durable_name": "stan.system.delete_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.endpoint", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8luO", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i59S", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7IgB1", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4XW", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmuE", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4kA", + "durable_name": "system.endpoint_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.endpoint_change", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "grouper_19756_1154ea", + "inbox": "_INBOX.Ixonb40xwWrjifYoJO8lkq", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i57s", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": false, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbR5", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5jo", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6ea", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i61C", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScdg", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i696", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNYD", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6H0", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_18612_5bc04c", + "inbox": "_INBOX.99otlg166ncFNmkGI7Ig0n", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Pc", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "grouper_19316_aeccf2", + "inbox": "_INBOX.OyibBHlBoNpd9R79RnZmmO", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ia", + "durable_name": "system.endpoint_change_grouper", + "is_durable": true, + "is_offline": true, + "max_inflight": 25, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.hostIsolation", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "PolicyStatus_19978", + "inbox": "_INBOX.aATevIULHA7Va0i0slEnVV", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Te", + "queue_name": "system.hostIsolation:system.hostIsolation.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.index", + "msgs": 1, + "bytes": 20, + "first_seq": 0, + "last_seq": 1, + "subscriptions": [ + { + "client_id": "gorat_1", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIW7o", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4Sm", + "queue_name": "gorat:system.index.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 1, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "gorat_0", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIVsx", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4UM", + "queue_name": "gorat:system.index.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.index.alert", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "gorat_1", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWgT", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4ag", + "queue_name": "gorat:system.index.alert.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "gorat_0", + "inbox": "_INBOX.MIZc6DRAvPEvZO76HAIWWZ", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4cG", + "queue_name": "gorat:system.index.alert.group", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 300, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.sensor", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "iris_19969_JnN-xUioKE4_task", + "inbox": "_INBOX.CfWNB5a9Wrf903aa4AbbP9", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5iE", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19973_KWCkEsBYMCA_task", + "inbox": "_INBOX.EzsKP1uRLXk7zxxyaaK6aY", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i5zc", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19974_pUlU4pDZP5o_task", + "inbox": "_INBOX.LNMD0LZzTt54evuJvlScXo", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i67W", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "iris_19972_6ATU0b_x4GA_task", + "inbox": "_INBOX.rmaZd2U8Zg5TuTNaE8dNUz", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6FQ", + "is_durable": false, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SirgoSysBot19683_8c7b9706", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTGhW", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i54i", + "queue_name": "system.sensor:system.sensorSirgoSysBot.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_0", + "inbox": "_INBOX.aATevIULHA7Va0i0slEo8z", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6VE", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_1", + "inbox": "_INBOX.aATevIULHA7Va0i0slEomT", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Wo", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_2", + "inbox": "_INBOX.aATevIULHA7Va0i0slEpPx", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6YO", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_3", + "inbox": "_INBOX.aATevIULHA7Va0i0slEq3R", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6Zy", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_4", + "inbox": "_INBOX.aATevIULHA7Va0i0slEqgv", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6bY", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_5", + "inbox": "_INBOX.aATevIULHA7Va0i0slErKP", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6d8", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_6", + "inbox": "_INBOX.aATevIULHA7Va0i0slErxt", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6ei", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "SensorCtx_19978_iter_7", + "inbox": "_INBOX.aATevIULHA7Va0i0slEsbN", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i6gI", + "queue_name": "system.sensorGassitSensor.qg:system.sensorGassitSensor.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 1024, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + }, + { + "name": "system.task.indexed", + "msgs": 0, + "bytes": 0, + "first_seq": 0, + "last_seq": 0, + "subscriptions": [ + { + "client_id": "IdxBot_19683_98975eae", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTHPA", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4vE", + "queue_name": "system.task.indexed:system.task.indexed.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + }, + { + "client_id": "IdxBot_19683_5651ebb7", + "inbox": "_INBOX.r5KNLGpTn5GybqLGJbTH9I", + "ack_inbox": "_INBOX.drE5wVcRP3jvBrUbu2i4wo", + "queue_name": "system.task.indexed:system.task.indexed.qg", + "is_durable": true, + "is_offline": false, + "max_inflight": 8192, + "ack_wait": 30, + "last_sent": 0, + "pending_count": 0, + "is_stalled": false + } + ] + } + ] +} \ No newline at end of file diff --git a/metricbeat/module/stan/subscriptions/data.go b/metricbeat/module/stan/subscriptions/data.go new file mode 100644 index 000000000000..f1e090b7afe7 --- /dev/null +++ b/metricbeat/module/stan/subscriptions/data.go @@ -0,0 +1,104 @@ +// 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. + +package subscriptions + +import ( + "encoding/json" + + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/common" + s "github.com/elastic/beats/libbeat/common/schema" + c "github.com/elastic/beats/libbeat/common/schema/mapstriface" + "github.com/elastic/beats/metricbeat/mb" +) + +var ( + subscriptionsSchema = s.Schema{ + "id": c.Str("client_id"), + "channel": c.Str("channel"), // this is a computed field added AFTER schema.Apply + "queue": c.Str("queue_name", s.Optional), // not all STAN channels report as NATS queue associated + "last_sent": c.Int("last_sent"), + "offline": c.Bool("is_offline"), + "stalled": c.Bool("is_stalled"), + "pending": c.Int("pending_count"), + } +) + +// subscriptionsSchema used to parse through each subscription +// under a presumed channel +func eventMapping(content map[string]interface{}) (mb.Event, error) { + fields, err := subscriptionsSchema.Apply(content) + if err != nil { + return mb.Event{}, errors.Wrap(err, "failure applying subscription schema") + } + event := mb.Event{ + MetricSetFields: fields, + ModuleFields: common.MapStr{}, + } + return event, nil +} + +type Subscription struct { + QueueName string `json:"queue_name"` + IsDurable bool `json:"is_durable"` + IsOffline bool `json:"is_offline"` + IsStalled bool `json:"is_stalled"` + PendingCount int64 `json:"pending_count"` + LastSent int64 `json:"last_sent"` +} +type Channel struct { + Name string `json:"name"` + Msgs int64 `json:"msgs"` + Bytes int64 `json:"bytes"` + LastSeq int64 `json:"last_seq"` + // Subscriptions []Subscription `json:"subscriptions,omitempty"` + Subscriptions []map[string]interface{} `json:"subscriptions,omitempty"` +} + +type Channels struct { + ClusterID string `json:"cluster_id"` + Limit uint64 `json:"limit"` + Total uint64 `json:"total"` + Channels []Channel `json:"channels,omitempty"` +} + +// eventsMapping maps the top-level channel metrics AND also per-channel metrics AND subscriptions +func eventsMapping(content []byte, r mb.ReporterV2) error { + var err error + channels := Channels{} + if err = json.Unmarshal(content, &channels); err != nil { + return errors.Wrap(err, "failure unmarshaling Nats streaming channels detailed response to JSON") + } + + for _, ch := range channels.Channels { + for _, sub := range ch.Subscriptions { + var evt mb.Event + sub["channel"] = ch.Name + evt, err = eventMapping(sub) + if err != nil { + r.Error(errors.Wrap(err, "error mapping subscription event")) + } + + if !r.Event(evt) { + r.Error(errors.New("Error emitting event")) + } + } + } + return nil +} diff --git a/metricbeat/module/stan/subscriptions/subscriptions.go b/metricbeat/module/stan/subscriptions/subscriptions.go new file mode 100644 index 000000000000..cb82cb4b66b2 --- /dev/null +++ b/metricbeat/module/stan/subscriptions/subscriptions.go @@ -0,0 +1,96 @@ +// 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. + +package subscriptions + +import ( + "github.com/pkg/errors" + + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/metricbeat/helper" + "github.com/elastic/beats/metricbeat/mb" + "github.com/elastic/beats/metricbeat/mb/parse" + + "github.com/elastic/beats/metricbeat/module/stan" +) + +const ( + defaultScheme = "http" + defaultPath = "/streaming/channelsz" + queryParams = "subs=1" +) + +var ( + hostParser = parse.URLHostParserBuilder{ + DefaultScheme: defaultScheme, + DefaultPath: defaultPath, + PathConfigKey: "subscriptions.metrics_path", + QueryParams: queryParams, + }.Build() +) + +func init() { + mb.Registry.MustAddMetricSet("stan", "subscriptions", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) +} + +// MetricSet holds any configuration or state information. It must implement +// the mb.MetricSet interface. And this is best achieved by embedding +// mb.BaseMetricSet because it implements all of the required mb.MetricSet +// interface methods except for Fetch. +type MetricSet struct { + mb.BaseMetricSet + http *helper.HTTP + Log *logp.Logger +} + +// New creates a new instance of the MetricSet. New is responsible for unpacking +// any MetricSet specific configuration options if there are any. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + config := struct{}{} + if err := base.Module().UnpackConfig(&config); err != nil { + return nil, err + } + + http, err := helper.NewHTTP(base) + if err != nil { + return nil, err + } + return &MetricSet{ + base, + http, + logp.NewLogger("stan"), + }, nil +} + +// Fetch methods implements the data gathering and data conversion to the right +// format. It publishes the event which is then forwarded to the output. In case +// of an error set the Error field of mb.Event or simply call report.Error(). +func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { + _ = stan.AssetStan() + content, err := m.http.FetchContent() + if err != nil { + return errors.Wrap(err, "error in fetch") + } + if err = eventsMapping(content, r); err != nil { + return errors.Wrap(err, "error in mapping") + } + + return nil +} diff --git a/metricbeat/module/stan/subscriptions/subscriptions_test.go b/metricbeat/module/stan/subscriptions/subscriptions_test.go new file mode 100644 index 000000000000..dc651d0f388a --- /dev/null +++ b/metricbeat/module/stan/subscriptions/subscriptions_test.go @@ -0,0 +1,53 @@ +package subscriptions + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + mbtest "github.com/elastic/beats/metricbeat/mb/testing" + "github.com/stretchr/testify/assert" +) + +func TestEventMapping(t *testing.T) { + content, err := ioutil.ReadFile("./_meta/test/subscriptions.json") + assert.NoError(t, err) + reporter := &mbtest.CapturingReporterV2{} + err = eventsMapping(content, reporter) + assert.NoError(t, err) + evts := reporter.GetEvents() + + // 115 subscribers + assert.Equal(t, len(evts), 115) + errErrs := reporter.GetErrors() + assert.Equal(t, len(errErrs), 0) +} +func TestFetchEventContent(t *testing.T) { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/subscriptions.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + defer server.Close() + + config := map[string]interface{}{ + "module": "stan", + "metricsets": []string{"subscriptions"}, + "hosts": []string{server.URL}, + } + reporter := &mbtest.CapturingReporterV2{} + + metricSet := mbtest.NewReportingMetricSetV2Error(t, config) + metricSet.Fetch(reporter) + + for idx, evt := range reporter.GetEvents() { + e := mbtest.StandardizeEvent(metricSet, evt) + t.Logf("[%d] %s/%s event: %+v", idx, metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) + } + +} diff --git a/metricbeat/modules.d/stan.yml.disabled b/metricbeat/modules.d/stan.yml.disabled new file mode 100644 index 000000000000..83b84a46d58e --- /dev/null +++ b/metricbeat/modules.d/stan.yml.disabled @@ -0,0 +1,13 @@ +# Module: stan +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.2/metricbeat-module-stan.html + +- module: stan + metricsets: ["stats", "subscriptions", "channels"] + period: 60s + hosts: ["localhost:8222"] + #stats.metrics_path: "/varz" + #connections.metrics_path: "/connz" + #routes.metrics_path: "/routez" + #subscriptions.metrics_path: "/subsz" + #clients.metrics_path: "/streaming/clientsz" + #channels.metrics_path: "/streaming/channelsz" From 3b78c086e1d8e0d380b7053128ff045c8bc456fe Mon Sep 17 00:00:00 2001 From: Devon Kim Date: Wed, 14 Aug 2019 15:39:23 -0400 Subject: [PATCH 02/34] bool -> boolean for field declaration Signed-off-by: chrismark --- metricbeat/module/stan/subscriptions/_meta/fields.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metricbeat/module/stan/subscriptions/_meta/fields.yml b/metricbeat/module/stan/subscriptions/_meta/fields.yml index 463666e2287f..536138f8c5fb 100644 --- a/metricbeat/module/stan/subscriptions/_meta/fields.yml +++ b/metricbeat/module/stan/subscriptions/_meta/fields.yml @@ -26,11 +26,11 @@ description: > Number of pending messages from / to the subscriber - name: offline - type: bool + type: boolean description: > Is the subscriber marked as offline? - name: stalled - type: bool + type: boolean description: > Is the subscriber known to be stalled? From 8ce67aee1013c5458507c5ed89b3b7f379c58cd4 Mon Sep 17 00:00:00 2001 From: Devon Kim Date: Tue, 29 Oct 2019 13:32:50 -0400 Subject: [PATCH 03/34] bool != boolean Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 4 ++-- metricbeat/module/stan/fields.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 2e3d06ab4ac1..3e0b8cd0530b 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -30245,7 +30245,7 @@ Number of pending messages from / to the subscriber *`stan.subscriptions.offline`*:: + -- -type: bool +type: boolean Is the subscriber marked as offline? @@ -30255,7 +30255,7 @@ Is the subscriber marked as offline? *`stan.subscriptions.stalled`*:: + -- -type: bool +type: boolean Is the subscriber known to be stalled? diff --git a/metricbeat/module/stan/fields.go b/metricbeat/module/stan/fields.go index 04b6589fa079..075eb4762abb 100644 --- a/metricbeat/module/stan/fields.go +++ b/metricbeat/module/stan/fields.go @@ -32,5 +32,5 @@ func init() { // AssetStan returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/stan. func AssetStan() string { - return "eJy8l0tv20YQx+/6FIP0YgN2fdchhWE7gAFVRSv1VBTJkjskF1rO0jvDCOqnL5YvU3zERkKFB0Og6Pn/5qH/LG/hgKc1sChaAYgRi2v4sBNFH1YAGjn2phDjaA0fVwBQPQm/O11aXAF4tKgY1xChqBVAYtBqXldP3gKpHLvY4ZJTgWtIvSuL5s6EQri+hH/6ArEjUYY4xBDDYmIGyZTAET2CR6Uh8S6HrRKGnXhUuaEUGP1X9HC1299vr5uYfbIzuurZX43uvmkxD3g6Ot+/PwMbrn2Grezz45yImBxHMloJvk9jV8cPUcAlkKN4E0PsUYWnR6JxpojQ8kixX/83JB96DSC4AwqF5rbQd3Ve/wGSLpwhaZj6ksMJaa9hP/rk4e/ZF/MteYO/bU2IGGomGUKYitcc2jJNguSc8iSIdZR+B0WZR+gDx4AhR2aVIk9CRCfBC1JU4cFQVZthMX6B5wQS41k+M77AR8gNXf0TPhoCLqNOjP+9DpOswDpmyBRD4ZhNZE/g4rj0HvVkcl3shRL8FOIB40uJFHe5sjiPei7JPo9Vi+Js1A/RaCwkWwjlzxJLrCNCpBg1lIUjqHpDY0hFGjKTZsgCHgvnBXXb8SqJ8+fHlidKlrEeR/ZUodxa/Ip22opa8/VoVSBdxohCEgs7UWxLFvRw17cgR4lJS1/5eC1aL6/H+80f26cbeNj8vds//fX0eD2J6Z1dkPI5aSFR31Sxa+c0DOQ0dnPbJHK1QaXR38AnZ607hk8PirQJe20aN7YGSaYtzZBg2hund9d14GpTGl1X+751UYreeM5qfmNdX6AsUyLdtpvaQt9vONtOug0MKvZhPShra5yX4EmX33qvJPWyix1xmaN+D8/Y2GY6efGzVV94IX8zQ2tY+pjVzNs5+1X94/xs9Iw/TGzEy6GFG2d4hkExu9hUi+RoBhu4paxm5XKM2/v9rtao33i+XdIx8w2YBBSdft5Rrjk6kSx5djqQO9LocNLU6KwE9XuhCiZzmCEskLQZYfy4qzRxX32ueim9A3F9zGjg3y2VSxJraHqUIueGv4O3tjcPNCFX/hC8jlul3+bOOtbitCEsgVF3UhxE2Gqdg6z+DwAA//93AYgj" + return "eJy8l0tv20YQx+/6FIP0YgN2fdchhWE7gAFVRSv1VBTJkjskF1rO0jvDCOqnL5YvU3wkbkyVB0Og6Pn/5qH/LG/hgKc1sChaAYgRi2v4sBNFH1YAGjn2phDjaA0fVwBQPQm/Ol1aXAF4tKgY1xChqBVAYtBqXldP3gKpHLvY4ZJTgWtIvSuL5s6EQri+hH/6ArEjUYY4xBDDYmIGyZTAET2CR6Uh8S6HrRKGnXhUuaEUGP1X9HC1299vr5uYfbIzuurZn43uvmkxD3g6Ot+/PwMbrn2Grezz45yImBxHMloJvk1jV8cPUcAlkKN4E0PsUYWnR6JxpojQ8kixX//vSD70GkBwBxQKzW2h7+q8/gEkXThD0jD1JYcT0l7DfvTJw9+zL+Zb8h3+tjUhYqiZZAhhKl5zaMs0CZJzypMg1lH6AxRlHqEPHAOGHJlVijwJEZ0EL0hRhQdDVW2GxfgJnhNIjGf5zPgCHyE3dPVX+GgIuIw6Mf77OkyyAuuYIVMMhWM2kT2Bi+PSe9STyXWxF0rwU4gHjC8lUtzlyuI86rkk+zxWLYqzUe+i0VhIthDK7yWWWEeESDFqKAtHUPWGxpCKNGQmzZAFPBbOC+q241US58+PLU+ULGM9juypQrm1+BXttBW15uvRqkC6jBGFJBZ2otiWLOjhrm9BjhKTlr7y8Vq0Xl6P95vftk838LD5c7d/+uPp8XoS0zu7IOVz0kKivqli185pGMhp7Oa2SeRqg0qjv4FPzlp3DJ8eFGkT9to0bmwNkkxbmiHBtDdOb67rwNWmNLqu9n3rohS98ZzV/Ma6vkBZpkS6bTe1hX7ccLaddBsYVOzDelDW1jgvwZMuv/VeSeplFzviMkf9Fp6xsc108uJnq77wQv5mhtaw9DGrmbdz9qv6x/nZ6Bl/mNiIl0MLN87wDINidrGpFsnRDDZwS1nNyuUYt/f7Xa1Rv/F8u6Rj5hswCSg6/X9HueboRLLk2elA7kijw0lTo7MS1O+FKpjMYYawQNJmhPF+V2nivvpc9VJ6B+L6mNHAv1sqlyTW0PQoRc5ZVPQfFzgPZCFX/hDsjluxX+aOO9bitCcsRFL3UxxE2Mqds6z+DQAA//9DZYqL" } From 7ffee37e4b8def14a362aac20ffe7dace4f00ac3 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 28 Nov 2019 13:39:46 +0200 Subject: [PATCH 04/34] fmt update Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 545 +++++++++--------- metricbeat/docs/modules/stan.asciidoc | 2 +- .../docs/modules/stan/channels.asciidoc | 3 +- metricbeat/docs/modules/stan/stats.asciidoc | 3 +- .../docs/modules/stan/subscriptions.asciidoc | 18 + metricbeat/docs/modules_list.asciidoc | 426 +++++++------- metricbeat/metricbeat.reference.yml | 4 +- .../module/stan/channels/channels_test.go | 3 +- .../stan/subscriptions/subscriptions_test.go | 20 +- metricbeat/modules.d/stan.yml.disabled | 2 +- 10 files changed, 528 insertions(+), 498 deletions(-) create mode 100644 metricbeat/docs/modules/stan/subscriptions.asciidoc diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 3e0b8cd0530b..3641359c6904 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -62,8 +62,8 @@ grouped in the following categories: * <> * <> * <> -* <> * <> +* <> * <> * <> * <> @@ -24819,7 +24819,7 @@ type: long *`mysql.status.handler.read.last`*:: + -- -The number of requests to read the last key in an index. +The number of requests to read the last key in an index. type: long @@ -24849,7 +24849,7 @@ type: long *`mysql.status.handler.read.rnd`*:: + -- -The number of requests to read a row based on a fixed position. +The number of requests to read a row based on a fixed position. type: long @@ -24859,7 +24859,7 @@ type: long *`mysql.status.handler.read.rnd_next`*:: + -- -The number of requests to read the next row in the data file. +The number of requests to read the next row in the data file. type: long @@ -24957,7 +24957,7 @@ type: long *`mysql.status.innodb.buffer_pool.bytes.data`*:: + -- -The total number of bytes in the InnoDB buffer pool containing data. +The total number of bytes in the InnoDB buffer pool containing data. type: long @@ -28215,7 +28215,7 @@ format: bytes *`redis.info.memory.used.lua`*:: + -- -Used memory by the Lua engine. +Used memory by the Lua engine. type: long @@ -28227,7 +28227,7 @@ format: bytes *`redis.info.memory.used.dataset`*:: + -- -The size in bytes of the dataset +The size in bytes of the dataset type: long @@ -28472,7 +28472,7 @@ 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 +The size in bytes of copy-on-write allocations during the last RBD save operation type: long @@ -28601,7 +28601,7 @@ format: bytes *`redis.info.persistence.aof.size.current`*:: + -- -AOF current file size +AOF current file size type: long @@ -28707,7 +28707,7 @@ format: bytes *`redis.info.replication.backlog.first_byte_offset`*:: + -- -The master offset of the replication backlog buffer +The master offset of the replication backlog buffer type: long @@ -29342,6 +29342,261 @@ type: long -- +[[exported-fields-stan]] +== Stan fields + +stan Module + + + +[float] +=== stan + +`stan` contains statistics that were read from Nats Streaming server (STAN) + + + +*`stan.server.id`*:: ++ +-- +The server ID + + +type: keyword + +-- + +*`stan.server.time`*:: ++ +-- +Server time of metric creation + + +type: date + +-- + +[float] +=== channels + +Contains stan / nats streaming/serverz endpoint metrics + + + +*`stan.channels.name`*:: ++ +-- +The name of the STAN streaming channel + + +type: keyword + +-- + +*`stan.channels.msgs`*:: ++ +-- +The number of STAN streaming messages + + +type: long + +-- + +*`stan.channels.bytes`*:: ++ +-- +The number of STAN bytes in the channel + + +type: long + +-- + +*`stan.channels.first_seq`*:: ++ +-- +First sequence number stored in the channel + + +type: long + +-- + +*`stan.channels.last_seq`*:: ++ +-- +Last sequence number stored in the channel + + +type: long + +-- + +*`stan.channels.depth`*:: ++ +-- +Queue depth based upon current sequence number and highest reported subscriber sequence number + + +type: long + +-- + +[float] +=== stats + +Contains only high-level stan / nats streaming server related metrics + + + +*`stan.stats.state`*:: ++ +-- +The cluster / streaming configuration state (STANDALONE, CLUSTERED) + + +type: keyword + +-- + +*`stan.stats.role`*:: ++ +-- +If clustered, role of this node in the cluster (Leader, Follower, Candidate) + + +type: keyword + +-- + +*`stan.stats.clients`*:: ++ +-- +The number of STAN clients + + +type: integer + +-- + +*`stan.stats.subscriptions`*:: ++ +-- +The number of STAN streaming subscriptions + + +type: integer + +-- + +*`stan.stats.channels`*:: ++ +-- +The number of STAN channels + + +type: integer + +-- + +*`stan.stats.messages`*:: ++ +-- +Number of messages across all STAN queues + + +type: long + +-- + +*`stan.stats.bytes`*:: ++ +-- +Number of bytes consumed across all STAN queues + + +type: long + +-- + +[float] +=== subscriptions + +Contains stan / nats streaming/serverz endpoint subscription metrics + + + +*`stan.subscriptions.id`*:: ++ +-- +The name of the STAN channel subscription (client_id) + + +type: keyword + +-- + +*`stan.subscriptions.channel`*:: ++ +-- +The name of the STAN channel the subscription is associated with + + +type: keyword + +-- + +*`stan.subscriptions.queue`*:: ++ +-- +The name of the NATS queue that the STAN channel subscription is associated with, if any + + +type: keyword + +-- + +*`stan.subscriptions.last_sent`*:: ++ +-- +Last known sequence number of the subscription that was acked + + +type: long + +-- + +*`stan.subscriptions.pending`*:: ++ +-- +Number of pending messages from / to the subscriber + + +type: long + +-- + +*`stan.subscriptions.offline`*:: ++ +-- +Is the subscriber marked as offline? + + +type: boolean + +-- + +*`stan.subscriptions.stalled`*:: ++ +-- +Is the subscriber known to be stalled? + + +type: boolean + +-- + [[exported-fields-statsd]] == Statsd fields @@ -30006,270 +30261,6 @@ type: float + -- The number of write requests merged per second that were queued to the device. -======= -[[exported-fields-stan]] -== Stan fields - -stan Module - - - -[float] -== stan fields - -`stan` contains statistics that were read from Nats Streaming server (STAN) - - - -*`stan.server.id`*:: -+ --- -type: keyword - -The server ID - - --- - -*`stan.server.time`*:: -+ --- -type: date - -Server time of metric creation - - --- - -[float] -== channels fields - -Contains stan / nats streaming/serverz endpoint metrics - - - -*`stan.channels.name`*:: -+ --- -type: keyword - -The name of the STAN streaming channel - - --- - -*`stan.channels.msgs`*:: -+ --- -type: long - -The number of STAN streaming messages - - --- - -*`stan.channels.bytes`*:: -+ --- -type: long - -The number of STAN bytes in the channel - - --- - -*`stan.channels.first_seq`*:: -+ --- -type: long - -First sequence number stored in the channel - - --- - -*`stan.channels.last_seq`*:: -+ --- -type: long - -Last sequence number stored in the channel - - --- - -*`stan.channels.depth`*:: -+ --- -type: long - -Queue depth based upon current sequence number and highest reported subscriber sequence number - - --- - -[float] -== stats fields - -Contains only high-level stan / nats streaming server related metrics - - - -*`stan.stats.state`*:: -+ --- -type: keyword - -The cluster / streaming configuration state (STANDALONE, CLUSTERED) - - --- - -*`stan.stats.role`*:: -+ --- -type: keyword - -If clustered, role of this node in the cluster (Leader, Follower, Candidate) - - --- - -*`stan.stats.clients`*:: -+ --- -type: integer - -The number of STAN clients - - --- - -*`stan.stats.subscriptions`*:: -+ --- -type: integer - -The number of STAN streaming subscriptions - - --- - -*`stan.stats.channels`*:: -+ --- -type: integer - -The number of STAN channels - - --- - -*`stan.stats.messages`*:: -+ --- -type: long - -Number of messages across all STAN queues - - --- - -*`stan.stats.bytes`*:: -+ --- -type: long - -Number of bytes consumed across all STAN queues - - --- - -[float] -== subscriptions fields - -Contains stan / nats streaming/serverz endpoint subscription metrics - - - -*`stan.subscriptions.id`*:: -+ --- -type: keyword - -The name of the STAN channel subscription (client_id) - - --- - -*`stan.subscriptions.channel`*:: -+ --- -type: keyword - -The name of the STAN channel the subscription is associated with - - --- - -*`stan.subscriptions.queue`*:: -+ --- -type: keyword - -The name of the NATS queue that the STAN channel subscription is associated with, if any - - --- - -*`stan.subscriptions.last_sent`*:: -+ --- -type: long - -Last known sequence number of the subscription that was acked - - --- - -*`stan.subscriptions.pending`*:: -+ --- -type: long - -Number of pending messages from / to the subscriber - - --- - -*`stan.subscriptions.offline`*:: -+ --- -type: boolean - -Is the subscriber marked as offline? - - --- - -*`stan.subscriptions.stalled`*:: -+ --- -type: boolean - -Is the subscriber known to be stalled? - - --- - -[[exported-fields-system]] -== System fields - -System status metrics, like CPU and memory usage, that are collected from the operating system. - - - -[float] type: float @@ -32107,7 +32098,7 @@ type: keyword *`system.raid.sync_action`*:: + -- -Current sync action, if the RAID array is redundant +Current sync action, if the RAID array is redundant type: keyword @@ -32530,7 +32521,7 @@ All TCP connections *`system.socket.summary.tcp.memory`*:: + -- -Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. +Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. type: integer @@ -32676,7 +32667,7 @@ All UDP connections *`system.socket.summary.udp.memory`*:: + -- -Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. +Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. type: integer diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index 7ecd9b095aed..31fe4bc02964 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -1,5 +1,5 @@ //// -This file is generated! See scripts/docs_collector.py +This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-module-stan]] diff --git a/metricbeat/docs/modules/stan/channels.asciidoc b/metricbeat/docs/modules/stan/channels.asciidoc index 1f0995970a13..1ad352ad66ba 100644 --- a/metricbeat/docs/modules/stan/channels.asciidoc +++ b/metricbeat/docs/modules/stan/channels.asciidoc @@ -1,5 +1,5 @@ //// -This file is generated! See scripts/docs_collector.py +This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-metricset-stan-channels]] @@ -9,6 +9,7 @@ beta[] include::../../../module/stan/channels/_meta/docs.asciidoc[] +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields diff --git a/metricbeat/docs/modules/stan/stats.asciidoc b/metricbeat/docs/modules/stan/stats.asciidoc index d3322a7e0949..5baa3d321b48 100644 --- a/metricbeat/docs/modules/stan/stats.asciidoc +++ b/metricbeat/docs/modules/stan/stats.asciidoc @@ -1,5 +1,5 @@ //// -This file is generated! See scripts/docs_collector.py +This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-metricset-stan-stats]] @@ -9,6 +9,7 @@ beta[] include::../../../module/stan/stats/_meta/docs.asciidoc[] +This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields diff --git a/metricbeat/docs/modules/stan/subscriptions.asciidoc b/metricbeat/docs/modules/stan/subscriptions.asciidoc new file mode 100644 index 000000000000..c8de2e2a0e56 --- /dev/null +++ b/metricbeat/docs/modules/stan/subscriptions.asciidoc @@ -0,0 +1,18 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-stan-subscriptions]] +=== Stan subscriptions metricset + +beta[] + +include::../../../module/stan/subscriptions/_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. + diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 1c489a149bcf..84623d77ef19 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -4,218 +4,218 @@ This file is generated! See scripts/mage/docs_collector.go [options="header"] |=== -|Modules |Dashboards |Metricsets -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.8+| .8+| |<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.7+| .7+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.9+| .9+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.11+| .11+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> -|<> beta[] -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> beta[] -|<> beta[] -|<> -|<> -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.18+| .18+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.5+| .5+| |<> -|<> -|<> -|<> -|<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.2+| .2+| |<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> -|<> -|<> -|<> -|<> |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] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.16+| .16+| |<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> -|<> beta[] -|<> -|<> -|<> -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.4+| .4+| |<> beta[] -|<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.1+| .1+| |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> beta[] -|<> beta[] -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.2+| .2+| |<> beta[] -|<> -|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.3+| .3+| |<> beta[] -|<> -|<> +|Modules |Dashboards |Metricsets +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.8+| .8+| |<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.7+| .7+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.9+| .9+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.11+| .11+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> +|<> beta[] +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> beta[] +|<> beta[] +|<> +|<> +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.18+| .18+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.5+| .5+| |<> +|<> +|<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.2+| .2+| |<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.4+| .4+| |<> +|<> +|<> +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> +|<> +|<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.16+| .16+| |<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> +|<> beta[] +|<> +|<> +|<> +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.4+| .4+| |<> beta[] +|<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.1+| .1+| |<> +|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> beta[] +|<> beta[] +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.2+| .2+| |<> beta[] +|<> +|<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | +.3+| .3+| |<> beta[] +|<> +|<> |=== -- @@ -261,8 +261,8 @@ include::modules/postgresql.asciidoc[] include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] -include::modules/statsd.asciidoc[] include::modules/stan.asciidoc[] +include::modules/statsd.asciidoc[] include::modules/system.asciidoc[] include::modules/tomcat.asciidoc[] include::modules/traefik.asciidoc[] diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 76d467cf8152..55e287408b2e 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -744,7 +744,7 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared -#-------------------------------- Stan Module -------------------------------- +#--------------------------------- Stan Module --------------------------------- - module: stan metricsets: ["stats", "channels", "subscriptions"] period: 60s @@ -753,7 +753,7 @@ metricbeat.modules: #channels.metrics_path: "/streaming/channelsz" #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint -#------------------------------- traefik Module ------------------------------ +#------------------------------- Traefik Module ------------------------------- - module: traefik metricsets: ["health"] period: 10s diff --git a/metricbeat/module/stan/channels/channels_test.go b/metricbeat/module/stan/channels/channels_test.go index ae856643c608..048515c542b8 100644 --- a/metricbeat/module/stan/channels/channels_test.go +++ b/metricbeat/module/stan/channels/channels_test.go @@ -24,8 +24,9 @@ import ( "path/filepath" "testing" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" "github.com/stretchr/testify/assert" + + mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) func TestEventMapping(t *testing.T) { diff --git a/metricbeat/module/stan/subscriptions/subscriptions_test.go b/metricbeat/module/stan/subscriptions/subscriptions_test.go index dc651d0f388a..e333dc2d157d 100644 --- a/metricbeat/module/stan/subscriptions/subscriptions_test.go +++ b/metricbeat/module/stan/subscriptions/subscriptions_test.go @@ -1,3 +1,20 @@ +// 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. + package subscriptions import ( @@ -7,8 +24,9 @@ import ( "path/filepath" "testing" - mbtest "github.com/elastic/beats/metricbeat/mb/testing" "github.com/stretchr/testify/assert" + + mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) func TestEventMapping(t *testing.T) { diff --git a/metricbeat/modules.d/stan.yml.disabled b/metricbeat/modules.d/stan.yml.disabled index 83b84a46d58e..da68714b0355 100644 --- a/metricbeat/modules.d/stan.yml.disabled +++ b/metricbeat/modules.d/stan.yml.disabled @@ -1,5 +1,5 @@ # Module: stan -# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.2/metricbeat-module-stan.html +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-stan.html - module: stan metricsets: ["stats", "subscriptions", "channels"] From febbd041e4b5dbd53effd75e705d85ae2b21da7f Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 28 Nov 2019 13:52:17 +0200 Subject: [PATCH 05/34] Add comments on exported structs Signed-off-by: chrismark --- metricbeat/module/stan/channels/data.go | 4 ++++ metricbeat/module/stan/subscriptions/data.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/metricbeat/module/stan/channels/data.go b/metricbeat/module/stan/channels/data.go index 983544847cf6..86e2cc94651d 100644 --- a/metricbeat/module/stan/channels/data.go +++ b/metricbeat/module/stan/channels/data.go @@ -43,6 +43,7 @@ var channelSchema = s.Schema{ "depth": c.Int("depth", s.Optional), // aggregated by the module } +// Subscription stores subscription related information type Subscription struct { QueueName string `json:"queue_name"` IsDurable bool `json:"is_durable"` @@ -51,6 +52,8 @@ type Subscription struct { PendingCount int64 `json:"pending_count"` LastSent int64 `json:"last_sent"` } + +// Channel stores channel related information type Channel struct { Name string `json:"name"` Msgs int64 `json:"msgs"` @@ -60,6 +63,7 @@ type Channel struct { Subscriptions []Subscription `json:"subscriptions,omitempty"` } +// Channels stores channels related information type Channels struct { ClusterID string `json:"cluster_id"` ServerID string `json:"server_id"` diff --git a/metricbeat/module/stan/subscriptions/data.go b/metricbeat/module/stan/subscriptions/data.go index f1e090b7afe7..7cdfb9443509 100644 --- a/metricbeat/module/stan/subscriptions/data.go +++ b/metricbeat/module/stan/subscriptions/data.go @@ -54,6 +54,7 @@ func eventMapping(content map[string]interface{}) (mb.Event, error) { return event, nil } +// Subscription stores subscription related information type Subscription struct { QueueName string `json:"queue_name"` IsDurable bool `json:"is_durable"` @@ -62,6 +63,8 @@ type Subscription struct { PendingCount int64 `json:"pending_count"` LastSent int64 `json:"last_sent"` } + +// Channel stores channel related information type Channel struct { Name string `json:"name"` Msgs int64 `json:"msgs"` @@ -71,6 +74,7 @@ type Channel struct { Subscriptions []map[string]interface{} `json:"subscriptions,omitempty"` } +// Channels stores channels related information type Channels struct { ClusterID string `json:"cluster_id"` Limit uint64 `json:"limit"` From 79743d4fa6bd1f9f196dfc7ae729f12a5c88bf98 Mon Sep 17 00:00:00 2001 From: chrismark Date: Mon, 2 Dec 2019 17:17:22 +0200 Subject: [PATCH 06/34] Fix dahsboard Signed-off-by: chrismark --- .../7/dashboard/Metricbeat-stan-overview.json | 42 +++++++++---------- metricbeat/module/stan/module.yml | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json b/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json index e02b36b6ffca..248091a9e9f5 100644 --- a/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json +++ b/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json @@ -142,7 +142,7 @@ } } }, - "title": "Current Memory Usage [Metricbeat NATS] ECS", + "title": "Current Memory Usage [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -186,7 +186,7 @@ }, "type": "metric" }, - "title": "Current Memory Usage [Metricbeat NATS] ECS", + "title": "Current Memory Usage [Metricbeat STAN] ECS", "type": "metric" } }, @@ -208,7 +208,7 @@ } } }, - "title": "Server Uptime [Metricbeat NATS] ECS", + "title": "Server Uptime [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -507,7 +507,7 @@ } ] }, - "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat NATS] ECS", + "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat STAN] ECS", "type": "area" } }, @@ -529,7 +529,7 @@ } } }, - "title": "Subscription Stats Timeline [Metricbeat NATS] ECS", + "title": "Subscription Stats Timeline [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -714,7 +714,7 @@ } ] }, - "title": "Subscription Stats Timeline [Metricbeat NATS] ECS", + "title": "Subscription Stats Timeline [Metricbeat STAN] ECS", "type": "line" } }, @@ -736,7 +736,7 @@ } } }, - "title": "Slow Consumers Timeline [Metricbeat NATS] ECS", + "title": "Slow Consumers Timeline [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -833,7 +833,7 @@ } ] }, - "title": "Slow Consumers Timeline [Metricbeat NATS] ECS", + "title": "Slow Consumers Timeline [Metricbeat STAN] ECS", "type": "line" } }, @@ -855,7 +855,7 @@ } } }, - "title": "IO Bytes Stats [Metricbeat NATS] ECS", + "title": "IO Bytes Stats [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -974,7 +974,7 @@ } ] }, - "title": "IO Bytes Stats [Metricbeat NATS] ECS", + "title": "IO Bytes Stats [Metricbeat STAN] ECS", "type": "line" } }, @@ -996,7 +996,7 @@ } } }, - "title": "Memory Utilization Timeline [Metricbeat NATS] ECS", + "title": "Memory Utilization Timeline [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -1093,7 +1093,7 @@ } ] }, - "title": "Memory Utilization Timeline [Metricbeat NATS] ECS", + "title": "Memory Utilization Timeline [Metricbeat STAN] ECS", "type": "line" } }, @@ -1115,7 +1115,7 @@ } } }, - "title": "IO Messages Stats [Metricbeat NATS] ECS", + "title": "IO Messages Stats [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -1234,7 +1234,7 @@ } ] }, - "title": "IO Messages Stats [Metricbeat NATS] ECS", + "title": "IO Messages Stats [Metricbeat STAN] ECS", "type": "line" } }, @@ -1256,7 +1256,7 @@ } } }, - "title": "CPU Utilization Timeline [Metricbeat NATS] ECS", + "title": "CPU Utilization Timeline [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -1353,7 +1353,7 @@ } ] }, - "title": "CPU Utilization Timeline [Metricbeat NATS] ECS", + "title": "CPU Utilization Timeline [Metricbeat STAN] ECS", "type": "line" } }, @@ -1375,7 +1375,7 @@ } } }, - "title": "Cache Hit Rate Timeline [Metricbeat NATS] ECS", + "title": "Cache Hit Rate Timeline [Metricbeat STAN] ECS", "uiStateJSON": {}, "version": 1, "visState": { @@ -1472,7 +1472,7 @@ } ] }, - "title": "Cache Hit Rate Timeline [Metricbeat NATS] ECS", + "title": "Cache Hit Rate Timeline [Metricbeat STAN] ECS", "type": "line" } }, @@ -1483,7 +1483,7 @@ }, { "attributes": { - "description": "Overview of NATS server status", + "description": "Overview of STAN server status", "hits": 0, "kibanaSavedObjectMeta": { "searchSourceJSON": { @@ -1676,10 +1676,10 @@ } ], "timeRestore": false, - "title": "[Metricbeat NATS] Overview ECS", + "title": "[Metricbeat STAN] Overview ECS", "version": 1 }, - "id": "Metricbeat-Nats-Dashboard-ecs", + "id": "Metricbeat-STAN-Dashboard-ecs", "type": "dashboard", "updated_at": "2019-01-24T08:13:29.732Z", "version": 4 diff --git a/metricbeat/module/stan/module.yml b/metricbeat/module/stan/module.yml index 0caa73538c9e..4a73fd825280 100644 --- a/metricbeat/module/stan/module.yml +++ b/metricbeat/module/stan/module.yml @@ -1,3 +1,3 @@ dashboards: - - id: Metricbeat-Stan-Dashboard + - id: Metricbeat-STAN-Dashboard file: Metricbeat-stan-overview.json From 60509835b14f3ec4cdf68367a837814cecbc2c1a Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 09:44:26 +0200 Subject: [PATCH 07/34] Move STAN to x-pack Signed-off-by: chrismark --- metricbeat/docs/modules/stan.asciidoc | 1 + .../docs/modules/stan/channels.asciidoc | 4 ++-- metricbeat/docs/modules/stan/stats.asciidoc | 4 ++-- .../docs/modules/stan/subscriptions.asciidoc | 2 +- metricbeat/include/list_common.go | 4 ---- metricbeat/metricbeat.reference.yml | 9 -------- metricbeat/module/stan/doc.go | 21 ------------------- x-pack/metricbeat/include/list.go | 4 ++++ x-pack/metricbeat/metricbeat.reference.yml | 9 ++++++++ .../metricbeat}/module/stan/_meta/Dockerfile | 0 .../module/stan/_meta/config.reference.yml | 0 .../metricbeat}/module/stan/_meta/config.yml | 0 .../module/stan/_meta/docs.asciidoc | 0 .../metricbeat}/module/stan/_meta/fields.yml | 0 .../7/dashboard/Metricbeat-stan-overview.json | 0 .../module/stan/channels/_meta/data.json | 0 .../module/stan/channels/_meta/docs.asciidoc | 0 .../module/stan/channels/_meta/fields.yml | 0 .../stan/channels/_meta/test/channels.json | 0 .../module/stan/channels/channels.go | 21 ++++--------------- .../module/stan/channels/channels_test.go | 19 +++-------------- .../metricbeat}/module/stan/channels/data.go | 19 +++-------------- x-pack/metricbeat/module/stan/doc.go | 5 +++++ .../metricbeat}/module/stan/fields.go | 21 ++++--------------- .../metricbeat}/module/stan/module.yml | 0 .../module/stan/stats/_meta/data.json | 0 .../module/stan/stats/_meta/docs.asciidoc | 0 .../module/stan/stats/_meta/fields.yml | 0 .../stan/stats/_meta/test/serversz.json | 0 .../metricbeat}/module/stan/stats/data.go | 19 +++-------------- .../module/stan/stats/docs.asciidoc | 0 .../metricbeat}/module/stan/stats/stats.go | 19 +++-------------- .../module/stan/stats/stats_test.go | 19 +++-------------- .../stan/subscriptions/_meta/docs.asciidoc | 0 .../stan/subscriptions/_meta/fields.yml | 0 .../_meta/test/subscriptions.json | 0 .../module/stan/subscriptions/data.go | 19 +++-------------- .../stan/subscriptions/subscriptions.go | 21 ++++--------------- .../stan/subscriptions/subscriptions_test.go | 19 +++-------------- .../metricbeat}/modules.d/stan.yml.disabled | 0 40 files changed, 57 insertions(+), 202 deletions(-) delete mode 100644 metricbeat/module/stan/doc.go rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/Dockerfile (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/config.reference.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/config.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/docs.asciidoc (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/fields.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/_meta/data.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/_meta/docs.asciidoc (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/_meta/fields.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/_meta/test/channels.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/channels.go (70%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/channels_test.go (73%) rename {metricbeat => x-pack/metricbeat}/module/stan/channels/data.go (80%) create mode 100644 x-pack/metricbeat/module/stan/doc.go rename {metricbeat => x-pack/metricbeat}/module/stan/fields.go (62%) rename {metricbeat => x-pack/metricbeat}/module/stan/module.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/_meta/data.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/_meta/docs.asciidoc (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/_meta/fields.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/_meta/test/serversz.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/data.go (62%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/docs.asciidoc (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/stats.go (70%) rename {metricbeat => x-pack/metricbeat}/module/stan/stats/stats_test.go (63%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/_meta/docs.asciidoc (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/_meta/fields.yml (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/_meta/test/subscriptions.json (100%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/data.go (77%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/subscriptions.go (70%) rename {metricbeat => x-pack/metricbeat}/module/stan/subscriptions/subscriptions_test.go (64%) rename {metricbeat => x-pack/metricbeat}/modules.d/stan.yml.disabled (100%) diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index 31fe4bc02964..a9091bd40441 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -3,6 +3,7 @@ This file is generated! See scripts/mage/docs_collector.go //// [[metricbeat-module-stan]] +[role="xpack"] == Stan module beta[] diff --git a/metricbeat/docs/modules/stan/channels.asciidoc b/metricbeat/docs/modules/stan/channels.asciidoc index 1ad352ad66ba..797657f6c5e2 100644 --- a/metricbeat/docs/modules/stan/channels.asciidoc +++ b/metricbeat/docs/modules/stan/channels.asciidoc @@ -7,7 +7,7 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -include::../../../module/stan/channels/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/stan/channels/_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/stan/channels/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/stan/channels/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/stan/stats.asciidoc b/metricbeat/docs/modules/stan/stats.asciidoc index 5baa3d321b48..1248d49c165a 100644 --- a/metricbeat/docs/modules/stan/stats.asciidoc +++ b/metricbeat/docs/modules/stan/stats.asciidoc @@ -7,7 +7,7 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -include::../../../module/stan/stats/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/stan/stats/_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/stan/stats/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/stan/stats/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules/stan/subscriptions.asciidoc b/metricbeat/docs/modules/stan/subscriptions.asciidoc index c8de2e2a0e56..1032335d71ef 100644 --- a/metricbeat/docs/modules/stan/subscriptions.asciidoc +++ b/metricbeat/docs/modules/stan/subscriptions.asciidoc @@ -7,7 +7,7 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -include::../../../module/stan/subscriptions/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc[] This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. diff --git a/metricbeat/include/list_common.go b/metricbeat/include/list_common.go index 1d6fab2ea93d..26db25d57441 100644 --- a/metricbeat/include/list_common.go +++ b/metricbeat/include/list_common.go @@ -128,10 +128,6 @@ import ( _ "github.com/elastic/beats/metricbeat/module/redis/info" _ "github.com/elastic/beats/metricbeat/module/redis/key" _ "github.com/elastic/beats/metricbeat/module/redis/keyspace" - _ "github.com/elastic/beats/metricbeat/module/stan" - _ "github.com/elastic/beats/metricbeat/module/stan/channels" - _ "github.com/elastic/beats/metricbeat/module/stan/stats" - _ "github.com/elastic/beats/metricbeat/module/stan/subscriptions" _ "github.com/elastic/beats/metricbeat/module/system" _ "github.com/elastic/beats/metricbeat/module/system/core" _ "github.com/elastic/beats/metricbeat/module/system/cpu" diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 55e287408b2e..0577bdfbcaa8 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -744,15 +744,6 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared -#--------------------------------- Stan Module --------------------------------- -- module: stan - metricsets: ["stats", "channels", "subscriptions"] - period: 60s - hosts: ["localhost:8222"] - #stats.metrics_path: "/streaming/serverz" - #channels.metrics_path: "/streaming/channelsz" - #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint - #------------------------------- Traefik Module ------------------------------- - module: traefik metricsets: ["health"] diff --git a/metricbeat/module/stan/doc.go b/metricbeat/module/stan/doc.go deleted file mode 100644 index 858931666636..000000000000 --- a/metricbeat/module/stan/doc.go +++ /dev/null @@ -1,21 +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. - -/* -Package stan is a Metricbeat module that contains MetricSets. -*/ -package stan diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index e43ebca5947d..96aced8f9188 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -31,6 +31,10 @@ 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/stan" + _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/channels" + _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/stats" + _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/subscriptions" _ "github.com/elastic/beats/x-pack/metricbeat/module/statsd" _ "github.com/elastic/beats/x-pack/metricbeat/module/statsd/server" _ "github.com/elastic/beats/x-pack/metricbeat/module/tomcat" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 9fa987775d00..a7eb473d3401 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -905,6 +905,15 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared +#--------------------------------- Stan Module --------------------------------- +- module: stan + metricsets: ["stats", "channels", "subscriptions"] + period: 60s + hosts: ["localhost:8222"] + #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint + #-------------------------------- Statsd Module -------------------------------- - module: statsd host: "localhost" diff --git a/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile similarity index 100% rename from metricbeat/module/stan/_meta/Dockerfile rename to x-pack/metricbeat/module/stan/_meta/Dockerfile diff --git a/metricbeat/module/stan/_meta/config.reference.yml b/x-pack/metricbeat/module/stan/_meta/config.reference.yml similarity index 100% rename from metricbeat/module/stan/_meta/config.reference.yml rename to x-pack/metricbeat/module/stan/_meta/config.reference.yml diff --git a/metricbeat/module/stan/_meta/config.yml b/x-pack/metricbeat/module/stan/_meta/config.yml similarity index 100% rename from metricbeat/module/stan/_meta/config.yml rename to x-pack/metricbeat/module/stan/_meta/config.yml diff --git a/metricbeat/module/stan/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/_meta/docs.asciidoc similarity index 100% rename from metricbeat/module/stan/_meta/docs.asciidoc rename to x-pack/metricbeat/module/stan/_meta/docs.asciidoc diff --git a/metricbeat/module/stan/_meta/fields.yml b/x-pack/metricbeat/module/stan/_meta/fields.yml similarity index 100% rename from metricbeat/module/stan/_meta/fields.yml rename to x-pack/metricbeat/module/stan/_meta/fields.yml diff --git a/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json b/x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json similarity index 100% rename from metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json rename to x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json diff --git a/metricbeat/module/stan/channels/_meta/data.json b/x-pack/metricbeat/module/stan/channels/_meta/data.json similarity index 100% rename from metricbeat/module/stan/channels/_meta/data.json rename to x-pack/metricbeat/module/stan/channels/_meta/data.json diff --git a/metricbeat/module/stan/channels/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/channels/_meta/docs.asciidoc similarity index 100% rename from metricbeat/module/stan/channels/_meta/docs.asciidoc rename to x-pack/metricbeat/module/stan/channels/_meta/docs.asciidoc diff --git a/metricbeat/module/stan/channels/_meta/fields.yml b/x-pack/metricbeat/module/stan/channels/_meta/fields.yml similarity index 100% rename from metricbeat/module/stan/channels/_meta/fields.yml rename to x-pack/metricbeat/module/stan/channels/_meta/fields.yml diff --git a/metricbeat/module/stan/channels/_meta/test/channels.json b/x-pack/metricbeat/module/stan/channels/_meta/test/channels.json similarity index 100% rename from metricbeat/module/stan/channels/_meta/test/channels.json rename to x-pack/metricbeat/module/stan/channels/_meta/test/channels.json diff --git a/metricbeat/module/stan/channels/channels.go b/x-pack/metricbeat/module/stan/channels/channels.go similarity index 70% rename from metricbeat/module/stan/channels/channels.go rename to x-pack/metricbeat/module/stan/channels/channels.go index 6a8c31f31351..3424de7344a6 100644 --- a/metricbeat/module/stan/channels/channels.go +++ b/x-pack/metricbeat/module/stan/channels/channels.go @@ -1,19 +1,6 @@ -// 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. +// 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. package channels @@ -25,7 +12,7 @@ import ( "github.com/elastic/beats/metricbeat/mb" "github.com/elastic/beats/metricbeat/mb/parse" - "github.com/elastic/beats/metricbeat/module/stan" + "github.com/elastic/beats/x-pack/metricbeat/module/stan" ) const ( diff --git a/metricbeat/module/stan/channels/channels_test.go b/x-pack/metricbeat/module/stan/channels/channels_test.go similarity index 73% rename from metricbeat/module/stan/channels/channels_test.go rename to x-pack/metricbeat/module/stan/channels/channels_test.go index 048515c542b8..7c1804230dde 100644 --- a/metricbeat/module/stan/channels/channels_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_test.go @@ -1,19 +1,6 @@ -// 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. +// 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. package channels diff --git a/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go similarity index 80% rename from metricbeat/module/stan/channels/data.go rename to x-pack/metricbeat/module/stan/channels/data.go index 86e2cc94651d..e693611a8268 100644 --- a/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -1,19 +1,6 @@ -// 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. +// 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. package channels diff --git a/x-pack/metricbeat/module/stan/doc.go b/x-pack/metricbeat/module/stan/doc.go new file mode 100644 index 000000000000..23e599b1111f --- /dev/null +++ b/x-pack/metricbeat/module/stan/doc.go @@ -0,0 +1,5 @@ +// 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. + +package stan diff --git a/metricbeat/module/stan/fields.go b/x-pack/metricbeat/module/stan/fields.go similarity index 62% rename from metricbeat/module/stan/fields.go rename to x-pack/metricbeat/module/stan/fields.go index 075eb4762abb..a3a1e170c1d2 100644 --- a/metricbeat/module/stan/fields.go +++ b/x-pack/metricbeat/module/stan/fields.go @@ -1,19 +1,6 @@ -// 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. +// 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. @@ -30,7 +17,7 @@ func init() { } // AssetStan returns asset data. -// This is the base64 encoded gzipped contents of ../metricbeat/module/stan. +// This is the base64 encoded gzipped contents of module/stan. func AssetStan() string { return "eJy8l0tv20YQx+/6FIP0YgN2fdchhWE7gAFVRSv1VBTJkjskF1rO0jvDCOqnL5YvU3wkbkyVB0Og6Pn/5qH/LG/hgKc1sChaAYgRi2v4sBNFH1YAGjn2phDjaA0fVwBQPQm/Ol1aXAF4tKgY1xChqBVAYtBqXldP3gKpHLvY4ZJTgWtIvSuL5s6EQri+hH/6ArEjUYY4xBDDYmIGyZTAET2CR6Uh8S6HrRKGnXhUuaEUGP1X9HC1299vr5uYfbIzuurZn43uvmkxD3g6Ot+/PwMbrn2Grezz45yImBxHMloJvk1jV8cPUcAlkKN4E0PsUYWnR6JxpojQ8kixX//vSD70GkBwBxQKzW2h7+q8/gEkXThD0jD1JYcT0l7DfvTJw9+zL+Zb8h3+tjUhYqiZZAhhKl5zaMs0CZJzypMg1lH6AxRlHqEPHAOGHJlVijwJEZ0EL0hRhQdDVW2GxfgJnhNIjGf5zPgCHyE3dPVX+GgIuIw6Mf77OkyyAuuYIVMMhWM2kT2Bi+PSe9STyXWxF0rwU4gHjC8lUtzlyuI86rkk+zxWLYqzUe+i0VhIthDK7yWWWEeESDFqKAtHUPWGxpCKNGQmzZAFPBbOC+q241US58+PLU+ULGM9juypQrm1+BXttBW15uvRqkC6jBGFJBZ2otiWLOjhrm9BjhKTlr7y8Vq0Xl6P95vftk838LD5c7d/+uPp8XoS0zu7IOVz0kKivqli185pGMhp7Oa2SeRqg0qjv4FPzlp3DJ8eFGkT9to0bmwNkkxbmiHBtDdOb67rwNWmNLqu9n3rohS98ZzV/Ma6vkBZpkS6bTe1hX7ccLaddBsYVOzDelDW1jgvwZMuv/VeSeplFzviMkf9Fp6xsc108uJnq77wQv5mhtaw9DGrmbdz9qv6x/nZ6Bl/mNiIl0MLN87wDINidrGpFsnRDDZwS1nNyuUYt/f7Xa1Rv/F8u6Rj5hswCSg6/X9HueboRLLk2elA7kijw0lTo7MS1O+FKpjMYYawQNJmhPF+V2nivvpc9VJ6B+L6mNHAv1sqlyTW0PQoRc5ZVPQfFzgPZCFX/hDsjluxX+aOO9bitCcsRFL3UxxE2Mqds6z+DQAA//9DZYqL" } diff --git a/metricbeat/module/stan/module.yml b/x-pack/metricbeat/module/stan/module.yml similarity index 100% rename from metricbeat/module/stan/module.yml rename to x-pack/metricbeat/module/stan/module.yml diff --git a/metricbeat/module/stan/stats/_meta/data.json b/x-pack/metricbeat/module/stan/stats/_meta/data.json similarity index 100% rename from metricbeat/module/stan/stats/_meta/data.json rename to x-pack/metricbeat/module/stan/stats/_meta/data.json diff --git a/metricbeat/module/stan/stats/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/stats/_meta/docs.asciidoc similarity index 100% rename from metricbeat/module/stan/stats/_meta/docs.asciidoc rename to x-pack/metricbeat/module/stan/stats/_meta/docs.asciidoc diff --git a/metricbeat/module/stan/stats/_meta/fields.yml b/x-pack/metricbeat/module/stan/stats/_meta/fields.yml similarity index 100% rename from metricbeat/module/stan/stats/_meta/fields.yml rename to x-pack/metricbeat/module/stan/stats/_meta/fields.yml diff --git a/metricbeat/module/stan/stats/_meta/test/serversz.json b/x-pack/metricbeat/module/stan/stats/_meta/test/serversz.json similarity index 100% rename from metricbeat/module/stan/stats/_meta/test/serversz.json rename to x-pack/metricbeat/module/stan/stats/_meta/test/serversz.json diff --git a/metricbeat/module/stan/stats/data.go b/x-pack/metricbeat/module/stan/stats/data.go similarity index 62% rename from metricbeat/module/stan/stats/data.go rename to x-pack/metricbeat/module/stan/stats/data.go index a1cc099e0b8d..c3a9b4cbf388 100644 --- a/metricbeat/module/stan/stats/data.go +++ b/x-pack/metricbeat/module/stan/stats/data.go @@ -1,19 +1,6 @@ -// 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. +// 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. package streaming diff --git a/metricbeat/module/stan/stats/docs.asciidoc b/x-pack/metricbeat/module/stan/stats/docs.asciidoc similarity index 100% rename from metricbeat/module/stan/stats/docs.asciidoc rename to x-pack/metricbeat/module/stan/stats/docs.asciidoc diff --git a/metricbeat/module/stan/stats/stats.go b/x-pack/metricbeat/module/stan/stats/stats.go similarity index 70% rename from metricbeat/module/stan/stats/stats.go rename to x-pack/metricbeat/module/stan/stats/stats.go index c1b62b765b6c..7cd32ae40f29 100644 --- a/metricbeat/module/stan/stats/stats.go +++ b/x-pack/metricbeat/module/stan/stats/stats.go @@ -1,19 +1,6 @@ -// 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. +// 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. package streaming diff --git a/metricbeat/module/stan/stats/stats_test.go b/x-pack/metricbeat/module/stan/stats/stats_test.go similarity index 63% rename from metricbeat/module/stan/stats/stats_test.go rename to x-pack/metricbeat/module/stan/stats/stats_test.go index bebec698d8f0..97e6a3cabc0c 100644 --- a/metricbeat/module/stan/stats/stats_test.go +++ b/x-pack/metricbeat/module/stan/stats/stats_test.go @@ -1,19 +1,6 @@ -// 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. +// 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. package streaming diff --git a/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc similarity index 100% rename from metricbeat/module/stan/subscriptions/_meta/docs.asciidoc rename to x-pack/metricbeat/module/stan/subscriptions/_meta/docs.asciidoc diff --git a/metricbeat/module/stan/subscriptions/_meta/fields.yml b/x-pack/metricbeat/module/stan/subscriptions/_meta/fields.yml similarity index 100% rename from metricbeat/module/stan/subscriptions/_meta/fields.yml rename to x-pack/metricbeat/module/stan/subscriptions/_meta/fields.yml diff --git a/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json b/x-pack/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json similarity index 100% rename from metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json rename to x-pack/metricbeat/module/stan/subscriptions/_meta/test/subscriptions.json diff --git a/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go similarity index 77% rename from metricbeat/module/stan/subscriptions/data.go rename to x-pack/metricbeat/module/stan/subscriptions/data.go index 7cdfb9443509..1b0a33b993cd 100644 --- a/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -1,19 +1,6 @@ -// 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. +// 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. package subscriptions diff --git a/metricbeat/module/stan/subscriptions/subscriptions.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go similarity index 70% rename from metricbeat/module/stan/subscriptions/subscriptions.go rename to x-pack/metricbeat/module/stan/subscriptions/subscriptions.go index cb82cb4b66b2..36bf81e14080 100644 --- a/metricbeat/module/stan/subscriptions/subscriptions.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go @@ -1,19 +1,6 @@ -// 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. +// 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. package subscriptions @@ -25,7 +12,7 @@ import ( "github.com/elastic/beats/metricbeat/mb" "github.com/elastic/beats/metricbeat/mb/parse" - "github.com/elastic/beats/metricbeat/module/stan" + "github.com/elastic/beats/x-pack/metricbeat/module/stan" ) const ( diff --git a/metricbeat/module/stan/subscriptions/subscriptions_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go similarity index 64% rename from metricbeat/module/stan/subscriptions/subscriptions_test.go rename to x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go index e333dc2d157d..e88247d313f0 100644 --- a/metricbeat/module/stan/subscriptions/subscriptions_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go @@ -1,19 +1,6 @@ -// 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. +// 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. package subscriptions diff --git a/metricbeat/modules.d/stan.yml.disabled b/x-pack/metricbeat/modules.d/stan.yml.disabled similarity index 100% rename from metricbeat/modules.d/stan.yml.disabled rename to x-pack/metricbeat/modules.d/stan.yml.disabled From 8e58c92771566a883e15b73a1a939a9d788896b0 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 09:48:15 +0200 Subject: [PATCH 08/34] Fix docs Signed-off-by: chrismark --- metricbeat/docs/modules/stan.asciidoc | 10 +++++----- x-pack/metricbeat/module/stan/_meta/docs.asciidoc | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index a9091bd40441..0334da4e631d 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -8,22 +8,22 @@ This file is generated! See scripts/mage/docs_collector.go beta[] -This is the Nats module. The Nats module uses https://nats.io/documentation/managing_the_server/monitoring/[Nats monitoring server APIs] to collect metrics. +This is the STAN module. The STAN module uses https://github.com/nats-io/nats-streaming-server/blob/master/server/monitor.go[STAN monitoring server APIs] to collect metrics. -The default metricsets are `stats`, `connections`, `routes` and `subscriptions`. `streaming` was added by Endgame engineers +The default metricsets are `channels`, `stats` and `subscriptions`. [float] === Compatibility -The Nats module is tested with Nats 1.3.0. +The STAN module is tested with STAN 0.15.1. [float] === Dashboard -The Nats module comes with a predefined dashboard. For example: +The STAN module comes with a predefined dashboard. For example: -image::./images/metricbeat_nats_dashboard.png[] +image::./images/metricbeat_stan_dashboard.png[] [float] diff --git a/x-pack/metricbeat/module/stan/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/_meta/docs.asciidoc index 3dbc499bcc8e..1af2854de398 100644 --- a/x-pack/metricbeat/module/stan/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/stan/_meta/docs.asciidoc @@ -1,16 +1,16 @@ -This is the Nats module. The Nats module uses https://nats.io/documentation/managing_the_server/monitoring/[Nats monitoring server APIs] to collect metrics. +This is the STAN module. The STAN module uses https://github.com/nats-io/nats-streaming-server/blob/master/server/monitor.go[STAN monitoring server APIs] to collect metrics. -The default metricsets are `stats`, `connections`, `routes` and `subscriptions`. `streaming` was added by Endgame engineers +The default metricsets are `channels`, `stats` and `subscriptions`. [float] === Compatibility -The Nats module is tested with Nats 1.3.0. +The STAN module is tested with STAN 0.15.1. [float] === Dashboard -The Nats module comes with a predefined dashboard. For example: +The STAN module comes with a predefined dashboard. For example: -image::./images/metricbeat_nats_dashboard.png[] +image::./images/metricbeat_stan_dashboard.png[] From 698716991fb011df2aa2feff09413c75b3217b2b Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 12:49:46 +0200 Subject: [PATCH 09/34] Minor fixes Signed-off-by: chrismark --- .../module/stan/channels/channels_test.go | 21 +++++++++++------- .../metricbeat/module/stan/channels/data.go | 9 +------- x-pack/metricbeat/module/stan/stats/data.go | 4 +--- .../module/stan/stats/stats_test.go | 21 +++++++++++------- .../module/stan/subscriptions/data.go | 2 +- .../stan/subscriptions/subscriptions_test.go | 22 ++++++++++++------- 6 files changed, 43 insertions(+), 36 deletions(-) diff --git a/x-pack/metricbeat/module/stan/channels/channels_test.go b/x-pack/metricbeat/module/stan/channels/channels_test.go index 7c1804230dde..345eab9abe82 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_test.go @@ -52,14 +52,7 @@ func TestEventMapping(t *testing.T) { } func TestFetchEventContent(t *testing.T) { - absPath, _ := filepath.Abs("./_meta/test/") - - response, _ := ioutil.ReadFile(absPath + "/channels.json") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Header().Set("Content-Type", "application/json;") - w.Write([]byte(response)) - })) + server := initServer() defer server.Close() config := map[string]interface{}{ @@ -78,3 +71,15 @@ func TestFetchEventContent(t *testing.T) { } } + +func initServer() *httptest.Server { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/channels.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + return server +} diff --git a/x-pack/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go index e693611a8268..ad3bb6b94053 100644 --- a/x-pack/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -5,10 +5,6 @@ package channels import ( - - // "github.com/pkg/errors" - - // "github.com/elastic/beats/libbeat/common" "encoding/json" "github.com/pkg/errors" @@ -62,9 +58,6 @@ type Channels struct { // eventMapping map a channel to a Metricbeat event func eventMapping(content map[string]interface{}) (mb.Event, error) { fields, err := channelSchema.Apply(content) - if err != nil { - return mb.Event{}, err - } if err != nil { return mb.Event{}, errors.Wrap(err, "failure applying channels schema") } @@ -107,7 +100,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { r.Error(errors.Wrap(err, "failure to map channel to its schema")) } if !r.Event(evt) { - r.Error(errors.New("error emitting event")) + return nil } } diff --git a/x-pack/metricbeat/module/stan/stats/data.go b/x-pack/metricbeat/module/stan/stats/data.go index c3a9b4cbf388..89df76a233d1 100644 --- a/x-pack/metricbeat/module/stan/stats/data.go +++ b/x-pack/metricbeat/module/stan/stats/data.go @@ -46,9 +46,7 @@ func eventMapping(content []byte, r mb.ReporterV2) error { ModuleFields: moduleFields, } if !r.Event(event) { - err := errors.New("Failed to report event") - r.Error(err) - return err + return nil } return nil } diff --git a/x-pack/metricbeat/module/stan/stats/stats_test.go b/x-pack/metricbeat/module/stan/stats/stats_test.go index 97e6a3cabc0c..f1a534b6d0aa 100644 --- a/x-pack/metricbeat/module/stan/stats/stats_test.go +++ b/x-pack/metricbeat/module/stan/stats/stats_test.go @@ -28,14 +28,7 @@ func TestEventMapping(t *testing.T) { } func TestFetchEventContent(t *testing.T) { - absPath, _ := filepath.Abs("./_meta/test/") - - response, _ := ioutil.ReadFile(absPath + "/serversz.json") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Header().Set("Content-Type", "application/json;") - w.Write([]byte(response)) - })) + server := initServer() defer server.Close() config := map[string]interface{}{ @@ -52,3 +45,15 @@ func TestFetchEventContent(t *testing.T) { e := mbtest.StandardizeEvent(metricSet, events[0]) t.Logf("%s/%s event: %+v", metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) } + +func initServer() *httptest.Server { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/serversz.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + return server +} diff --git a/x-pack/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go index 1b0a33b993cd..3209afe35f42 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -87,7 +87,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { } if !r.Event(evt) { - r.Error(errors.New("Error emitting event")) + return nil } } } diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go index e88247d313f0..3b370f7be3b7 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go @@ -29,15 +29,9 @@ func TestEventMapping(t *testing.T) { errErrs := reporter.GetErrors() assert.Equal(t, len(errErrs), 0) } -func TestFetchEventContent(t *testing.T) { - absPath, _ := filepath.Abs("./_meta/test/") - response, _ := ioutil.ReadFile(absPath + "/subscriptions.json") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Header().Set("Content-Type", "application/json;") - w.Write([]byte(response)) - })) +func TestFetchEventContent(t *testing.T) { + server := initServer() defer server.Close() config := map[string]interface{}{ @@ -56,3 +50,15 @@ func TestFetchEventContent(t *testing.T) { } } + +func initServer() *httptest.Server { + absPath, _ := filepath.Abs("./_meta/test/") + + response, _ := ioutil.ReadFile(absPath + "/subscriptions.json") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Header().Set("Content-Type", "application/json;") + w.Write([]byte(response)) + })) + return server +} From bb1c6c3b21a919ae62a60bebe2460767793194a0 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 13:11:05 +0200 Subject: [PATCH 10/34] Add intgration tests Signed-off-by: chrismark --- x-pack/metricbeat/docker-compose.yml | 9 ++++ .../channels/channels_integration_test.go | 54 +++++++++++++++++++ .../stan/stats/stats_integration_test.go | 54 +++++++++++++++++++ .../subscriptions_integration_test.go | 54 +++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 x-pack/metricbeat/module/stan/channels/channels_integration_test.go create mode 100644 x-pack/metricbeat/module/stan/stats/stats_integration_test.go create mode 100644 x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go diff --git a/x-pack/metricbeat/docker-compose.yml b/x-pack/metricbeat/docker-compose.yml index 34d8ea5f6404..1454ba66fd90 100644 --- a/x-pack/metricbeat/docker-compose.yml +++ b/x-pack/metricbeat/docker-compose.yml @@ -79,3 +79,12 @@ services: MSSQL_VERSION: ${MSSQL_VERSION:-2017-GA} ports: - 1433 + + stan: + image: docker.elastic.co/observability-ci/beats-integration-stan:${STAN_VERSION:-0.15.1}-1 + build: + context: ./module/stan/_meta + args: + STAN_VERSION: ${STAN_VERSION:-0.15.1} + ports: + - 8222 diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go new file mode 100644 index 000000000000..66e7a7e95be2 --- /dev/null +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -0,0 +1,54 @@ +// 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 channels + +import ( + "testing" + + "github.com/elastic/beats/libbeat/tests/compose" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" +) + +func TestData(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + m.WriteEvents(t, "") +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := m.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", m.Module().Name(), m.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "stan", + "metricsets": []string{"channels"}, + "hosts": []string{host}, + } +} diff --git a/x-pack/metricbeat/module/stan/stats/stats_integration_test.go b/x-pack/metricbeat/module/stan/stats/stats_integration_test.go new file mode 100644 index 000000000000..f788d1a60243 --- /dev/null +++ b/x-pack/metricbeat/module/stan/stats/stats_integration_test.go @@ -0,0 +1,54 @@ +// 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 stats + +import ( + "testing" + + "github.com/elastic/beats/libbeat/tests/compose" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" +) + +func TestData(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + m.WriteEvents(t, "") +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := m.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", m.Module().Name(), m.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "stan", + "metricsets": []string{"stats"}, + "hosts": []string{host}, + } +} diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go new file mode 100644 index 000000000000..652209877868 --- /dev/null +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go @@ -0,0 +1,54 @@ +// 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 subscriptions + +import ( + "testing" + + "github.com/elastic/beats/libbeat/tests/compose" + mbtest "github.com/elastic/beats/metricbeat/mb/testing" +) + +func TestData(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + m.WriteEvents(t, "") +} + +func TestFetch(t *testing.T) { + service := compose.EnsureUp(t, "stan") + + m := mbtest.NewFetcher(t, getConfig(service.Host())) + events, errs := m.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", m.Module().Name(), m.Name(), events[0]) +} + +func getConfig(host string) map[string]interface{} { + return map[string]interface{}{ + "module": "stan", + "metricsets": []string{"subscriptions"}, + "hosts": []string{host}, + } +} From d6ce7e9c9ee35f059ab233701ea511679b37a602 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 13:25:21 +0200 Subject: [PATCH 11/34] add system tests Signed-off-by: chrismark --- x-pack/metricbeat/tests/system/test_stan.py | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 x-pack/metricbeat/tests/system/test_stan.py diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py new file mode 100644 index 000000000000..49a1f0eb874e --- /dev/null +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -0,0 +1,23 @@ +import os +import metricbeat +import unittest + +STAN_FIELDS = metricbeat.COMMON_FIELDS + ["stan"] + + +class TestNats(metricbeat.BaseTest): + + COMPOSE_SERVICES = ['stan'] + + + @parameterized.expand([ + "stats", + "channels", + "subscriptions", + ]) + @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") + def test_metricset(self, metricset): + """ + etcd metricset tests + """ + self.check_metricset("stan", metricset, self.get_hosts(), ['stan.' + metricset]) From f23c2c9ae6da5257e8e9f3a59fb38e0b2a936ade Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 14:02:41 +0200 Subject: [PATCH 12/34] fmt Signed-off-by: chrismark --- .../channels/channels_integration_test.go | 21 +++++-------------- .../stan/stats/stats_integration_test.go | 21 +++++-------------- .../subscriptions_integration_test.go | 21 +++++-------------- x-pack/metricbeat/tests/system/test_stan.py | 1 - 4 files changed, 15 insertions(+), 49 deletions(-) diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go index 66e7a7e95be2..ae2b8899690d 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -1,19 +1,6 @@ -// 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. +// 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 @@ -22,6 +9,8 @@ package channels import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/elastic/beats/libbeat/tests/compose" mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) diff --git a/x-pack/metricbeat/module/stan/stats/stats_integration_test.go b/x-pack/metricbeat/module/stan/stats/stats_integration_test.go index f788d1a60243..9a5a6cdc3792 100644 --- a/x-pack/metricbeat/module/stan/stats/stats_integration_test.go +++ b/x-pack/metricbeat/module/stan/stats/stats_integration_test.go @@ -1,19 +1,6 @@ -// 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. +// 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 @@ -22,6 +9,8 @@ package stats import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/elastic/beats/libbeat/tests/compose" mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go index 652209877868..2925463a3b8e 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go @@ -1,19 +1,6 @@ -// 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. +// 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 @@ -22,6 +9,8 @@ package subscriptions import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/elastic/beats/libbeat/tests/compose" mbtest "github.com/elastic/beats/metricbeat/mb/testing" ) diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index 49a1f0eb874e..b93439fabf6b 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -9,7 +9,6 @@ class TestNats(metricbeat.BaseTest): COMPOSE_SERVICES = ['stan'] - @parameterized.expand([ "stats", "channels", From a8c275b6e97ed6ab695422b36d7322b232b988f5 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 15:32:12 +0200 Subject: [PATCH 13/34] import parameterized Signed-off-by: chrismark --- x-pack/metricbeat/tests/system/test_stan.py | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index b93439fabf6b..a394635ca55c 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -1,6 +1,7 @@ import os import metricbeat import unittest +from parameterized import parameterized STAN_FIELDS = metricbeat.COMMON_FIELDS + ["stan"] From f9b4319b5fea9a5366277c7201477ec300b93197 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 16:41:08 +0200 Subject: [PATCH 14/34] Fix Dockerfile Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/_meta/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/x-pack/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile index 1f22d91e99d9..646b177d832f 100644 --- a/x-pack/metricbeat/module/stan/_meta/Dockerfile +++ b/x-pack/metricbeat/module/stan/_meta/Dockerfile @@ -4,11 +4,10 @@ FROM nats-streaming:$STAN_VERSION # create an enhanced container with nc command available since nats is based # on scratch image making healthcheck impossible FROM alpine:latest -COPY --from=0 /gnatsd /gnatsd -COPY --from=0 gnatsd.conf gnatsd.conf +COPY --from=0 nats-streaming-server /nats-streaming-server # Expose client, management, and cluster ports -EXPOSE 4222 8222 6222 +EXPOSE 4222 8222 HEALTHCHECK --interval=1s --retries=10 CMD nc -w 1 0.0.0.0 8222 Date: Tue, 3 Dec 2019 17:19:00 +0200 Subject: [PATCH 15/34] Fix mapping Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/stats/data.go | 16 ++++++++++++---- x-pack/metricbeat/tests/system/test_stan.py | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/x-pack/metricbeat/module/stan/stats/data.go b/x-pack/metricbeat/module/stan/stats/data.go index 89df76a233d1..0365cc15b8c7 100644 --- a/x-pack/metricbeat/module/stan/stats/data.go +++ b/x-pack/metricbeat/module/stan/stats/data.go @@ -9,16 +9,21 @@ import ( "github.com/pkg/errors" - "github.com/elastic/beats/libbeat/common" s "github.com/elastic/beats/libbeat/common/schema" c "github.com/elastic/beats/libbeat/common/schema/mapstriface" "github.com/elastic/beats/metricbeat/mb" ) var ( + moduleSchema = s.Schema{ + "server": s.Object{ + "id": c.Str("server_id"), + }, + "cluster": s.Object{ + "id": c.Str("cluster_id"), + }, + } clientsSchema = s.Schema{ - "cluster_id": c.Str("cluster_id"), - "server_id": c.Str("server_id"), "state": c.Str("state"), "role": c.Str("role", s.Optional), // cluster role is optional "clients": c.Int("clients"), @@ -40,7 +45,10 @@ func eventMapping(content []byte, r mb.ReporterV2) error { return errors.Wrap(err, "failure parsing Nats streaming server API response") } - moduleFields := common.MapStr{} + moduleFields, err := moduleSchema.Apply(streaming) + if err != nil { + return errors.Wrap(err, "failure applying module schema") + } event := mb.Event{ MetricSetFields: fields, ModuleFields: moduleFields, diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index a394635ca55c..644c463f4d71 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -1,4 +1,5 @@ import os +from xpack_metricbeat import XPackTest import metricbeat import unittest from parameterized import parameterized @@ -6,7 +7,7 @@ STAN_FIELDS = metricbeat.COMMON_FIELDS + ["stan"] -class TestNats(metricbeat.BaseTest): +class TestNats(XPackTest): COMPOSE_SERVICES = ['stan'] From 9492c386a2f2a6973bc5742883d59fa70918a983 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 17:37:14 +0200 Subject: [PATCH 16/34] fix stats metricset Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/_meta/fields.yml | 6 +++--- x-pack/metricbeat/module/stan/fields.go | 2 +- x-pack/metricbeat/module/stan/stats/data.go | 4 ++-- x-pack/metricbeat/module/stan/stats/stats.go | 2 +- x-pack/metricbeat/module/stan/stats/stats_test.go | 2 +- x-pack/metricbeat/tests/system/test_stan.py | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/x-pack/metricbeat/module/stan/_meta/fields.yml b/x-pack/metricbeat/module/stan/_meta/fields.yml index b81fddcde1a1..c4f3af644b74 100644 --- a/x-pack/metricbeat/module/stan/_meta/fields.yml +++ b/x-pack/metricbeat/module/stan/_meta/fields.yml @@ -13,7 +13,7 @@ type: keyword description: > The server ID - - name: server.time - type: date + - name: cluster.id + type: keyword description: > - Server time of metric creation + The cluster ID diff --git a/x-pack/metricbeat/module/stan/fields.go b/x-pack/metricbeat/module/stan/fields.go index a3a1e170c1d2..c7c981ea0383 100644 --- a/x-pack/metricbeat/module/stan/fields.go +++ b/x-pack/metricbeat/module/stan/fields.go @@ -19,5 +19,5 @@ func init() { // AssetStan returns asset data. // This is the base64 encoded gzipped contents of module/stan. func AssetStan() string { - return "eJy8l0tv20YQx+/6FIP0YgN2fdchhWE7gAFVRSv1VBTJkjskF1rO0jvDCOqnL5YvU3wkbkyVB0Og6Pn/5qH/LG/hgKc1sChaAYgRi2v4sBNFH1YAGjn2phDjaA0fVwBQPQm/Ol1aXAF4tKgY1xChqBVAYtBqXldP3gKpHLvY4ZJTgWtIvSuL5s6EQri+hH/6ArEjUYY4xBDDYmIGyZTAET2CR6Uh8S6HrRKGnXhUuaEUGP1X9HC1299vr5uYfbIzuurZn43uvmkxD3g6Ot+/PwMbrn2Grezz45yImBxHMloJvk1jV8cPUcAlkKN4E0PsUYWnR6JxpojQ8kixX//vSD70GkBwBxQKzW2h7+q8/gEkXThD0jD1JYcT0l7DfvTJw9+zL+Zb8h3+tjUhYqiZZAhhKl5zaMs0CZJzypMg1lH6AxRlHqEPHAOGHJlVijwJEZ0EL0hRhQdDVW2GxfgJnhNIjGf5zPgCHyE3dPVX+GgIuIw6Mf77OkyyAuuYIVMMhWM2kT2Bi+PSe9STyXWxF0rwU4gHjC8lUtzlyuI86rkk+zxWLYqzUe+i0VhIthDK7yWWWEeESDFqKAtHUPWGxpCKNGQmzZAFPBbOC+q241US58+PLU+ULGM9juypQrm1+BXttBW15uvRqkC6jBGFJBZ2otiWLOjhrm9BjhKTlr7y8Vq0Xl6P95vftk838LD5c7d/+uPp8XoS0zu7IOVz0kKivqli185pGMhp7Oa2SeRqg0qjv4FPzlp3DJ8eFGkT9to0bmwNkkxbmiHBtDdOb67rwNWmNLqu9n3rohS98ZzV/Ma6vkBZpkS6bTe1hX7ccLaddBsYVOzDelDW1jgvwZMuv/VeSeplFzviMkf9Fp6xsc108uJnq77wQv5mhtaw9DGrmbdz9qv6x/nZ6Bl/mNiIl0MLN87wDINidrGpFsnRDDZwS1nNyuUYt/f7Xa1Rv/F8u6Rj5hswCSg6/X9HueboRLLk2elA7kijw0lTo7MS1O+FKpjMYYawQNJmhPF+V2nivvpc9VJ6B+L6mNHAv1sqlyTW0PQoRc5ZVPQfFzgPZCFX/hDsjluxX+aOO9bitCcsRFL3UxxE2Mqds6z+DQAA//9DZYqL" + return "eJy8l89u4zYQxu9+isH2kgBJc/dhiyDJAgFSF63TU1HsUuLIIkwNFc5oDffpC+pfZInaDTby6hAYMj3fb4aTb8hr2ONxDSyKVgBixOIaPmxF0YcVgEZOvSnFOFrDxxUA1Cvhd6criysAjxYV4xoSFLUCyAxazet65TWQKrCPHR45lriGnXdV2b6JKITnS/jRF0gdiTLEIYYYFpMySK4EDugRPCoNmXcFbJQwbMWjKgztgNF/RQ8X2+fbzWUbc0h2Qlev/dXo/psOc4/Hg/PD9zOw4XnOsZN9vJ+IpLZiWUiljRWVyRURWp6IDCv+HYm7QckJboBCabkr7U2T43+ApEtnSKBA8SYdSo57onvGOzAkD39Pvpgvz3f4uzKFiOAykBwh9MFrDl2ZoiAF7zgKYh3tfoCiKhL0gWPEUCCz2iFHIZKj4Bkp6vBgqK7NuBi/wGMGmfEsnxlf4CMUhi7+CR8NAVdJL8b/XoJWosA6ZsgVQ+mYTWKP4NK08h51NLk+9kIJfgrxgPGlQkr7XFmcRz2X5JDHqkVxntS7aDSWki+E8meFFTYRIVGMGqrSEdR7Q1NIRRpys8uRBTyWzgvqbsfrJE7XT51UlCxjPY7ssUa5tvgVbdyKOrv1aFUgXcaIQhILO1Fn2DdDC3KUmV3lVfhhI9qMq/vbpz82D1dw9/T39vnhr4f7yyimd3ZBysesg0R9VcdunNMwkNPY922byMUTKo3+Cj45a90hfLpTpI1WgnHc1BokiVuaIcHdoJ3eXNeRq8U0+l0d+tZZKQbtOav5jXF9hrLERPppF5tCP244m166Cwwq9WE8KGsbnJfgSeefeq8kzbBLHXFVoH4Lz9TYZnby7GerofBC/mbG1rD0Mavtt1P2i+af87PRM/4QmYjnQwsvTvAMg2J2qakHycGMJnBHWffK+Rg3t8/bRqO543y7pFPmKzAZKDr+vKNce3QiWfLstCd3oMnhpK3RSQmam6AKJrOfISyRtJlgvN9V2rivPldfQ29A3BAzGfl3R+WyzBqKt1LinMX+wvxGsEceyUKh/D7YHXdiv80dd6zFuCcsRNLspzhIsJM7ZVn9HwAA//+b+oUX" } diff --git a/x-pack/metricbeat/module/stan/stats/data.go b/x-pack/metricbeat/module/stan/stats/data.go index 0365cc15b8c7..3b6e956c7018 100644 --- a/x-pack/metricbeat/module/stan/stats/data.go +++ b/x-pack/metricbeat/module/stan/stats/data.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package streaming +package stats import ( "encoding/json" @@ -29,7 +29,7 @@ var ( "clients": c.Int("clients"), "subscriptions": c.Int("subscriptions"), "channels": c.Int("channels"), - "msgs": c.Int("total_msgs"), + "messages": c.Int("total_msgs"), "bytes": c.Int("total_bytes"), } ) diff --git a/x-pack/metricbeat/module/stan/stats/stats.go b/x-pack/metricbeat/module/stan/stats/stats.go index 7cd32ae40f29..99afe8cc6980 100644 --- a/x-pack/metricbeat/module/stan/stats/stats.go +++ b/x-pack/metricbeat/module/stan/stats/stats.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package streaming +package stats import ( "github.com/pkg/errors" diff --git a/x-pack/metricbeat/module/stan/stats/stats_test.go b/x-pack/metricbeat/module/stan/stats/stats_test.go index f1a534b6d0aa..b3a46e0c2c6e 100644 --- a/x-pack/metricbeat/module/stan/stats/stats_test.go +++ b/x-pack/metricbeat/module/stan/stats/stats_test.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package streaming +package stats import ( "io/ioutil" diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index 644c463f4d71..5860268fc8eb 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -13,12 +13,12 @@ class TestNats(XPackTest): @parameterized.expand([ "stats", - "channels", - "subscriptions", + # "channels", + # "subscriptions", ]) @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") def test_metricset(self, metricset): """ etcd metricset tests """ - self.check_metricset("stan", metricset, self.get_hosts(), ['stan.' + metricset]) + self.check_metricset("stan", metricset, self.get_hosts(), STAN_FIELDS) From 00519a6a049aeb50b2a7623c93ff2df9dbbe5922 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 23:13:21 +0200 Subject: [PATCH 17/34] fix fields Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 3641359c6904..47576ddfd62b 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -29366,13 +29366,13 @@ type: keyword -- -*`stan.server.time`*:: +*`stan.cluster.id`*:: + -- -Server time of metric creation +The cluster ID -type: date +type: keyword -- From be9c7b4e5de5f21819bdc98d3b76eb07a5083886 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 3 Dec 2019 23:36:27 +0200 Subject: [PATCH 18/34] Fix tests Signed-off-by: chrismark Signed-off-by: chrismark --- .../module/stan/_meta/config.reference.yml | 2 - .../metricbeat/module/stan/_meta/config.yml | 7 +-- .../module/stan/channels/channels.go | 2 +- .../channels/channels_integration_test.go | 4 ++ .../metricbeat/module/stan/channels/data.go | 41 ++++++++++------ .../module/stan/stats/_meta/data.json | 47 +++++++++++-------- .../module/stan/subscriptions/data.go | 17 ++++++- .../subscriptions_integration_test.go | 2 + x-pack/metricbeat/tests/system/test_stan.py | 2 +- 9 files changed, 78 insertions(+), 46 deletions(-) diff --git a/x-pack/metricbeat/module/stan/_meta/config.reference.yml b/x-pack/metricbeat/module/stan/_meta/config.reference.yml index 2646f077dd42..e7b2fbb2c21a 100644 --- a/x-pack/metricbeat/module/stan/_meta/config.reference.yml +++ b/x-pack/metricbeat/module/stan/_meta/config.reference.yml @@ -3,5 +3,3 @@ period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" - #channels.metrics_path: "/streaming/channelsz" - #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint diff --git a/x-pack/metricbeat/module/stan/_meta/config.yml b/x-pack/metricbeat/module/stan/_meta/config.yml index 835b1b6b9332..5e2130b53770 100644 --- a/x-pack/metricbeat/module/stan/_meta/config.yml +++ b/x-pack/metricbeat/module/stan/_meta/config.yml @@ -2,9 +2,4 @@ metricsets: ["stats", "subscriptions", "channels"] period: 60s hosts: ["localhost:8222"] - #stats.metrics_path: "/varz" - #connections.metrics_path: "/connz" - #routes.metrics_path: "/routez" - #subscriptions.metrics_path: "/subsz" - #clients.metrics_path: "/streaming/clientsz" - #channels.metrics_path: "/streaming/channelsz" + #stats.metrics_path: "/streaming/serverz" diff --git a/x-pack/metricbeat/module/stan/channels/channels.go b/x-pack/metricbeat/module/stan/channels/channels.go index 3424de7344a6..0f59b15a8d41 100644 --- a/x-pack/metricbeat/module/stan/channels/channels.go +++ b/x-pack/metricbeat/module/stan/channels/channels.go @@ -25,7 +25,7 @@ var ( hostParser = parse.URLHostParserBuilder{ DefaultScheme: defaultScheme, DefaultPath: defaultPath, - PathConfigKey: "streaming.metrics_path", + PathConfigKey: "channels.metrics_path", QueryParams: queryParams, }.Build() ) diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go index ae2b8899690d..a0766d9a2014 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -16,6 +16,7 @@ import ( ) func TestData(t *testing.T) { + t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) @@ -23,9 +24,12 @@ func TestData(t *testing.T) { } func TestFetch(t *testing.T) { + t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) + t.Log(service.Host()) + t.Log(getConfig(service.Host())) events, errs := m.FetchEvents() if len(errs) > 0 { t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) diff --git a/x-pack/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go index ad3bb6b94053..f41efedc05e7 100644 --- a/x-pack/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -9,22 +9,30 @@ import ( "github.com/pkg/errors" - "github.com/elastic/beats/libbeat/common" s "github.com/elastic/beats/libbeat/common/schema" c "github.com/elastic/beats/libbeat/common/schema/mapstriface" "github.com/elastic/beats/metricbeat/mb" ) -var channelSchema = s.Schema{ - "cluster_id": c.Str("cluster_id"), - "server_id": c.Str("server_id"), - "name": c.Str("name"), - "msgs": c.Int("msgs"), - "bytes": c.Int("bytes"), - "first_seq": c.Int("first_seq"), - "last_seq": c.Int("last_seq"), - "depth": c.Int("depth", s.Optional), // aggregated by the module -} + +var ( + moduleSchema = s.Schema{ + "server": s.Object{ + "id": c.Str("server_id"), + }, + "cluster": s.Object{ + "id": c.Str("cluster_id"), + }, + } + channelSchema = s.Schema{ + "name": c.Str("name"), + "messages": c.Int("msgs"), + "bytes": c.Int("bytes"), + "first_seq": c.Int("first_seq"), + "last_seq": c.Int("last_seq"), + "depth": c.Int("depth", s.Optional), // aggregated by the module + } +) // Subscription stores subscription related information type Subscription struct { @@ -62,9 +70,14 @@ func eventMapping(content map[string]interface{}) (mb.Event, error) { return mb.Event{}, errors.Wrap(err, "failure applying channels schema") } + moduleFields, err := moduleSchema.Apply(content) + if err != nil { + return mb.Event{}, errors.Wrap(err, "failure applying module schema") + } + event := mb.Event{ MetricSetFields: fields, - ModuleFields: common.MapStr{}, + ModuleFields: moduleFields, } return event, nil } @@ -86,10 +99,8 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { } } chWrapper := map[string]interface{}{ - "cluster_id": channelsIn.ClusterID, - "server_id": channelsIn.ServerID, "name": ch.Name, - "msgs": ch.Msgs, + "messages": ch.Msgs, "bytes": ch.Bytes, "first_seq": ch.FirstSeq, "last_seq": ch.LastSeq, diff --git a/x-pack/metricbeat/module/stan/stats/_meta/data.json b/x-pack/metricbeat/module/stan/stats/_meta/data.json index 3d87dbbf5012..0d1c82bc628b 100644 --- a/x-pack/metricbeat/module/stan/stats/_meta/data.json +++ b/x-pack/metricbeat/module/stan/stats/_meta/data.json @@ -1,23 +1,32 @@ { - "@timestamp":"2019-07-30T08:05:34.853Z", - "beat":{ - "hostname":"beathost", - "name":"beathost" + "@timestamp": "2017-10-12T08:05:34.853Z", + "event": { + "dataset": "stan.stats", + "duration": 115000, + "module": "stan" }, - "metricset":{ - "host":"localhost", - "module":"stan", - "name":"stats", - "rtt":44269 + "metricset": { + "name": "stats", + "period": 10000 }, - "nats":{ - "stats":{ - "clients": 52, - "subscriptions": 109, - "channels": 55, - "msgs": 101, - "bytes": 27473416 - } + "service": { + "address": "localhost:32768", + "type": "stan" }, - "type":"metricsets" -} + "stan": { + "cluster": { + "id": "test-cluster" + }, + "server": { + "id": "IcYma3g7cxFU6AUhN9flMe" + }, + "stats": { + "bytes": 0, + "channels": 0, + "clients": 0, + "messages": 0, + "state": "STANDALONE", + "subscriptions": 0 + } + } +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go index 3209afe35f42..d7238034ad15 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -9,13 +9,20 @@ import ( "github.com/pkg/errors" - "github.com/elastic/beats/libbeat/common" s "github.com/elastic/beats/libbeat/common/schema" c "github.com/elastic/beats/libbeat/common/schema/mapstriface" "github.com/elastic/beats/metricbeat/mb" ) var ( + moduleSchema = s.Schema{ + "server": s.Object{ + "id": c.Str("server_id"), + }, + "cluster": s.Object{ + "id": c.Str("cluster_id"), + }, + } subscriptionsSchema = s.Schema{ "id": c.Str("client_id"), "channel": c.Str("channel"), // this is a computed field added AFTER schema.Apply @@ -34,9 +41,15 @@ func eventMapping(content map[string]interface{}) (mb.Event, error) { if err != nil { return mb.Event{}, errors.Wrap(err, "failure applying subscription schema") } + + moduleFields, err := moduleSchema.Apply(content) + if err != nil { + return mb.Event{}, errors.Wrap(err, "failure applying module schema") + } + event := mb.Event{ MetricSetFields: fields, - ModuleFields: common.MapStr{}, + ModuleFields: moduleFields, } return event, nil } diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go index 2925463a3b8e..29e1dffe1518 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go @@ -16,6 +16,7 @@ import ( ) func TestData(t *testing.T) { + t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) @@ -23,6 +24,7 @@ func TestData(t *testing.T) { } func TestFetch(t *testing.T) { + t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index 5860268fc8eb..f2c8931c118b 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -19,6 +19,6 @@ class TestNats(XPackTest): @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") def test_metricset(self, metricset): """ - etcd metricset tests + stan metricset tests """ self.check_metricset("stan", metricset, self.get_hosts(), STAN_FIELDS) From 5d15e287149031aef1b97f97b5cd7c4177f60312 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 4 Dec 2019 17:32:18 +0200 Subject: [PATCH 19/34] Enhance Dockerfile to create channels Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/_meta/Dockerfile | 14 ++++++++++++-- x-pack/metricbeat/module/stan/_meta/run.sh | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 x-pack/metricbeat/module/stan/_meta/run.sh diff --git a/x-pack/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile index 646b177d832f..d07144957b5d 100644 --- a/x-pack/metricbeat/module/stan/_meta/Dockerfile +++ b/x-pack/metricbeat/module/stan/_meta/Dockerfile @@ -1,13 +1,23 @@ ARG STAN_VERSION=0.15.1 FROM nats-streaming:$STAN_VERSION +# build stage +FROM golang:1.13-alpine AS build-env +RUN apk --no-cache add build-base git bzr mercurial gcc +RUN cd src && go get github.com/nats-io/stan.go/ +RUN cd src/github.com/nats-io/stan.go/examples/stan-bench && go build . + # create an enhanced container with nc command available since nats is based # on scratch image making healthcheck impossible FROM alpine:latest +RUN apk add --no-cache --upgrade bash COPY --from=0 nats-streaming-server /nats-streaming-server +COPY --from=build-env /go/src/github.com/nats-io/stan.go/examples/stan-bench/stan-bench /stan-bench # Expose client, management, and cluster ports EXPOSE 4222 8222 HEALTHCHECK --interval=1s --retries=10 CMD nc -w 1 0.0.0.0 8222 Date: Wed, 4 Dec 2019 18:09:51 +0200 Subject: [PATCH 20/34] Fix subs and channelz Signed-off-by: chrismark --- metricbeat/docs/modules/stan.asciidoc | 2 -- .../docs/modules/stan/subscriptions.asciidoc | 6 ++++ x-pack/metricbeat/metricbeat.reference.yml | 2 -- .../module/stan/channels/_meta/data.json | 32 +++++++++++++++++++ .../channels/channels_integration_test.go | 2 -- .../metricbeat/module/stan/channels/data.go | 17 +++++----- .../module/stan/subscriptions/_meta/data.json | 32 +++++++++++++++++++ .../module/stan/subscriptions/data.go | 3 ++ .../subscriptions_integration_test.go | 2 -- x-pack/metricbeat/modules.d/stan.yml.disabled | 7 +--- x-pack/metricbeat/tests/system/test_stan.py | 6 ++-- 11 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 x-pack/metricbeat/module/stan/subscriptions/_meta/data.json diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index 0334da4e631d..f357661d9dbb 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -40,8 +40,6 @@ metricbeat.modules: period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" - #channels.metrics_path: "/streaming/channelsz" - #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint ---- [float] diff --git a/metricbeat/docs/modules/stan/subscriptions.asciidoc b/metricbeat/docs/modules/stan/subscriptions.asciidoc index 1032335d71ef..df34fab9518a 100644 --- a/metricbeat/docs/modules/stan/subscriptions.asciidoc +++ b/metricbeat/docs/modules/stan/subscriptions.asciidoc @@ -16,3 +16,9 @@ This is a default metricset. If the host module is unconfigured, this metricset For a description of each field in the metricset, see the <> section. +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/stan/subscriptions/_meta/data.json[] +---- diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index a7eb473d3401..ad6b1374c91c 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -911,8 +911,6 @@ metricbeat.modules: period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" - #channels.metrics_path: "/streaming/channelsz" - #subscriptions: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint #-------------------------------- Statsd Module -------------------------------- - module: statsd diff --git a/x-pack/metricbeat/module/stan/channels/_meta/data.json b/x-pack/metricbeat/module/stan/channels/_meta/data.json index e69de29bb2d1..030b6b747bb0 100644 --- a/x-pack/metricbeat/module/stan/channels/_meta/data.json +++ b/x-pack/metricbeat/module/stan/channels/_meta/data.json @@ -0,0 +1,32 @@ +{ + "@timestamp": "2017-10-12T08:05:34.853Z", + "event": { + "dataset": "stan.channels", + "duration": 115000, + "module": "stan" + }, + "metricset": { + "name": "channels", + "period": 10000 + }, + "service": { + "address": "localhost:32770", + "type": "stan" + }, + "stan": { + "channels": { + "bytes": 1023999504, + "depth": 977951, + "first_seq": 6166399, + "last_seq": 7144430, + "messages": 978032, + "name": "bar" + }, + "cluster": { + "id": "test-cluster" + }, + "server": { + "id": "mNKuLCRmOZD79arLFAXiaJ" + } + } +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go index a0766d9a2014..3568d9c761e8 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -16,7 +16,6 @@ import ( ) func TestData(t *testing.T) { - t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) @@ -24,7 +23,6 @@ func TestData(t *testing.T) { } func TestFetch(t *testing.T) { - t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) diff --git a/x-pack/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go index f41efedc05e7..1e54c5c16802 100644 --- a/x-pack/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -14,7 +14,6 @@ import ( "github.com/elastic/beats/metricbeat/mb" ) - var ( moduleSchema = s.Schema{ "server": s.Object{ @@ -25,12 +24,12 @@ var ( }, } channelSchema = s.Schema{ - "name": c.Str("name"), - "messages": c.Int("msgs"), - "bytes": c.Int("bytes"), - "first_seq": c.Int("first_seq"), - "last_seq": c.Int("last_seq"), - "depth": c.Int("depth", s.Optional), // aggregated by the module + "name": c.Str("name"), + "messages": c.Int("msgs"), + "bytes": c.Int("bytes"), + "first_seq": c.Int("first_seq"), + "last_seq": c.Int("last_seq"), + "depth": c.Int("depth", s.Optional), // aggregated by the module } ) @@ -99,8 +98,10 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { } } chWrapper := map[string]interface{}{ + "cluster_id": channelsIn.ClusterID, + "server_id": channelsIn.ServerID, "name": ch.Name, - "messages": ch.Msgs, + "msgs": ch.Msgs, "bytes": ch.Bytes, "first_seq": ch.FirstSeq, "last_seq": ch.LastSeq, diff --git a/x-pack/metricbeat/module/stan/subscriptions/_meta/data.json b/x-pack/metricbeat/module/stan/subscriptions/_meta/data.json new file mode 100644 index 000000000000..958a1f8e8d60 --- /dev/null +++ b/x-pack/metricbeat/module/stan/subscriptions/_meta/data.json @@ -0,0 +1,32 @@ +{ + "@timestamp": "2017-10-12T08:05:34.853Z", + "event": { + "dataset": "stan.subscriptions", + "duration": 115000, + "module": "stan" + }, + "metricset": { + "name": "subscriptions", + "period": 10000 + }, + "service": { + "address": "localhost:32770", + "type": "stan" + }, + "stan": { + "cluster": { + "id": "test-cluster" + }, + "server": { + "id": "mNKuLCRmOZD79arLFAXiaJ" + }, + "subscriptions": { + "channel": "bar", + "id": "benchmark-sub-2", + "last_sent": 7195645, + "offline": false, + "pending": 1024, + "stalled": true + } + } +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go index d7238034ad15..15cfef5c987a 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -77,6 +77,7 @@ type Channel struct { // Channels stores channels related information type Channels struct { ClusterID string `json:"cluster_id"` + ServerID string `json:"server_id"` Limit uint64 `json:"limit"` Total uint64 `json:"total"` Channels []Channel `json:"channels,omitempty"` @@ -94,6 +95,8 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { for _, sub := range ch.Subscriptions { var evt mb.Event sub["channel"] = ch.Name + sub["server_id"] = channels.ServerID + sub["cluster_id"] = channels.ClusterID evt, err = eventMapping(sub) if err != nil { r.Error(errors.Wrap(err, "error mapping subscription event")) diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go index 29e1dffe1518..2925463a3b8e 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go @@ -16,7 +16,6 @@ import ( ) func TestData(t *testing.T) { - t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) @@ -24,7 +23,6 @@ func TestData(t *testing.T) { } func TestFetch(t *testing.T) { - t.Skip("Skip until a proper Docker image is setup for Metricbeat") service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) diff --git a/x-pack/metricbeat/modules.d/stan.yml.disabled b/x-pack/metricbeat/modules.d/stan.yml.disabled index da68714b0355..ddc8c55c307a 100644 --- a/x-pack/metricbeat/modules.d/stan.yml.disabled +++ b/x-pack/metricbeat/modules.d/stan.yml.disabled @@ -5,9 +5,4 @@ metricsets: ["stats", "subscriptions", "channels"] period: 60s hosts: ["localhost:8222"] - #stats.metrics_path: "/varz" - #connections.metrics_path: "/connz" - #routes.metrics_path: "/routez" - #subscriptions.metrics_path: "/subsz" - #clients.metrics_path: "/streaming/clientsz" - #channels.metrics_path: "/streaming/channelsz" + #stats.metrics_path: "/streaming/serverz" diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/tests/system/test_stan.py index f2c8931c118b..45eb9ec1b8a9 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/tests/system/test_stan.py @@ -7,14 +7,14 @@ STAN_FIELDS = metricbeat.COMMON_FIELDS + ["stan"] -class TestNats(XPackTest): +class TestStan(XPackTest): COMPOSE_SERVICES = ['stan'] @parameterized.expand([ "stats", - # "channels", - # "subscriptions", + "channels", + "subscriptions", ]) @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") def test_metricset(self, metricset): From 43f45406bfb87563a52707672a2f7a53bfdf073c Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 4 Dec 2019 18:44:24 +0200 Subject: [PATCH 21/34] fix config and fields Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 2 +- metricbeat/docs/modules/stan.asciidoc | 2 ++ x-pack/metricbeat/metricbeat.reference.yml | 2 ++ x-pack/metricbeat/module/stan/_meta/config.reference.yml | 2 ++ x-pack/metricbeat/module/stan/_meta/config.yml | 2 ++ x-pack/metricbeat/module/stan/channels/_meta/fields.yml | 2 +- x-pack/metricbeat/module/stan/fields.go | 2 +- x-pack/metricbeat/modules.d/stan.yml.disabled | 2 ++ 8 files changed, 13 insertions(+), 3 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 47576ddfd62b..1191aafaebcd 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -29393,7 +29393,7 @@ type: keyword -- -*`stan.channels.msgs`*:: +*`stan.channels.messages`*:: + -- The number of STAN streaming messages diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index f357661d9dbb..5347ae925920 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -40,6 +40,8 @@ metricbeat.modules: period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint ---- [float] diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index ad6b1374c91c..ed7de9c155d8 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -911,6 +911,8 @@ metricbeat.modules: period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint #-------------------------------- Statsd Module -------------------------------- - module: statsd diff --git a/x-pack/metricbeat/module/stan/_meta/config.reference.yml b/x-pack/metricbeat/module/stan/_meta/config.reference.yml index e7b2fbb2c21a..037e5bfa8453 100644 --- a/x-pack/metricbeat/module/stan/_meta/config.reference.yml +++ b/x-pack/metricbeat/module/stan/_meta/config.reference.yml @@ -3,3 +3,5 @@ period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint diff --git a/x-pack/metricbeat/module/stan/_meta/config.yml b/x-pack/metricbeat/module/stan/_meta/config.yml index 5e2130b53770..756916220fc6 100644 --- a/x-pack/metricbeat/module/stan/_meta/config.yml +++ b/x-pack/metricbeat/module/stan/_meta/config.yml @@ -3,3 +3,5 @@ period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint diff --git a/x-pack/metricbeat/module/stan/channels/_meta/fields.yml b/x-pack/metricbeat/module/stan/channels/_meta/fields.yml index d261959797cf..d7715b3767f8 100644 --- a/x-pack/metricbeat/module/stan/channels/_meta/fields.yml +++ b/x-pack/metricbeat/module/stan/channels/_meta/fields.yml @@ -8,7 +8,7 @@ type: keyword description: > The name of the STAN streaming channel - - name: msgs + - name: messages type: long description: > The number of STAN streaming messages diff --git a/x-pack/metricbeat/module/stan/fields.go b/x-pack/metricbeat/module/stan/fields.go index c7c981ea0383..cb0b11364065 100644 --- a/x-pack/metricbeat/module/stan/fields.go +++ b/x-pack/metricbeat/module/stan/fields.go @@ -19,5 +19,5 @@ func init() { // AssetStan returns asset data. // This is the base64 encoded gzipped contents of module/stan. func AssetStan() string { - return "eJy8l89u4zYQxu9+isH2kgBJc/dhiyDJAgFSF63TU1HsUuLIIkwNFc5oDffpC+pfZInaDTby6hAYMj3fb4aTb8hr2ONxDSyKVgBixOIaPmxF0YcVgEZOvSnFOFrDxxUA1Cvhd6criysAjxYV4xoSFLUCyAxazet65TWQKrCPHR45lriGnXdV2b6JKITnS/jRF0gdiTLEIYYYFpMySK4EDugRPCoNmXcFbJQwbMWjKgztgNF/RQ8X2+fbzWUbc0h2Qlev/dXo/psOc4/Hg/PD9zOw4XnOsZN9vJ+IpLZiWUiljRWVyRURWp6IDCv+HYm7QckJboBCabkr7U2T43+ApEtnSKBA8SYdSo57onvGOzAkD39Pvpgvz3f4uzKFiOAykBwh9MFrDl2ZoiAF7zgKYh3tfoCiKhL0gWPEUCCz2iFHIZKj4Bkp6vBgqK7NuBi/wGMGmfEsnxlf4CMUhi7+CR8NAVdJL8b/XoJWosA6ZsgVQ+mYTWKP4NK08h51NLk+9kIJfgrxgPGlQkr7XFmcRz2X5JDHqkVxntS7aDSWki+E8meFFTYRIVGMGqrSEdR7Q1NIRRpys8uRBTyWzgvqbsfrJE7XT51UlCxjPY7ssUa5tvgVbdyKOrv1aFUgXcaIQhILO1Fn2DdDC3KUmV3lVfhhI9qMq/vbpz82D1dw9/T39vnhr4f7yyimd3ZBysesg0R9VcdunNMwkNPY922byMUTKo3+Cj45a90hfLpTpI1WgnHc1BokiVuaIcHdoJ3eXNeRq8U0+l0d+tZZKQbtOav5jXF9hrLERPppF5tCP244m166Cwwq9WE8KGsbnJfgSeefeq8kzbBLHXFVoH4Lz9TYZnby7GerofBC/mbG1rD0Mavtt1P2i+af87PRM/4QmYjnQwsvTvAMg2J2qakHycGMJnBHWffK+Rg3t8/bRqO543y7pFPmKzAZKDr+vKNce3QiWfLstCd3oMnhpK3RSQmam6AKJrOfISyRtJlgvN9V2rivPldfQ29A3BAzGfl3R+WyzBqKt1LinMX+wvxGsEceyUKh/D7YHXdiv80dd6zFuCcsRNLspzhIsJM7ZVn9HwAA//+b+oUX" + return "eJy8l89u4zYQxu9+isH2kgBJc/dhiyDJAgFSF63dU1HsUuLIJkwNFc5oDffpC0qiIuvPbtCVqkNgyPR8vxlOviFv4YjnNbAoWgGIEYtr+LAVRR9WABo59aYQ42gNH1cAUK2EX50uLa4APFpUjGtIUNQKIDNoNa+rlbdAKsc2dnjkXOAa9t6VRfNmRCE8X8KPvkDqSJQhDjHEsJiUQQ5K4IQewaPSkHmXw0YJw1Y8qtzQHhj9V/Rwtd3db66bmF2yC7pq7c9Gt99EzCOeT85330/Ahmd3wCj7/DgQSW3JMpNKE2tU5qCI0PJApFvx70g8dEpOcAcUSsuxtHd1jv8Aki6cIYEcxZu0K9nvifj0d6BLHv5efDFdnu/wxzKFiOAykANC6IO3HGKZRkFyZFZ75FEY62j/H0jKPEEfWHoco1oRJDnLkhRVeDBU1adfkJ/gOYPMeJbPjK/wEXJDV3+Fj4aAy6QV47+vQStRYB0zHBRD4ZhNYs/g0rT0HvVocm3smRL8FOIB42uJlLa5sjiPeirJLo9Vs+K8qB+i0VjIYSaU30sssY4IiWLUUBaOoNobGkIq0nAw+wOygMfCeUEdd7xK4nL90E1FyTz248ieK5Rbi1/RjttRtFyPVgXSecwoJDGzG0XTvuvakKPM7Euvwg9r0XpkPd6//LZ5uoGHlz+3u6c/nh6vRzG9szNSPmcREvVNFbt2T8NATmPbt00iVy+oNPob+OSsdafw6UGRNloJjuOm1iDJuKUZEtx32undde252phGu6td31qUotOek5rfGNkLlGVMZKGJt2mlY2BQqQ/jQVlb47wGT1p+6r2R1MMudcRljvo9PENjm9jJxc9XXeGZ/M30rWHuo1bTb5fsV/U/52ejJ/xhZCIuhxZeXOAZBsXsUlMNkpPpTeBIWfXKcoyb+9221qjvOd8u6ZD5BkwGis7/31GuOTqRzHl2OpI70eBw0tToogT1bVAFkzlOEBZI2gwwftxVmrhvPlddRe9AXBcz6fl3pHJZZg2Nt1LinMX20vxOsGfuyUKu/DHYHUexX6aOO9biuCfMRFLvpzhIMMpdsqz+DQAA///HEYa1" } diff --git a/x-pack/metricbeat/modules.d/stan.yml.disabled b/x-pack/metricbeat/modules.d/stan.yml.disabled index ddc8c55c307a..0f93c0f5a0c2 100644 --- a/x-pack/metricbeat/modules.d/stan.yml.disabled +++ b/x-pack/metricbeat/modules.d/stan.yml.disabled @@ -6,3 +6,5 @@ period: 60s hosts: ["localhost:8222"] #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint From 792fca2f321dc8cdc2f605dfbf9712bc2e7e4e09 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 5 Dec 2019 11:54:07 +0200 Subject: [PATCH 22/34] Remove debug logs Signed-off-by: chrismark --- .../module/stan/channels/channels_integration_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go index 3568d9c761e8..ae2b8899690d 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -26,8 +26,6 @@ func TestFetch(t *testing.T) { service := compose.EnsureUp(t, "stan") m := mbtest.NewFetcher(t, getConfig(service.Host())) - t.Log(service.Host()) - t.Log(getConfig(service.Host())) events, errs := m.FetchEvents() if len(errs) > 0 { t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) From b44bd108dc8b39c912de18f2cad860faf579a3d6 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 5 Dec 2019 15:11:50 +0200 Subject: [PATCH 23/34] remove dashboard Signed-off-by: chrismark --- metricbeat/docs/modules/stan.asciidoc | 8 - metricbeat/docs/modules_list.asciidoc | 2 +- .../module/stan/_meta/docs.asciidoc | 8 - .../7/dashboard/Metricbeat-stan-overview.json | 1689 ----------------- 4 files changed, 1 insertion(+), 1706 deletions(-) delete mode 100644 x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json diff --git a/metricbeat/docs/modules/stan.asciidoc b/metricbeat/docs/modules/stan.asciidoc index 5347ae925920..3efe11c72e0b 100644 --- a/metricbeat/docs/modules/stan.asciidoc +++ b/metricbeat/docs/modules/stan.asciidoc @@ -18,14 +18,6 @@ The default metricsets are `channels`, `stats` and `subscriptions`. The STAN module is tested with STAN 0.15.1. -[float] -=== Dashboard - -The STAN module comes with a predefined dashboard. For example: - -image::./images/metricbeat_stan_dashboard.png[] - - [float] === Example configuration diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 84623d77ef19..8248ccedf4bf 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -173,7 +173,7 @@ This file is generated! See scripts/mage/docs_collector.go .3+| .3+| |<> |<> |<> -|<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .3+| .3+| |<> beta[] |<> beta[] |<> beta[] diff --git a/x-pack/metricbeat/module/stan/_meta/docs.asciidoc b/x-pack/metricbeat/module/stan/_meta/docs.asciidoc index 1af2854de398..7d78f5672b15 100644 --- a/x-pack/metricbeat/module/stan/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/stan/_meta/docs.asciidoc @@ -6,11 +6,3 @@ The default metricsets are `channels`, `stats` and `subscriptions`. === Compatibility The STAN module is tested with STAN 0.15.1. - - -[float] -=== Dashboard - -The STAN module comes with a predefined dashboard. For example: - -image::./images/metricbeat_stan_dashboard.png[] diff --git a/x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json b/x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json deleted file mode 100644 index 248091a9e9f5..000000000000 --- a/x-pack/metricbeat/module/stan/_meta/kibana/7/dashboard/Metricbeat-stan-overview.json +++ /dev/null @@ -1,1689 +0,0 @@ -{ - "objects": [ - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Subscriptions Info [Metricbeat STAN] ECS", - "uiStateJSON": { - "vis": { - "params": { - "sort": { - "columnIndex": null, - "direction": null - } - } - } - }, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Cache Fanout Avg", - "field": "stan.subscriptions.cache.fanout.avg" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customLabel": "Cache Fanout Max", - "field": "stan.subscriptions.cache.fanout.max" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "3", - "params": { - "customLabel": "Cache Hit Rate", - "field": "stan.subscriptions.cache.hit_rate" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "4", - "params": { - "customLabel": "Cache Size", - "field": "stan.subscriptions.cache.size" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "5", - "params": { - "customLabel": "Inserts", - "field": "stan.subscriptions.inserts" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "6", - "params": { - "customLabel": "Matches", - "field": "stan.subscriptions.matches" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "7", - "params": { - "customLabel": "Removes", - "field": "stan.subscriptions.removes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "8", - "params": { - "customLabel": "Total", - "field": "stan.subscriptions.total" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "perPage": 1, - "showMeticsAtAllLevels": false, - "showMetricsAtAllLevels": false, - "showPartialRows": false, - "showTotal": false, - "sort": { - "columnIndex": null, - "direction": null - }, - "totalFunc": "sum" - }, - "title": "Subscriptions Info [Metricbeat STAN] ECS", - "type": "table" - } - }, - "id": "b129b220-1e44-11e9-a1b4-79a7ae42ab60-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:54:30.301Z", - "version": 3 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Current Memory Usage [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Memory (Bytes)", - "field": "stan.stats.mem.bytes" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "addLegend": false, - "addTooltip": true, - "metric": { - "colorSchema": "Green to Red", - "colorsRange": [ - { - "from": 0, - "to": 10000 - } - ], - "invertColors": false, - "labels": { - "show": true - }, - "metricColorMode": "None", - "percentageMode": false, - "style": { - "bgColor": false, - "bgFill": "#000", - "fontSize": 42, - "labelColor": false, - "subText": "" - }, - "useRanges": false - }, - "type": "metric" - }, - "title": "Current Memory Usage [Metricbeat STAN] ECS", - "type": "metric" - } - }, - "id": "30a61c00-1e45-11e9-a1b4-79a7ae42ab61-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:56:32.097Z", - "version": 4 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Server Uptime [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Server Uptime", - "field": "stan.stats.uptime" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "addLegend": false, - "addTooltip": true, - "metric": { - "colorSchema": "Green to Red", - "colorsRange": [ - { - "from": 0, - "to": 10000 - } - ], - "invertColors": false, - "labels": { - "show": true - }, - "metricColorMode": "None", - "percentageMode": false, - "style": { - "bgColor": false, - "bgFill": "#000", - "fontSize": 42, - "labelColor": false, - "subText": "" - }, - "useRanges": false - }, - "type": "metric" - }, - "title": "Server Uptime [Metricbeat STAN] ECS", - "type": "metric" - } - }, - "id": "206f1bc0-1e45-11e9-a1b4-79a7ae42ab61-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:57:04.084Z", - "version": 4 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Total Connections [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Total Connections", - "field": "stan.stats.total_connections" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "addLegend": false, - "addTooltip": true, - "metric": { - "colorSchema": "Green to Red", - "colorsRange": [ - { - "from": 0, - "to": 10000 - } - ], - "invertColors": false, - "labels": { - "show": true - }, - "metricColorMode": "None", - "percentageMode": false, - "style": { - "bgColor": false, - "bgFill": "#000", - "fontSize": 42, - "labelColor": false, - "subText": "" - }, - "useRanges": false - }, - "type": "metric" - }, - "title": "Total Connections [Metricbeat STAN] ECS", - "type": "metric" - } - }, - "id": "4c380ff0-1e45-11e9-a1b4-79a7af42ab61-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:57:32.006Z", - "version": 4 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Connections", - "field": "stan.connections.total" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - }, - { - "enabled": true, - "id": "3", - "params": { - "customLabel": "Routes", - "field": "stan.routes.total" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "4", - "params": { - "customLabel": "Remotes", - "field": "stan.stats.remotes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "5", - "params": { - "customLabel": "Subscriptions", - "field": "stan.subscriptions.total" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Connections" - }, - "drawLinesBetweenPoints": true, - "interpolate": "linear", - "mode": "stacked", - "show": "true", - "showCircles": true, - "type": "area", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "3", - "label": "Routes" - }, - "drawLinesBetweenPoints": true, - "interpolate": "linear", - "mode": "stacked", - "show": true, - "showCircles": true, - "type": "area", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "4", - "label": "Remotes" - }, - "drawLinesBetweenPoints": true, - "interpolate": "linear", - "mode": "stacked", - "show": true, - "showCircles": true, - "type": "area", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "5", - "label": "Subscriptions" - }, - "drawLinesBetweenPoints": true, - "interpolate": "linear", - "mode": "stacked", - "show": true, - "showCircles": true, - "type": "area", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "area", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Connections" - }, - "type": "value" - } - ] - }, - "title": "Remotes-Subsz-Connz-Routez Timeline [Metricbeat STAN] ECS", - "type": "area" - } - }, - "id": "199d3d30-1e46-11e9-a1b4-79a7ae42ab61-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:53:31.785Z", - "version": 3 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Subscription Stats Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Cache Fanout Avg", - "field": "stan.subscriptions.cache.fanout.avg" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - }, - { - "enabled": true, - "id": "3", - "params": { - "customLabel": "Cache Fanout Max", - "field": "stan.subscriptions.cache.fanout.max" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "5", - "params": { - "customLabel": "Inserts", - "field": "stan.subscriptions.inserts" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "6", - "params": { - "customLabel": "Removes", - "field": "stan.subscriptions.removes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "7", - "params": { - "customLabel": "Matches", - "field": "stan.subscriptions.matches" - }, - "schema": "metric", - "type": "avg" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Cache Fanout Avg" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "3", - "label": "Cache Fanout Max" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "5", - "label": "Inserts" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "6", - "label": "Removes" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "7", - "label": "Matches" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Cache Fanout Avg" - }, - "type": "value" - } - ] - }, - "title": "Subscription Stats Timeline [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "754215c0-1e46-11e9-a1b4-79a7ae42ab61-ecs", - "type": "visualization", - "updated_at": "2019-01-23T14:55:04.899Z", - "version": 3 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Slow Consumers Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Slow Consumers", - "field": "stan.stats.slow_consumers" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Slow Consumers" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Slow Consumers" - }, - "type": "value" - } - ] - }, - "title": "Slow Consumers Timeline [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "94534190-1e97-11e9-b9e7-93b3bd2eec90-ecs", - "type": "visualization", - "updated_at": "2019-01-23T14:53:57.137Z", - "version": 2 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "IO Bytes Stats [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "In Bytes", - "field": "stan.stats.in.bytes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customLabel": "Out Bytes", - "field": "stan.stats.out.bytes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "3", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "In Bytes" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "2", - "label": "Out Bytes" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "IO Bytes" - }, - "type": "value" - } - ] - }, - "title": "IO Bytes Stats [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "be1d8a20-1e98-11e9-b9e7-93b3bd2eec90-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:48:22.914Z", - "version": 4 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Memory Utilization Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Memory Avg", - "field": "stan.stats.mem.bytes" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Memory Avg" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Memory Avg (Bytes)" - }, - "type": "value" - } - ] - }, - "title": "Memory Utilization Timeline [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "8204e820-1e99-11e9-b9e7-93b3bd2eec90-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:52:55.445Z", - "version": 5 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "IO Messages Stats [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "In Messages", - "field": "stan.stats.in.messages" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customLabel": "Out Messages", - "field": "stan.stats.out.messages" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "3", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "In Messages" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "2", - "label": "Out Messages" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": true, - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "IO Messages" - }, - "type": "value" - } - ] - }, - "title": "IO Messages Stats [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "cdbf4110-1f0d-11e9-a673-d9577e5e50eb-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:47:25.774Z", - "version": 2 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "CPU Utilization Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "CPU Avg", - "field": "stan.stats.cpu" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "CPU Avg" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "CPU Avg (%)" - }, - "type": "value" - } - ] - }, - "title": "CPU Utilization Timeline [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "138dc660-1f1a-11e9-a673-d9577e5e50eb-ecs", - "type": "visualization", - "updated_at": "2019-01-24T07:51:51.767Z", - "version": 2 - }, - { - "attributes": { - "description": "", - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "index": "metricbeat-*", - "query": { - "language": "kuery", - "query": "" - } - } - }, - "title": "Cache Hit Rate Timeline [Metricbeat STAN] ECS", - "uiStateJSON": {}, - "version": 1, - "visState": { - "aggs": [ - { - "enabled": true, - "id": "1", - "params": { - "customLabel": "Cache Hit Rate", - "field": "stan.subscriptions.cache.hit_rate" - }, - "schema": "metric", - "type": "avg" - }, - { - "enabled": true, - "id": "2", - "params": { - "customInterval": "2h", - "extended_bounds": {}, - "field": "@timestamp", - "interval": "auto", - "min_doc_count": 1 - }, - "schema": "segment", - "type": "date_histogram" - } - ], - "params": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Cache Hit Rate" - }, - "drawLinesBetweenPoints": true, - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "line", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Cache Hit Rate (%)" - }, - "type": "value" - } - ] - }, - "title": "Cache Hit Rate Timeline [Metricbeat STAN] ECS", - "type": "line" - } - }, - "id": "dff743a0-1f1c-11e9-a673-d9577e5e50eb-ecs", - "type": "visualization", - "updated_at": "2019-01-23T14:57:20.994Z", - "version": 2 - }, - { - "attributes": { - "description": "Overview of STAN server status", - "hits": 0, - "kibanaSavedObjectMeta": { - "searchSourceJSON": { - "filter": [], - "highlightAll": true, - "query": { - "language": "kuery", - "query": "" - }, - "version": true - } - }, - "optionsJSON": { - "darkTheme": false, - "hidePanelTitles": false, - "useMargins": true - }, - "panelsJSON": [ - { - "embeddableConfig": {}, - "gridData": { - "h": 11, - "i": "6", - "w": 24, - "x": 0, - "y": 45 - }, - "id": "b129b220-1e44-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "6", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 7, - "i": "7", - "w": 13, - "x": 24, - "y": 34 - }, - "id": "30a61c00-1e45-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "7", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 7, - "i": "8", - "w": 11, - "x": 37, - "y": 34 - }, - "id": "206f1bc0-1e45-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "8", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 8, - "i": "9", - "w": 8, - "x": 24, - "y": 41 - }, - "id": "4c380ff0-1e45-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "9", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 11, - "i": "11", - "w": 24, - "x": 0, - "y": 34 - }, - "id": "199d3d30-1e46-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "11", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 10, - "i": "12", - "w": 18, - "x": 15, - "y": 0 - }, - "id": "754215c0-1e46-11e9-a1b4-79a7ae42ab61-ecs", - "panelIndex": "12", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 10, - "i": "13", - "w": 15, - "x": 0, - "y": 0 - }, - "id": "94534190-1e97-11e9-b9e7-93b3bd2eec90-ecs", - "panelIndex": "13", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 12, - "i": "14", - "w": 24, - "x": 24, - "y": 10 - }, - "id": "be1d8a20-1e98-11e9-b9e7-93b3bd2eec90-ecs", - "panelIndex": "14", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": { - "vis": { - "legendOpen": true - } - }, - "gridData": { - "h": 12, - "i": "15", - "w": 24, - "x": 24, - "y": 22 - }, - "id": "8204e820-1e99-11e9-b9e7-93b3bd2eec90-ecs", - "panelIndex": "15", - "type": "visualization", - "version": "6.5.4" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 12, - "i": "16", - "w": 24, - "x": 0, - "y": 10 - }, - "id": "cdbf4110-1f0d-11e9-a673-d9577e5e50eb-ecs", - "panelIndex": "16", - "type": "visualization", - "version": "6.3.2" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 12, - "i": "17", - "w": 24, - "x": 0, - "y": 22 - }, - "id": "138dc660-1f1a-11e9-a673-d9577e5e50eb-ecs", - "panelIndex": "17", - "type": "visualization", - "version": "6.3.2" - }, - { - "embeddableConfig": {}, - "gridData": { - "h": 10, - "i": "18", - "w": 15, - "x": 33, - "y": 0 - }, - "id": "dff743a0-1f1c-11e9-a673-d9577e5e50eb-ecs", - "panelIndex": "18", - "type": "visualization", - "version": "6.3.2" - } - ], - "timeRestore": false, - "title": "[Metricbeat STAN] Overview ECS", - "version": 1 - }, - "id": "Metricbeat-STAN-Dashboard-ecs", - "type": "dashboard", - "updated_at": "2019-01-24T08:13:29.732Z", - "version": 4 - } - ], - "version": "6.3.2" -} From 8b38be41f506b4c7ec0c84e51b5851e887c4df6c Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 10 Dec 2019 12:02:55 +0200 Subject: [PATCH 24/34] fixes Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 2 +- x-pack/metricbeat/module/stan/channels/_meta/fields.yml | 3 +-- x-pack/metricbeat/module/stan/channels/channels.go | 3 --- .../module/stan/channels/channels_integration_test.go | 1 - x-pack/metricbeat/module/stan/channels/channels_test.go | 5 ++--- x-pack/metricbeat/module/stan/fields.go | 2 +- x-pack/metricbeat/module/stan/subscriptions/subscriptions.go | 3 --- .../stan/subscriptions/subscriptions_integration_test.go | 1 - .../module/stan/subscriptions/subscriptions_test.go | 5 ++--- 9 files changed, 7 insertions(+), 18 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 171a77110b96..486407380e68 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -29434,7 +29434,7 @@ type: long *`stan.channels.first_seq`*:: + -- -First sequence number stored in the channel +First sequence number stored in the channel. If first_seq > min([seq in subscriptions]) data loss has possibly occurred type: long diff --git a/x-pack/metricbeat/module/stan/channels/_meta/fields.yml b/x-pack/metricbeat/module/stan/channels/_meta/fields.yml index d7715b3767f8..aa0dc557761e 100644 --- a/x-pack/metricbeat/module/stan/channels/_meta/fields.yml +++ b/x-pack/metricbeat/module/stan/channels/_meta/fields.yml @@ -16,11 +16,10 @@ type: long description: > The number of STAN bytes in the channel -# If first_seq > min([seq in subscriptions]) data loss has possibly occurred - name: first_seq type: long description: > - First sequence number stored in the channel + First sequence number stored in the channel. If first_seq > min([seq in subscriptions]) data loss has possibly occurred - name: last_seq type: long description: > diff --git a/x-pack/metricbeat/module/stan/channels/channels.go b/x-pack/metricbeat/module/stan/channels/channels.go index 0f59b15a8d41..f5b0e1535044 100644 --- a/x-pack/metricbeat/module/stan/channels/channels.go +++ b/x-pack/metricbeat/module/stan/channels/channels.go @@ -11,8 +11,6 @@ import ( "github.com/elastic/beats/metricbeat/helper" "github.com/elastic/beats/metricbeat/mb" "github.com/elastic/beats/metricbeat/mb/parse" - - "github.com/elastic/beats/x-pack/metricbeat/module/stan" ) const ( @@ -70,7 +68,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { - _ = stan.AssetStan() content, err := m.http.FetchContent() if err != nil { return errors.Wrap(err, "error in fetch") diff --git a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go index ae2b8899690d..bd83bbdea471 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_integration_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_integration_test.go @@ -31,7 +31,6 @@ func TestFetch(t *testing.T) { t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) } assert.NotEmpty(t, events) - t.Logf("%s/%s event: %+v", m.Module().Name(), m.Name(), events[0]) } func getConfig(host string) map[string]interface{} { diff --git a/x-pack/metricbeat/module/stan/channels/channels_test.go b/x-pack/metricbeat/module/stan/channels/channels_test.go index 345eab9abe82..287b6f64f708 100644 --- a/x-pack/metricbeat/module/stan/channels/channels_test.go +++ b/x-pack/metricbeat/module/stan/channels/channels_test.go @@ -65,9 +65,8 @@ func TestFetchEventContent(t *testing.T) { metricSet := mbtest.NewReportingMetricSetV2Error(t, config) metricSet.Fetch(reporter) - for idx, evt := range reporter.GetEvents() { - e := mbtest.StandardizeEvent(metricSet, evt) - t.Logf("[%d] %s/%s event: %+v", idx, metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) + for _, evt := range reporter.GetEvents() { + mbtest.StandardizeEvent(metricSet, evt) } } diff --git a/x-pack/metricbeat/module/stan/fields.go b/x-pack/metricbeat/module/stan/fields.go index cb0b11364065..84c15e23e8af 100644 --- a/x-pack/metricbeat/module/stan/fields.go +++ b/x-pack/metricbeat/module/stan/fields.go @@ -19,5 +19,5 @@ func init() { // AssetStan returns asset data. // This is the base64 encoded gzipped contents of module/stan. func AssetStan() string { - return "eJy8l89u4zYQxu9+isH2kgBJc/dhiyDJAgFSF63dU1HsUuLIJkwNFc5oDffpC0qiIuvPbtCVqkNgyPR8vxlOviFv4YjnNbAoWgGIEYtr+LAVRR9WABo59aYQ42gNH1cAUK2EX50uLa4APFpUjGtIUNQKIDNoNa+rlbdAKsc2dnjkXOAa9t6VRfNmRCE8X8KPvkDqSJQhDjHEsJiUQQ5K4IQewaPSkHmXw0YJw1Y8qtzQHhj9V/Rwtd3db66bmF2yC7pq7c9Gt99EzCOeT85330/Ahmd3wCj7/DgQSW3JMpNKE2tU5qCI0PJApFvx70g8dEpOcAcUSsuxtHd1jv8Aki6cIYEcxZu0K9nvifj0d6BLHv5efDFdnu/wxzKFiOAykANC6IO3HGKZRkFyZFZ75FEY62j/H0jKPEEfWHoco1oRJDnLkhRVeDBU1adfkJ/gOYPMeJbPjK/wEXJDV3+Fj4aAy6QV47+vQStRYB0zHBRD4ZhNYs/g0rT0HvVocm3smRL8FOIB42uJlLa5sjiPeirJLo9Vs+K8qB+i0VjIYSaU30sssY4IiWLUUBaOoNobGkIq0nAw+wOygMfCeUEdd7xK4nL90E1FyTz248ieK5Rbi1/RjttRtFyPVgXSecwoJDGzG0XTvuvakKPM7Euvwg9r0XpkPd6//LZ5uoGHlz+3u6c/nh6vRzG9szNSPmcREvVNFbt2T8NATmPbt00iVy+oNPob+OSsdafw6UGRNloJjuOm1iDJuKUZEtx32undde252phGu6td31qUotOek5rfGNkLlGVMZKGJt2mlY2BQqQ/jQVlb47wGT1p+6r2R1MMudcRljvo9PENjm9jJxc9XXeGZ/M30rWHuo1bTb5fsV/U/52ejJ/xhZCIuhxZeXOAZBsXsUlMNkpPpTeBIWfXKcoyb+9221qjvOd8u6ZD5BkwGis7/31GuOTqRzHl2OpI70eBw0tToogT1bVAFkzlOEBZI2gwwftxVmrhvPlddRe9AXBcz6fl3pHJZZg2Nt1LinMX20vxOsGfuyUKu/DHYHUexX6aOO9biuCfMRFLvpzhIMMpdsqz+DQAA///HEYa1" + return "eJy8l0Fv4zYQhe/+FYPtJQGSzd2HLYIkCwRIXbROT0WxS4kjmzA1VDijNdxfX1AyFVmik6CVqkNgyPK8j0+TN+Q17PCwBBZFCwAxYnEJn9ai6NMCQCPn3lRiHC3hywIAmifhF6driwsAjxYV4xIyFLUAKAxazcvmyWsgVWJXO1xyqHAJG+/q6ngnoRCu7+FH3yF3JMoQhxpiWEzOIFslsEeP4FFpKLwrYaWEYS0eVWloA4z+B3q4WD/fri6PNftkJ3TNs5+N7r6JmDs87J3v3z8DG67nLUbZx/uRSG5rlolUjrWSMltFhJZHIn3H35G461lOcAMUrOVo7U27xr8BSVfOkECJ4k3elxz2RLyGb6BPHv6efHHennf4o02hIrgCZIsQ+uB1DdGmJEiJzGqDnISxjjb/gqQuM/SBZcCR1Iog2UHmpGjKg6HGn7cMKYxn+cb4MhHL11APGF9qpLzDYnEe9YDnMzwWr/rwBUpDF3+Gj4aA66zT4b8uQStRYB0zbBVD5ZhNZg/g8rz2HnVybVZNurQn9dGVJWk0VrKdCOW3GmtsK0KmGDXUlSNovKAxpCINW7PZIgt4rJwX1NHhZhGnz49DVJRMkzqO7KFBubb4A206hWLSerQqkE6TQWERE4dQzOqbfvo4Ksym9ir8sBVtJ9X97dOvq4cruHv6Y/388PvD/WUS0zs7IeVjESFRXzW129A0DOQ0dn17XMjFEyqN/gq+OmvdPny6U6SNVoJp3NwaJEknmSHBTa+dPuzrIMxSGt1b7efErBS99jyr+caknsGWlMhMg27VScfCoHIf4lhZ2+K8hEyaf9i9krQzLnfEdYn6IzzjYDvzJmffVvWFJ8o3M4yGqXdYx347Zb9o/zm/GX0mHxITcT60cOMEzzAoZpebZpDszWACR8qmV+ZjXN0+r1uN9njztqVj5iswBSg6dEI//U9bJ5Ip9047cnsabU6OHp1Y0B4CVQiZ3RnCCkmbEcZ/T5Vj3deca06gNyCuj5kN8jtSuaKwhtKtlDlnsTsrfxDskQeyUCq/C3HHUeznc9sdazGdCRORtO9THGQY5U5ZFv8EAAD//z+0hbY=" } diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go index 36bf81e14080..3cb29012424f 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go @@ -11,8 +11,6 @@ import ( "github.com/elastic/beats/metricbeat/helper" "github.com/elastic/beats/metricbeat/mb" "github.com/elastic/beats/metricbeat/mb/parse" - - "github.com/elastic/beats/x-pack/metricbeat/module/stan" ) const ( @@ -70,7 +68,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { - _ = stan.AssetStan() content, err := m.http.FetchContent() if err != nil { return errors.Wrap(err, "error in fetch") diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go index 2925463a3b8e..058fd2ada863 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_integration_test.go @@ -31,7 +31,6 @@ func TestFetch(t *testing.T) { t.Fatalf("Expected 0 error, had %d. %v\n", len(errs), errs) } assert.NotEmpty(t, events) - t.Logf("%s/%s event: %+v", m.Module().Name(), m.Name(), events[0]) } func getConfig(host string) map[string]interface{} { diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go index 3b370f7be3b7..cd49b3a1c894 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions_test.go @@ -44,9 +44,8 @@ func TestFetchEventContent(t *testing.T) { metricSet := mbtest.NewReportingMetricSetV2Error(t, config) metricSet.Fetch(reporter) - for idx, evt := range reporter.GetEvents() { - e := mbtest.StandardizeEvent(metricSet, evt) - t.Logf("[%d] %s/%s event: %+v", idx, metricSet.Module().Name(), metricSet.Name(), e.Fields.StringToPrint()) + for _, evt := range reporter.GetEvents() { + mbtest.StandardizeEvent(metricSet, evt) } } From 4701ec6c00a521c12211c2090f65bdb8216e3a11 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 10 Dec 2019 16:27:12 +0200 Subject: [PATCH 25/34] Add changelog entry Signed-off-by: chrismark --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 411c0f3b5743..a5312a2e78b4 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -447,6 +447,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Fix timezone parsing in haproxy pipeline. {pull}14755[14755] - Add module for ActiveMQ. {pull}14840[14840] - Add dashboards for the ActiveMQ Filebeat module. {pull}14880[14880] +- Add STAN Metricbeat module. {pull}14839[14839] *Heartbeat* - Add non-privileged icmp on linux and darwin(mac). {pull}13795[13795] {issue}11498[11498] From f2e028e0d50c90667ee689408aa48ba46ac6d174 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 11 Dec 2019 12:10:17 +0200 Subject: [PATCH 26/34] minor review improvements Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/channels/data.go | 10 +++++----- x-pack/metricbeat/module/stan/stats/data.go | 4 ++-- x-pack/metricbeat/module/stan/subscriptions/data.go | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/x-pack/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go index 1e54c5c16802..ba3ca97088a6 100644 --- a/x-pack/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -62,16 +62,16 @@ type Channels struct { Channels []Channel `json:"channels,omitempty"` } -// eventMapping map a channel to a Metricbeat event +// eventMapping maps a channel to a Metricbeat event func eventMapping(content map[string]interface{}) (mb.Event, error) { fields, err := channelSchema.Apply(content) if err != nil { - return mb.Event{}, errors.Wrap(err, "failure applying channels schema") + return mb.Event{}, errors.Wrap(err, "error applying channels schema") } moduleFields, err := moduleSchema.Apply(content) if err != nil { - return mb.Event{}, errors.Wrap(err, "failure applying module schema") + return mb.Event{}, errors.Wrap(err, "error applying module schema") } event := mb.Event{ @@ -85,7 +85,7 @@ func eventMapping(content map[string]interface{}) (mb.Event, error) { func eventsMapping(content []byte, r mb.ReporterV2) error { channelsIn := Channels{} if err := json.Unmarshal(content, &channelsIn); err != nil { - return errors.Wrap(err, "failure unmarshaling Nats streaming channels response to JSON") + return errors.Wrap(err, "error unmarshaling Nats streaming channels response to JSON") } for _, ch := range channelsIn.Channels { @@ -109,7 +109,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { } if evt, err = eventMapping(chWrapper); err != nil { - r.Error(errors.Wrap(err, "failure to map channel to its schema")) + r.Error(errors.Wrap(err, "error mapping channel to its schema")) } if !r.Event(evt) { return nil diff --git a/x-pack/metricbeat/module/stan/stats/data.go b/x-pack/metricbeat/module/stan/stats/data.go index 3b6e956c7018..a28412f78d0f 100644 --- a/x-pack/metricbeat/module/stan/stats/data.go +++ b/x-pack/metricbeat/module/stan/stats/data.go @@ -42,12 +42,12 @@ func eventMapping(content []byte, r mb.ReporterV2) error { fields, err := clientsSchema.Apply(streaming) if err != nil { - return errors.Wrap(err, "failure parsing Nats streaming server API response") + return errors.Wrap(err, "error parsing Nats streaming server API response") } moduleFields, err := moduleSchema.Apply(streaming) if err != nil { - return errors.Wrap(err, "failure applying module schema") + return errors.Wrap(err, "error applying module schema") } event := mb.Event{ MetricSetFields: fields, diff --git a/x-pack/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go index 15cfef5c987a..fd113e161d96 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -34,17 +34,17 @@ var ( } ) -// subscriptionsSchema used to parse through each subscription -// under a presumed channel +// eventMapping maps a subscription to a Metricbeat event using subscriptionsSchema +// to parse through each subscription under a presumed channel func eventMapping(content map[string]interface{}) (mb.Event, error) { fields, err := subscriptionsSchema.Apply(content) if err != nil { - return mb.Event{}, errors.Wrap(err, "failure applying subscription schema") + return mb.Event{}, errors.Wrap(err, "error applying subscription schema") } moduleFields, err := moduleSchema.Apply(content) if err != nil { - return mb.Event{}, errors.Wrap(err, "failure applying module schema") + return mb.Event{}, errors.Wrap(err, "error applying module schema") } event := mb.Event{ @@ -88,7 +88,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { var err error channels := Channels{} if err = json.Unmarshal(content, &channels); err != nil { - return errors.Wrap(err, "failure unmarshaling Nats streaming channels detailed response to JSON") + return errors.Wrap(err, "error unmarshaling Nats streaming channels detailed response to JSON") } for _, ch := range channels.Channels { From 3530321d6059d983968589d70fbfe2a1e42194c0 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 11 Dec 2019 12:21:53 +0200 Subject: [PATCH 27/34] remove commented out lines from Dockerfile Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/_meta/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/x-pack/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile index d07144957b5d..c5084d269a87 100644 --- a/x-pack/metricbeat/module/stan/_meta/Dockerfile +++ b/x-pack/metricbeat/module/stan/_meta/Dockerfile @@ -19,5 +19,3 @@ HEALTHCHECK --interval=1s --retries=10 CMD nc -w 1 0.0.0.0 8222 Date: Wed, 11 Dec 2019 13:30:35 +0200 Subject: [PATCH 28/34] improvements Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/_meta/Dockerfile | 2 +- x-pack/metricbeat/module/stan/channels/channels.go | 4 +--- x-pack/metricbeat/module/stan/channels/data.go | 1 + x-pack/metricbeat/module/stan/stats/stats.go | 4 +--- x-pack/metricbeat/module/stan/subscriptions/data.go | 1 + x-pack/metricbeat/module/stan/subscriptions/subscriptions.go | 4 +--- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/x-pack/metricbeat/module/stan/_meta/Dockerfile b/x-pack/metricbeat/module/stan/_meta/Dockerfile index c5084d269a87..12450435f0f2 100644 --- a/x-pack/metricbeat/module/stan/_meta/Dockerfile +++ b/x-pack/metricbeat/module/stan/_meta/Dockerfile @@ -5,7 +5,7 @@ FROM nats-streaming:$STAN_VERSION FROM golang:1.13-alpine AS build-env RUN apk --no-cache add build-base git bzr mercurial gcc RUN cd src && go get github.com/nats-io/stan.go/ -RUN cd src/github.com/nats-io/stan.go/examples/stan-bench && go build . +RUN cd src/github.com/nats-io/stan.go/examples/stan-bench && git checkout tags/v0.5.2 && go build . # create an enhanced container with nc command available since nats is based # on scratch image making healthcheck impossible diff --git a/x-pack/metricbeat/module/stan/channels/channels.go b/x-pack/metricbeat/module/stan/channels/channels.go index f5b0e1535044..f7c5b9aef6fd 100644 --- a/x-pack/metricbeat/module/stan/channels/channels.go +++ b/x-pack/metricbeat/module/stan/channels/channels.go @@ -64,9 +64,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { }, nil } -// Fetch methods implements the data gathering and data conversion to the right -// format. It publishes the event which is then forwarded to the output. In case -// of an error set the Error field of mb.Event or simply call report.Error(). +// Fetch implements the data gathering and data conversion to the right format. func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { content, err := m.http.FetchContent() if err != nil { diff --git a/x-pack/metricbeat/module/stan/channels/data.go b/x-pack/metricbeat/module/stan/channels/data.go index ba3ca97088a6..1be2b651eb5c 100644 --- a/x-pack/metricbeat/module/stan/channels/data.go +++ b/x-pack/metricbeat/module/stan/channels/data.go @@ -110,6 +110,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { if evt, err = eventMapping(chWrapper); err != nil { r.Error(errors.Wrap(err, "error mapping channel to its schema")) + continue } if !r.Event(evt) { return nil diff --git a/x-pack/metricbeat/module/stan/stats/stats.go b/x-pack/metricbeat/module/stan/stats/stats.go index 99afe8cc6980..65b7fb9ec3e6 100644 --- a/x-pack/metricbeat/module/stan/stats/stats.go +++ b/x-pack/metricbeat/module/stan/stats/stats.go @@ -62,9 +62,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { }, nil } -// Fetch methods implements the data gathering and data conversion to the right -// format. It publishes the event which is then forwarded to the output. In case -// of an error set the Error field of mb.Event or simply call report.Error(). +// Fetch implements the data gathering and data conversion to the right format. func (m *MetricSet) Fetch(r mb.ReporterV2) error { content, err := m.http.FetchContent() if err != nil { diff --git a/x-pack/metricbeat/module/stan/subscriptions/data.go b/x-pack/metricbeat/module/stan/subscriptions/data.go index fd113e161d96..cec4a71474c3 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/data.go +++ b/x-pack/metricbeat/module/stan/subscriptions/data.go @@ -100,6 +100,7 @@ func eventsMapping(content []byte, r mb.ReporterV2) error { evt, err = eventMapping(sub) if err != nil { r.Error(errors.Wrap(err, "error mapping subscription event")) + continue } if !r.Event(evt) { diff --git a/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go index 3cb29012424f..5449add589ec 100644 --- a/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go +++ b/x-pack/metricbeat/module/stan/subscriptions/subscriptions.go @@ -64,9 +64,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { }, nil } -// Fetch methods implements the data gathering and data conversion to the right -// format. It publishes the event which is then forwarded to the output. In case -// of an error set the Error field of mb.Event or simply call report.Error(). +// Fetch implements the data gathering and data conversion to the right format. func (m *MetricSet) Fetch(r mb.ReporterV2) (err error) { content, err := m.http.FetchContent() if err != nil { From c582e48e28d1aecd9720fed596d2da982360e7b4 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 12 Dec 2019 10:22:11 +0200 Subject: [PATCH 29/34] make update Signed-off-by: chrismark --- metricbeat/docs/fields.asciidoc | 132 ++++++++++++--------- metricbeat/docs/modules_list.asciidoc | 12 +- x-pack/metricbeat/include/list.go | 7 +- x-pack/metricbeat/metricbeat.reference.yml | 20 ++-- 4 files changed, 88 insertions(+), 83 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index e0942a613f01..9a56925639d9 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -62,8 +62,8 @@ grouped in the following categories: * <> * <> * <> -* <> * <> +* <> * <> * <> * <> @@ -24935,7 +24935,7 @@ type: long *`mysql.status.handler.read.last`*:: + -- -The number of requests to read the last key in an index. +The number of requests to read the last key in an index. type: long @@ -24965,7 +24965,7 @@ type: long *`mysql.status.handler.read.rnd`*:: + -- -The number of requests to read a row based on a fixed position. +The number of requests to read a row based on a fixed position. type: long @@ -24975,7 +24975,7 @@ type: long *`mysql.status.handler.read.rnd_next`*:: + -- -The number of requests to read the next row in the data file. +The number of requests to read the next row in the data file. type: long @@ -25073,7 +25073,7 @@ type: long *`mysql.status.innodb.buffer_pool.bytes.data`*:: + -- -The total number of bytes in the InnoDB buffer pool containing data. +The total number of bytes in the InnoDB buffer pool containing data. type: long @@ -28331,7 +28331,7 @@ format: bytes *`redis.info.memory.used.lua`*:: + -- -Used memory by the Lua engine. +Used memory by the Lua engine. type: long @@ -28343,7 +28343,7 @@ format: bytes *`redis.info.memory.used.dataset`*:: + -- -The size in bytes of the dataset +The size in bytes of the dataset type: long @@ -28588,7 +28588,7 @@ 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 +The size in bytes of copy-on-write allocations during the last RBD save operation type: long @@ -28717,7 +28717,7 @@ format: bytes *`redis.info.persistence.aof.size.current`*:: + -- -AOF current file size +AOF current file size type: long @@ -28823,7 +28823,7 @@ format: bytes *`redis.info.replication.backlog.first_byte_offset`*:: + -- -The master offset of the replication backlog buffer +The master offset of the replication backlog buffer type: long @@ -29458,14 +29458,71 @@ type: long -- +[[exported-fields-sql]] +== sql fields + +sql module + + + +[float] +=== sql + +`sql` fetches metrics from a SQL database + + + +[float] +=== query + +query + + + +*`sql.query.driver`*:: ++ +-- +Driver used to execute the query. + + +type: keyword + +-- + +*`sql.query.query`*:: ++ +-- +Query executed to collect metrics. + + +type: keyword + +-- + +*`sql.query.metrics.numeric.*`*:: ++ +-- +Numeric metrics collected. + + +type: object + +-- + +*`sql.query.metrics.string.*`*:: ++ +-- +Non-numeric values collected. + + +type: object + +-- + [[exported-fields-stan]] == Stan fields stan Module -======= -[[exported-fields-sql]] - -sql module @@ -29651,24 +29708,6 @@ Contains stan / nats streaming/serverz endpoint subscription metrics + -- The name of the STAN channel subscription (client_id) -======= -=== sql - -`sql` fetches metrics from a SQL database - - - -[float] -=== query - -query - - - -*`sql.query.driver`*:: -+ --- -Driver used to execute the query. type: keyword @@ -29679,11 +29718,6 @@ type: keyword + -- The name of the STAN channel the subscription is associated with -======= -*`sql.query.query`*:: -+ --- -Query executed to collect metrics. type: keyword @@ -29737,24 +29771,6 @@ Is the subscriber known to be stalled? type: boolean -======= -*`sql.query.metrics.numeric.*`*:: -+ --- -Numeric metrics collected. - - -type: object - --- - -*`sql.query.metrics.string.*`*:: -+ --- -Non-numeric values collected. - - -type: object -- @@ -32259,7 +32275,7 @@ type: keyword *`system.raid.sync_action`*:: + -- -Current sync action, if the RAID array is redundant +Current sync action, if the RAID array is redundant type: keyword @@ -32682,7 +32698,7 @@ All TCP connections *`system.socket.summary.tcp.memory`*:: + -- -Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. +Memory used by TCP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/tcp_mem. Only available on Linux. type: integer @@ -32828,7 +32844,7 @@ All UDP connections *`system.socket.summary.udp.memory`*:: + -- -Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. +Memory used by UDP sockets in bytes, based on number of allocated pages and system page size. Corresponds to limits set in /proc/sys/net/ipv4/udp_mem. Only available on Linux. type: integer diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index 343ca3ed6bcd..da3e9c1f5375 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -177,15 +177,12 @@ This file is generated! See scripts/mage/docs_collector.go .3+| .3+| |<> |<> |<> -<<<<<<< HEAD +|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | +.1+| .1+| |<> beta[] |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .3+| .3+| |<> beta[] |<> beta[] |<> beta[] -======= -|<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | -.1+| .1+| |<> beta[] ->>>>>>> upstream/master |<> beta[] |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> beta[] |<> |image:./images/icon-yes.png[Prebuilt dashboards are available] | @@ -270,11 +267,8 @@ include::modules/postgresql.asciidoc[] include::modules/prometheus.asciidoc[] include::modules/rabbitmq.asciidoc[] include::modules/redis.asciidoc[] -<<<<<<< HEAD -include::modules/stan.asciidoc[] -======= include::modules/sql.asciidoc[] ->>>>>>> upstream/master +include::modules/stan.asciidoc[] include::modules/statsd.asciidoc[] include::modules/system.asciidoc[] include::modules/tomcat.asciidoc[] diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index 8846414e44ee..60714ac4bd90 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -31,15 +31,12 @@ 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" -<<<<<<< HEAD + _ "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" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/channels" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/stats" _ "github.com/elastic/beats/x-pack/metricbeat/module/stan/subscriptions" -======= - _ "github.com/elastic/beats/x-pack/metricbeat/module/sql" - _ "github.com/elastic/beats/x-pack/metricbeat/module/sql/query" ->>>>>>> upstream/master _ "github.com/elastic/beats/x-pack/metricbeat/module/statsd" _ "github.com/elastic/beats/x-pack/metricbeat/module/statsd/server" _ "github.com/elastic/beats/x-pack/metricbeat/module/tomcat" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 54db8cfb33b5..6c62e6d563ad 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -906,16 +906,6 @@ metricbeat.modules: # Redis AUTH password. Empty by default. #password: foobared -<<<<<<< HEAD -#--------------------------------- Stan Module --------------------------------- -- module: stan - metricsets: ["stats", "channels", "subscriptions"] - period: 60s - hosts: ["localhost:8222"] - #stats.metrics_path: "/streaming/serverz" - #channels.metrics_path: "/streaming/channelsz" - #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint -======= #--------------------------------- Sql Module --------------------------------- - module: sql metricsets: @@ -927,7 +917,15 @@ metricbeat.modules: datasource: "user=myuser password=mypassword dbname=mydb sslmode=disable" sql_query: "select now()" ->>>>>>> upstream/master + +#--------------------------------- Stan Module --------------------------------- +- module: stan + metricsets: ["stats", "channels", "subscriptions"] + period: 60s + hosts: ["localhost:8222"] + #stats.metrics_path: "/streaming/serverz" + #channels.metrics_path: "/streaming/channelsz" + #subscriptions.metrics_path: "/streaming/channelsz" # we retrieve streaming subscriptions with a detailed query param to the channelsz endpoint #-------------------------------- Statsd Module -------------------------------- - module: statsd From bd20e7e62d40509dcb4cd2bb11d417342c1c7e09 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 12 Dec 2019 10:50:34 +0200 Subject: [PATCH 30/34] Move python test to module folder Signed-off-by: chrismark --- x-pack/metricbeat/docker-compose.yml | 18 ------------------ .../metricbeat/module/stan/docker-compose.yml | 11 +++++++++++ .../{tests/system => module/stan}/test_stan.py | 6 ++++-- 3 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 x-pack/metricbeat/module/stan/docker-compose.yml rename x-pack/metricbeat/{tests/system => module/stan}/test_stan.py (78%) diff --git a/x-pack/metricbeat/docker-compose.yml b/x-pack/metricbeat/docker-compose.yml index cb0543d6f69b..bc782381b803 100644 --- a/x-pack/metricbeat/docker-compose.yml +++ b/x-pack/metricbeat/docker-compose.yml @@ -32,21 +32,3 @@ services: - elasticsearch ports: - 5601 - - mssql: - image: docker.elastic.co/observability-ci/beats-integration-mssql:${MSSQL_VERSION:-2017-GA}-1 - build: - context: ./module/mssql/_meta - args: - MSSQL_VERSION: ${MSSQL_VERSION:-2017-GA} - ports: - - 1433 - - stan: - image: docker.elastic.co/observability-ci/beats-integration-stan:${STAN_VERSION:-0.15.1}-1 - build: - context: ./module/stan/_meta - args: - STAN_VERSION: ${STAN_VERSION:-0.15.1} - ports: - - 8222 diff --git a/x-pack/metricbeat/module/stan/docker-compose.yml b/x-pack/metricbeat/module/stan/docker-compose.yml new file mode 100644 index 000000000000..425bddb88e72 --- /dev/null +++ b/x-pack/metricbeat/module/stan/docker-compose.yml @@ -0,0 +1,11 @@ +version: '2.3' + +services: + stan: + image: docker.elastic.co/observability-ci/beats-integration-stan:${STAN_VERSION:-0.15.1}-1 + build: + context: ./module/stan/_meta + args: + STAN_VERSION: ${STAN_VERSION:-0.15.1} + ports: + - 8222 diff --git a/x-pack/metricbeat/tests/system/test_stan.py b/x-pack/metricbeat/module/stan/test_stan.py similarity index 78% rename from x-pack/metricbeat/tests/system/test_stan.py rename to x-pack/metricbeat/module/stan/test_stan.py index 45eb9ec1b8a9..8acd47984f91 100644 --- a/x-pack/metricbeat/tests/system/test_stan.py +++ b/x-pack/metricbeat/module/stan/test_stan.py @@ -1,9 +1,11 @@ import os -from xpack_metricbeat import XPackTest -import metricbeat +import sys import unittest from parameterized import parameterized +sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system')) +from xpack_metricbeat import XPackTest, metricbeat + STAN_FIELDS = metricbeat.COMMON_FIELDS + ["stan"] From 33e986ed8bbdff3500100fab6dc5a4d92b7e54a6 Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 12 Dec 2019 11:33:08 +0200 Subject: [PATCH 31/34] fix location of Dockefile Signed-off-by: chrismark --- x-pack/metricbeat/module/stan/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/stan/docker-compose.yml b/x-pack/metricbeat/module/stan/docker-compose.yml index 425bddb88e72..de9a709d5ca6 100644 --- a/x-pack/metricbeat/module/stan/docker-compose.yml +++ b/x-pack/metricbeat/module/stan/docker-compose.yml @@ -4,7 +4,7 @@ services: stan: image: docker.elastic.co/observability-ci/beats-integration-stan:${STAN_VERSION:-0.15.1}-1 build: - context: ./module/stan/_meta + context: ./_meta args: STAN_VERSION: ${STAN_VERSION:-0.15.1} ports: From e20c930b5f35ed8c4126b9b46aac8a62ed63087f Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 12 Dec 2019 13:28:25 +0200 Subject: [PATCH 32/34] keep output active so as to prevent Travis timeout Signed-off-by: chrismark --- dev-tools/mage/integtest.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev-tools/mage/integtest.go b/dev-tools/mage/integtest.go index 742d6ef0d3cd..779fac477fe0 100644 --- a/dev-tools/mage/integtest.go +++ b/dev-tools/mage/integtest.go @@ -27,6 +27,7 @@ import ( "strconv" "strings" "sync" + "time" "github.com/pkg/errors" @@ -219,6 +220,14 @@ func runInIntegTestEnv(mageTarget string, test func() error, passThroughEnvVars integTestLock.Lock() defer integTestLock.Unlock() + // keep output active so as to prevent Travis timeout + go func() { + for { + fmt.Print(".") + time.Sleep(60 * time.Second) + } + }() + _, err = sh.Exec( composeEnv, os.Stdout, From 82addd4de03dcf3f6f4628f43f3c11218905559b Mon Sep 17 00:00:00 2001 From: chrismark Date: Thu, 12 Dec 2019 17:45:00 +0200 Subject: [PATCH 33/34] Make use travis_wait Signed-off-by: chrismark --- .travis.yml | 2 +- dev-tools/mage/integtest.go | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bf2f8c2feb7..6e831f7e319d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,7 +108,7 @@ jobs: go: $TRAVIS_GO_VERSION stage: test - os: linux - env: TARGETS="-C x-pack/metricbeat testsuite" + env: TARGETS="-C x-pack/metricbeat travis_wait 40 testsuite" go: $TRAVIS_GO_VERSION stage: test diff --git a/dev-tools/mage/integtest.go b/dev-tools/mage/integtest.go index 779fac477fe0..742d6ef0d3cd 100644 --- a/dev-tools/mage/integtest.go +++ b/dev-tools/mage/integtest.go @@ -27,7 +27,6 @@ import ( "strconv" "strings" "sync" - "time" "github.com/pkg/errors" @@ -220,14 +219,6 @@ func runInIntegTestEnv(mageTarget string, test func() error, passThroughEnvVars integTestLock.Lock() defer integTestLock.Unlock() - // keep output active so as to prevent Travis timeout - go func() { - for { - fmt.Print(".") - time.Sleep(60 * time.Second) - } - }() - _, err = sh.Exec( composeEnv, os.Stdout, From a4bd16d16cf4cfb531cd4937b890d3fa7ec0c468 Mon Sep 17 00:00:00 2001 From: chrismark Date: Fri, 13 Dec 2019 00:07:09 +0200 Subject: [PATCH 34/34] Enable testing output Signed-off-by: chrismark --- .travis.yml | 2 +- dev-tools/mage/gotest.go | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e831f7e319d..8bf2f8c2feb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,7 +108,7 @@ jobs: go: $TRAVIS_GO_VERSION stage: test - os: linux - env: TARGETS="-C x-pack/metricbeat travis_wait 40 testsuite" + env: TARGETS="-C x-pack/metricbeat testsuite" go: $TRAVIS_GO_VERSION stage: test diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index b0b65142f102..5d876dd208b4 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -101,7 +101,10 @@ func GoTest(ctx context.Context, params GoTestArgs) error { fmt.Println(">> go test:", params.TestName, "Testing") // Build args list to Go. - args := []string{"test", "-v"} + args := []string{"test"} + if mg.Verbose() { + args = append(args, "-v") + } if params.Race { args = append(args, "-race") } @@ -123,9 +126,7 @@ func GoTest(ctx context.Context, params GoTestArgs) error { // Wire up the outputs. bufferOutput := new(bytes.Buffer) outputs := []io.Writer{bufferOutput} - if mg.Verbose() { - outputs = append(outputs, os.Stdout) - } + if params.OutputFile != "" { fileOutput, err := os.Create(createDir(params.OutputFile)) if err != nil { @@ -135,8 +136,8 @@ func GoTest(ctx context.Context, params GoTestArgs) error { outputs = append(outputs, fileOutput) } output := io.MultiWriter(outputs...) - goTest.Stdout = output - goTest.Stderr = output + goTest.Stdout = io.MultiWriter(output, os.Stdout) + goTest.Stderr = io.MultiWriter(output, os.Stderr) // Execute 'go test' and measure duration. start := time.Now()