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

Rabbitmq exchanges metricset #6607

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Making the MongoDB module GA. {pull}6554[6554]
- Allow to disable labels `dedot` in Docker module, in favor of a safe way to keep dots. {pull}6490[6490]
- Add experimental module to collect metrics from munin nodes. {pull}6517[6517]
- Add exchanges metricset to the RabbitMQ module {issue}6442[6442] {pull}6607[6607]

*Packetbeat*

Expand Down
175 changes: 175 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8818,6 +8818,181 @@ type: long
Number of octets received on the connection.


[float]
== exchange fields

exchange



[float]
=== `rabbitmq.exchange.name`

type: keyword

The name of the queue with non-ASCII characters escaped as in C.


[float]
=== `rabbitmq.exchange.vhost`

type: keyword

Virtual host name with non-ASCII characters escaped as in C.


[float]
=== `rabbitmq.exchange.durable`

type: boolean

Whether or not the queue survives server restarts.


[float]
=== `rabbitmq.exchange.auto_delete`

type: boolean

Whether the queue will be deleted automatically when no longer used.


[float]
=== `rabbitmq.exchange.internal`

type: boolean

Whether the exchange is internal, i.e. cannot be directly published to by a client.


[float]
=== `rabbitmq.exchange.messages.publish.count`

type: long

Count of messages published.


[float]
=== `rabbitmq.exchange.messages.publish.details.rate`

type: float

How much the exchange publish count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.publish_in.count`

type: long

Count of messages published "in" to an exchange, i.e. not taking account of routing.


[float]
=== `rabbitmq.exchange.messages.publish_in.details.rate`

type: float

How much the exchange publish-in count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.publish_out.count`

type: long

Count of messages published "out" of an exchange, i.e. taking account of routing.


[float]
=== `rabbitmq.exchange.messages.publish_out.details.rate`

type: float

How much the exchange publish-out count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.ack.count`

type: long

Count of acknowledged messages.


[float]
=== `rabbitmq.exchange.messages.ack.details.rate`

type: float

How much the exchange ack count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.deliver_get.count`

type: long

Count of all messages delivered to consumers.


[float]
=== `rabbitmq.exchange.messages.deliver_get.details.rate`

type: float

How much the exchange deliver-get count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.confirm.count`

type: long

Count of messages confirmed.


[float]
=== `rabbitmq.exchange.messages.confirm.details.rate`

type: float

How much the exchange confirm count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.return_unroutable.count`

type: long

Count of messages returned to publisher as unroutable.


[float]
=== `rabbitmq.exchange.messages.return_unroutable.details.rate`

type: float

How much the exchange return-unroutable count has changed per second in the most recent sampling interval.


[float]
=== `rabbitmq.exchange.messages.redeliver.count`

type: long

Count of subset of messages in deliver_get which had the redelivered flag set.


[float]
=== `rabbitmq.exchange.messages.redeliver.details.rate`

type: float

How much the exchange redeliver count has changed per second in the most recent sampling interval.


[float]
== node fields

Expand Down
6 changes: 5 additions & 1 deletion metricbeat/docs/modules/rabbitmq.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in <<configuration-metricbeat>>. Here is an example configuration:
----
metricbeat.modules:
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
metricsets: ["node", "queue", "connection", "exchange"]
Copy link
Member

Choose a reason for hiding this comment

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

Reminds me we should sort metricsets alphabetical (I can do that in a follow up PR).

period: 10s
hosts: ["localhost:15672"]

Expand All @@ -38,12 +38,16 @@ The following metricsets are available:

* <<metricbeat-metricset-rabbitmq-connection,connection>>

* <<metricbeat-metricset-rabbitmq-exchange,exchange>>

* <<metricbeat-metricset-rabbitmq-node,node>>

* <<metricbeat-metricset-rabbitmq-queue,queue>>

include::rabbitmq/connection.asciidoc[]

include::rabbitmq/exchange.asciidoc[]

include::rabbitmq/node.asciidoc[]

include::rabbitmq/queue.asciidoc[]
Expand Down
23 changes: 23 additions & 0 deletions metricbeat/docs/modules/rabbitmq/exchange.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-rabbitmq-exchange]]
=== RabbitMQ exchange metricset

beta[]

include::../../../module/rabbitmq/exchange/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-rabbitmq,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/rabbitmq/exchange/_meta/data.json[]
----
3 changes: 2 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ This file is generated! See scripts/docs_collector.py
.2+| |<<metricbeat-metricset-prometheus-collector,collector>> beta[]
|<<metricbeat-metricset-prometheus-stats,stats>> beta[]
|<<metricbeat-module-rabbitmq,RabbitMQ>> beta[] |
.3+| |<<metricbeat-metricset-rabbitmq-connection,connection>> beta[]
.4+| |<<metricbeat-metricset-rabbitmq-connection,connection>> beta[]
|<<metricbeat-metricset-rabbitmq-exchange,exchange>> beta[]
|<<metricbeat-metricset-rabbitmq-node,node>> beta[]
|<<metricbeat-metricset-rabbitmq-queue,queue>> beta[]
|<<metricbeat-module-redis,Redis>> |
Expand Down
1 change: 1 addition & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import (
_ "github.com/elastic/beats/metricbeat/module/prometheus/stats"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/connection"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/exchange"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/node"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/queue"
_ "github.com/elastic/beats/metricbeat/module/redis"
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ metricbeat.modules:

#------------------------------ RabbitMQ Module ------------------------------
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
metricsets: ["node", "queue", "connection", "exchange"]
period: 10s
hosts: ["localhost:15672"]

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/rabbitmq/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- module: rabbitmq
metricsets: ["node", "queue", "connection"]
metricsets: ["node", "queue", "connection", "exchange"]
period: 10s
hosts: ["localhost:15672"]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[
{
"message_stats": {
"publish": 123,
"publish_details": {
"rate": 0.1
},
"publish_in": 100,
"publish_in_details": {
"rate": 0.5
},
"publish_out": 99,
"publish_out_details": {
"rate": 0.9
},
"ack": 60,
"ack_details": {
"rate": 12.5
},
"deliver_get": 50,
"deliver_get_details": {
"rate": 43.21
},
"confirm": 120,
"confirm_details": {
"rate": 98.63
},
"return_unroutable": 40,
"return_unroutable_details": {
"rate": 123
},
"redeliver": 30,
"redeliver_details": {
"rate": 0
}
},
"name": "exchange.name",
"vhost": "/",
"type": "fanout",
"durable": true,
"auto_delete": false,
"internal": false,
"arguments": {}
}
]
19 changes: 19 additions & 0 deletions metricbeat/module/rabbitmq/exchange/_meta/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Any chance you could create a data.json here? The command you need is as following:

go test -tags=integration github.com/elastic/beats/metricbeat/module/rabbitmq/exchange/... -data

It assumes you have rabbitmq running on localhost.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This command does not generate the full json file (the message stats are missing). Am I missing something?

{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "beat": {
        "hostname": "host.example.com",
        "name": "host.example.com"
    },
    "metricset": {
        "host": "localhost:15672",
        "module": "rabbitmq",
        "name": "exchange",
        "rtt": 115
    },
    "rabbitmq": {
        "exchange": {
            "arguments": {},
            "auto_delete": false,
            "durable": true,
            "internal": false,
            "name": "",
            "type": "direct",
            "vhost": "/"
        }
    }
}

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if something is wrong in the metricset if they are missing?

"@timestamp":"2016-05-23T08:05:34.853Z",
"beat":{
"hostname":"beathost",
"name":"beathost"
},
"metricset":{
"host":"localhost",
"module":"rabbitmq",
"name":"exchange",
"rtt":44269
},
"rabbitmq":{
"exchange":{
"example": "exchange"
}
},
"type":"metricsets"
}
3 changes: 3 additions & 0 deletions metricbeat/module/rabbitmq/exchange/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
=== rabbitmq exchange MetricSet

This is the exchange metricset of the module rabbitmq.
Loading