diff --git a/metricbeat/docs/modules/rabbitmq.asciidoc b/metricbeat/docs/modules/rabbitmq.asciidoc index c2b43e200aa..dd8b98bcd17 100644 --- a/metricbeat/docs/modules/rabbitmq.asciidoc +++ b/metricbeat/docs/modules/rabbitmq.asciidoc @@ -9,6 +9,7 @@ beta[] The RabbitMQ module uses http://www.rabbitmq.com/management.html[HTTP API] created by the management plugin to collect metrics. +The default metricsets are `connection`, `node` and `queue`. [float] @@ -21,12 +22,7 @@ in <>. Here is an example configuration: ---- metricbeat.modules: - module: rabbitmq - metricsets: ["node", "queue", "connection"] - period: 10s hosts: ["localhost:15672"] - - username: guest - password: guest ---- This module supports TLS connection when using `ssl` config field, as described in <>. diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 548d0bad0fd..6efc1490e86 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -435,11 +435,12 @@ metricbeat.modules: #------------------------------ RabbitMQ Module ------------------------------ - module: rabbitmq metricsets: ["node", "queue", "connection"] + enabled: true period: 10s hosts: ["localhost:15672"] - username: guest - password: guest + #username: guest + #password: guest #-------------------------------- Redis Module ------------------------------- - module: redis diff --git a/metricbeat/module/rabbitmq/_meta/config.reference.yml b/metricbeat/module/rabbitmq/_meta/config.reference.yml new file mode 100644 index 00000000000..62bf0879d1e --- /dev/null +++ b/metricbeat/module/rabbitmq/_meta/config.reference.yml @@ -0,0 +1,8 @@ +- module: rabbitmq + metricsets: ["node", "queue", "connection"] + enabled: true + period: 10s + hosts: ["localhost:15672"] + + #username: guest + #password: guest diff --git a/metricbeat/module/rabbitmq/_meta/config.yml b/metricbeat/module/rabbitmq/_meta/config.yml index 245e531b6fd..b5912718c76 100644 --- a/metricbeat/module/rabbitmq/_meta/config.yml +++ b/metricbeat/module/rabbitmq/_meta/config.yml @@ -1,7 +1,2 @@ - module: rabbitmq - metricsets: ["node", "queue", "connection"] - period: 10s hosts: ["localhost:15672"] - - username: guest - password: guest diff --git a/metricbeat/module/rabbitmq/_meta/docs.asciidoc b/metricbeat/module/rabbitmq/_meta/docs.asciidoc index 2dbfe35c716..f6fac935416 100644 --- a/metricbeat/module/rabbitmq/_meta/docs.asciidoc +++ b/metricbeat/module/rabbitmq/_meta/docs.asciidoc @@ -1,2 +1,3 @@ The RabbitMQ module uses http://www.rabbitmq.com/management.html[HTTP API] created by the management plugin to collect metrics. +The default metricsets are `connection`, `node` and `queue`. diff --git a/metricbeat/module/rabbitmq/connection/connection.go b/metricbeat/module/rabbitmq/connection/connection.go index 2697205a36f..6050ea5d0ff 100644 --- a/metricbeat/module/rabbitmq/connection/connection.go +++ b/metricbeat/module/rabbitmq/connection/connection.go @@ -21,9 +21,10 @@ var ( ) func init() { - if err := mb.Registry.AddMetricSet("rabbitmq", "connection", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("rabbitmq", "connection", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } // MetricSet for fetching RabbitMQ connections. diff --git a/metricbeat/module/rabbitmq/node/node.go b/metricbeat/module/rabbitmq/node/node.go index 601a93cf358..f24dc13f985 100644 --- a/metricbeat/module/rabbitmq/node/node.go +++ b/metricbeat/module/rabbitmq/node/node.go @@ -21,9 +21,10 @@ var ( ) func init() { - if err := mb.Registry.AddMetricSet("rabbitmq", "node", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("rabbitmq", "node", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } type MetricSet struct { @@ -32,7 +33,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - cfgwarn.Experimental("The rabbitmq node metricset is experimental") + cfgwarn.Beta("The rabbitmq node metricset is beta") http, err := helper.NewHTTP(base) if err != nil { diff --git a/metricbeat/module/rabbitmq/queue/queue.go b/metricbeat/module/rabbitmq/queue/queue.go index bcd4bdded4a..37582943692 100644 --- a/metricbeat/module/rabbitmq/queue/queue.go +++ b/metricbeat/module/rabbitmq/queue/queue.go @@ -21,9 +21,10 @@ var ( ) func init() { - if err := mb.Registry.AddMetricSet("rabbitmq", "queue", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("rabbitmq", "queue", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } type MetricSet struct { @@ -32,7 +33,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - cfgwarn.Experimental("The rabbitmq queue metricset is experimental") + cfgwarn.Beta("The rabbitmq queue metricset is beta") http, err := helper.NewHTTP(base) if err != nil { diff --git a/metricbeat/modules.d/rabbitmq.yml.disabled b/metricbeat/modules.d/rabbitmq.yml.disabled index 245e531b6fd..b5912718c76 100644 --- a/metricbeat/modules.d/rabbitmq.yml.disabled +++ b/metricbeat/modules.d/rabbitmq.yml.disabled @@ -1,7 +1,2 @@ - module: rabbitmq - metricsets: ["node", "queue", "connection"] - period: 10s hosts: ["localhost:15672"] - - username: guest - password: guest