Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default metricsets for rabbitmq module #6743

Merged
merged 1 commit into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make the other 2 metricsets beta?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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