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

Basic RabbitMQ queues metricset #4788

Merged
merged 12 commits into from
Sep 27, 2017
2 changes: 1 addition & 1 deletion metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kibana:

# Collects all module and metricset fields
.PHONY: fields
fields:
fields: python-env
@mkdir -p _meta
@cp ${ES_BEATS}/metricbeat/_meta/fields.common.yml _meta/fields.generated.yml
@${PYTHON_ENV}/bin/python ${ES_BEATS}/metricbeat/scripts/fields_collector.py >> _meta/fields.generated.yml
Expand Down
19 changes: 19 additions & 0 deletions metricbeat/docs/modules/rabbitmq/queues.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-rabbitmq-queues]]
include::../../../module/rabbitmq/queues/_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/queues/_meta/data.json[]
----
1 change: 1 addition & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import (
_ "github.com/elastic/beats/metricbeat/module/prometheus/stats"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/node"
_ "github.com/elastic/beats/metricbeat/module/rabbitmq/queue"
_ "github.com/elastic/beats/metricbeat/module/redis"
_ "github.com/elastic/beats/metricbeat/module/redis/info"
_ "github.com/elastic/beats/metricbeat/module/redis/keyspace"
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ metricbeat.modules:

#------------------------------ RabbitMQ Module ------------------------------
- module: rabbitmq
metricsets: ["node"]
metricsets: ["node", "queue"]
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"]
metricsets: ["node", "queue"]
period: 10s
hosts: ["localhost:15672"]

Expand Down
145 changes: 145 additions & 0 deletions metricbeat/module/rabbitmq/_meta/testdata/queue_sample_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
[
{
"memory": 232720,
"message_stats": {
"disk_reads": 212,
"disk_reads_details": {
"rate": 0
},
"disk_writes": 121,
"disk_writes_details": {
"rate": 0
},
"deliver": 15,
"deliver_details": {
"rate": 0
},
"deliver_no_ack": 0,
"deliver_no_ack_details": {
"rate": 0
},
"get": 0,
"get_details": {
"rate": 0
},
"get_no_ack": 38,
"get_no_ack_details": {
"rate": 0
},
"publish": 121,
"publish_details": {
"rate": 0
},
"publish_in": 0,
"publish_in_details": {
"rate": 0
},
"publish_out": 0,
"publish_out_details": {
"rate": 0
},
"ack": 9,
"ack_details": {
"rate": 0
},
"deliver_get": 53,
"deliver_get_details": {
"rate": 0
},
"confirm": 0,
"confirm_details": {
"rate": 0
},
"return_unroutable": 0,
"return_unroutable_details": {
"rate": 0
},
"redeliver": 3,
"redeliver_details": {
"rate": 0
}
},
"reductions": 787128,
"reductions_details": {
"rate": 0
},
"messages": 74,
"messages_details": {
"rate": 0
},
"messages_ready": 71,
"messages_ready_details": {
"rate": 0
},
"messages_unacknowledged": 3,
"messages_unacknowledged_details": {
"rate": 0
},
"idle_since": "2017-07-28 23:45:52",
"consumer_utilisation": 0.7,
"policy": null,
"exclusive_consumer_tag": null,
"consumers": 3,
"recoverable_slaves": null,
"state": "running",
"garbage_collection": {
"min_bin_vheap_size": 46422,
"min_heap_size": 233,
"fullsweep_after": 65535,
"minor_gcs": 0
},
"messages_ram": 74,
"messages_ready_ram": 71,
"messages_unacknowledged_ram": 3,
"messages_persistent": 73,
"message_bytes": 101824,
"message_bytes_ready": 97696,
"message_bytes_unacknowledged": 4128,
"message_bytes_ram": 101824,
"message_bytes_persistent": 101824,
"head_message_timestamp": 1501250275,
"disk_reads": 212,
"disk_writes": 121,
"backing_queue_status": {
"priority_lengths": {
"0": 0,
"1": 71,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0
},
"mode": "default",
"q1": 0,
"q2": 0,
"delta": [
"delta",
"todo",
"todo",
"todo"
],
"q3": 0,
"q4": 71,
"len": 71,
"target_ram_count": "infinity",
"next_seq_id": 121,
"avg_ingress_rate": 0,
"avg_egress_rate": 0.00019793395296866087,
"avg_ack_ingress_rate": 0.00019793395296866087,
"avg_ack_egress_rate": 0.00019793395296866087
},
"node": "rabbit@localhost",
"arguments": {
"x-max-priority": 9
},
"exclusive": false,
"auto_delete": false,
"durable": true,
"vhost": "/",
"name": "queuenamehere"
}
]
134 changes: 119 additions & 15 deletions metricbeat/module/rabbitmq/node/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,123 @@
{
"@timestamp":"2016-05-23T08:05:34.853Z",
"beat":{
"hostname":"beathost",
"name":"beathost"
"@timestamp": "2017-08-21T21:06:45.009Z",
"@metadata": {
"beat": "metricbeat",
"type": "doc"
},
"metricset":{
"host":"localhost",
"module":"rabbitmq",
"name":"node",
"rtt":44269
},
"rabbitmq":{
"node":{
"example": "node"
"rabbitmq": {
"node": {
"queue": {
"index": {
"journal_write": {
"count": 676
},
"read": {},
"write": {
"count": 92
}
}
},
"processors": 8,
"msg": {
"store_read": {},
"store_write": {}
},
"run": {
"queue": 0
},
"type": "disc",
"disk": {
"free": {
"bytes": 17315815424,
"limit": {
"bytes": 50000000
}
}
},
"mnesia": {
"ram": {
"tx": {
"count": 87
}
},
"disk": {
"tx": {
"count": 740
}
}
},
"socket": {
"used": 0,
"total": 138
},
"uptime": 888613658,
"io": {
"file_handle": {
"open_attempt": {
"avg": {}
}
},
"read": {
"count": 1,
"avg": {
"ms": 0
},
"bytes": 1
},
"reopen": {
"count": 1
},
"seek": {
"count": 450,
"avg": {
"ms": 7
}
},
"sync": {
"count": 531,
"avg": {
"ms": 0
}
},
"write": {
"avg": {
"ms": 0
},
"bytes": 346498,
"count": 531
}
},
"fd": {
"total": 256
},
"gc": {
"reclaimed": {},
"num": {}
},
"name": "rabbit@localhost",
"proc": {
"total": 1048576,
"used": 252
},
"mem": {
"limit": {
"bytes": 6309860147
},
"used": {
"bytes": 62095872
}
}
}
},
"metricset": {
"module": "rabbitmq",
"name": "node",
"host": "localhost:15672",
"rtt": 30110
},
"type":"metricsets"
}
"beat": {
"name": "name",
"hostname": "hostname",
"version": "7.0.0-alpha1"
}
}
Loading