Skip to content

Commit

Permalink
Set all metricsets as default for rabbitmq module
Browse files Browse the repository at this point in the history
Warning messages about metricsets being experimental changed to beta to
match documentation.
  • Loading branch information
jsoriano committed Apr 4, 2018
1 parent 90af715 commit 5d9452c
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 28 deletions.
6 changes: 1 addition & 5 deletions metricbeat/docs/modules/rabbitmq.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -21,12 +22,7 @@ in <<configuration-metricbeat>>. 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 <<configuration-ssl>>.
Expand Down
5 changes: 3 additions & 2 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions metricbeat/module/rabbitmq/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
enabled: true
period: 10s
hosts: ["localhost:15672"]

#username: guest
#password: guest
5 changes: 0 additions & 5 deletions metricbeat/module/rabbitmq/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
period: 10s
hosts: ["localhost:15672"]

username: guest
password: guest
1 change: 1 addition & 0 deletions metricbeat/module/rabbitmq/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -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`.
7 changes: 4 additions & 3 deletions metricbeat/module/rabbitmq/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions metricbeat/module/rabbitmq/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions metricbeat/module/rabbitmq/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions metricbeat/modules.d/rabbitmq.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
period: 10s
hosts: ["localhost:15672"]

username: guest
password: guest

0 comments on commit 5d9452c

Please sign in to comment.