Skip to content

Commit 9b732fb

Browse files
authored
Merge pull request #180 from jiangxinlingdu/add-rate-metrics
add some metrics about rate
2 parents ee57f5f + 1f16d2b commit 9b732fb

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

exporter_overview.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ var (
1515
overviewLabels = []string{"cluster"}
1616

1717
overviewMetricDescription = map[string]*prometheus.GaugeVec{
18-
"object_totals.channels": newGaugeVec("channels", "Number of channels.", overviewLabels),
19-
"object_totals.connections": newGaugeVec("connections", "Number of connections.", overviewLabels),
20-
"object_totals.consumers": newGaugeVec("consumers", "Number of message consumers.", overviewLabels),
21-
"object_totals.queues": newGaugeVec("queues", "Number of queues in use.", overviewLabels),
22-
"object_totals.exchanges": newGaugeVec("exchanges", "Number of exchanges in use.", overviewLabels),
23-
"queue_totals.messages": newGaugeVec("queue_messages_global", "Number ready and unacknowledged messages in cluster.", overviewLabels),
24-
"queue_totals.messages_ready": newGaugeVec("queue_messages_ready_global", "Number of messages ready to be delivered to clients.", overviewLabels),
25-
"queue_totals.messages_unacknowledged": newGaugeVec("queue_messages_unacknowledged_global", "Number of messages delivered to clients but not yet acknowledged.", overviewLabels),
18+
"object_totals.channels": newGaugeVec("channels", "Number of channels.", overviewLabels),
19+
"object_totals.connections": newGaugeVec("connections", "Number of connections.", overviewLabels),
20+
"object_totals.consumers": newGaugeVec("consumers", "Number of message consumers.", overviewLabels),
21+
"object_totals.queues": newGaugeVec("queues", "Number of queues in use.", overviewLabels),
22+
"object_totals.exchanges": newGaugeVec("exchanges", "Number of exchanges in use.", overviewLabels),
23+
"queue_totals.messages": newGaugeVec("queue_messages_global", "Number ready and unacknowledged messages in cluster.", overviewLabels),
24+
"queue_totals.messages_ready": newGaugeVec("queue_messages_ready_global", "Number of messages ready to be delivered to clients.", overviewLabels),
25+
"queue_totals.messages_unacknowledged": newGaugeVec("queue_messages_unacknowledged_global", "Number of messages delivered to clients but not yet acknowledged.", overviewLabels),
26+
"message_stats.publish_details.rate": newGaugeVec("messages_publish_rate", "Rate at which messages are entering the server.", overviewLabels),
27+
"message_stats.deliver_no_ack_details.rate": newGaugeVec("messages_deliver_no_ack_rate", "Rate at which messages are delivered to consumers that use automatic acknowledgements.", overviewLabels),
28+
"message_stats.deliver_details.rate": newGaugeVec("messages_deliver_rate", "Rate at which messages are delivered to consumers that use manual acknowledgements.", overviewLabels),
2629
}
2730

2831
rabbitmqVersionMetric = prometheus.NewGaugeVec(

exporter_queue.go

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,32 @@ var (
1818
queueLabelKeys = []string{"vhost", "name", "durable", "policy", "state", "node", "idle_since"}
1919

2020
queueGaugeVec = map[string]*prometheus.GaugeVec{
21-
"messages_ready": newGaugeVec("queue_messages_ready", "Number of messages ready to be delivered to clients.", queueLabels),
22-
"messages_unacknowledged": newGaugeVec("queue_messages_unacknowledged", "Number of messages delivered to clients but not yet acknowledged.", queueLabels),
23-
"messages": newGaugeVec("queue_messages", "Sum of ready and unacknowledged messages (queue depth).", queueLabels),
24-
"messages_ready_ram": newGaugeVec("queue_messages_ready_ram", "Number of messages from messages_ready which are resident in ram.", queueLabels),
25-
"messages_unacknowledged_ram": newGaugeVec("queue_messages_unacknowledged_ram", "Number of messages from messages_unacknowledged which are resident in ram.", queueLabels),
26-
"messages_ram": newGaugeVec("queue_messages_ram", "Total number of messages which are resident in ram.", queueLabels),
27-
"messages_persistent": newGaugeVec("queue_messages_persistent", "Total number of persistent messages in the queue (will always be 0 for transient queues).", queueLabels),
28-
"message_bytes": newGaugeVec("queue_message_bytes", "Sum of the size of all message bodies in the queue. This does not include the message properties (including headers) or any overhead.", queueLabels),
29-
"message_bytes_ready": newGaugeVec("queue_message_bytes_ready", "Like message_bytes but counting only those messages ready to be delivered to clients.", queueLabels),
30-
"message_bytes_unacknowledged": newGaugeVec("queue_message_bytes_unacknowledged", "Like message_bytes but counting only those messages delivered to clients but not yet acknowledged.", queueLabels),
31-
"message_bytes_ram": newGaugeVec("queue_message_bytes_ram", "Like message_bytes but counting only those messages which are in RAM.", queueLabels),
32-
"message_bytes_persistent": newGaugeVec("queue_message_bytes_persistent", "Like message_bytes but counting only those messages which are persistent.", queueLabels),
33-
"consumers": newGaugeVec("queue_consumers", "Number of consumers.", queueLabels),
34-
"consumer_utilisation": newGaugeVec("queue_consumer_utilisation", "Fraction of the time (between 0.0 and 1.0) that the queue is able to immediately deliver messages to consumers. This can be less than 1.0 if consumers are limited by network congestion or prefetch count.", queueLabels),
35-
"memory": newGaugeVec("queue_memory", "Bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures.", queueLabels),
36-
"head_message_timestamp": newGaugeVec("queue_head_message_timestamp", "The timestamp property of the first message in the queue, if present. Timestamps of messages only appear when they are in the paged-in state.", queueLabels), //https://github.com/rabbitmq/rabbitmq-server/pull/54
37-
"arguments.x-max-length-bytes": newGaugeVec("queue_max_length_bytes", "Total body size for ready messages a queue can contain before it starts to drop them from its head.", queueLabels),
38-
"arguments.x-max-length": newGaugeVec("queue_max_length", "How many (ready) messages a queue can contain before it starts to drop them from its head.", queueLabels),
39-
"garbage_collection.min_heap_size": newGaugeVec("queue_gc_min_heap", "Minimum heap size in words", queueLabels),
40-
"garbage_collection.min_bin_vheap_size": newGaugeVec("queue_gc_min_vheap", "Minimum binary virtual heap size in words", queueLabels),
41-
"garbage_collection.fullsweep_after": newGaugeVec("queue_gc_collections_before_fullsweep", "Maximum generational collections before fullsweep", queueLabels),
42-
"slave_nodes_len": newGaugeVec("queue_slaves_nodes_len", "Number of slave nodes attached to the queue", queueLabels),
43-
"synchronised_slave_nodes_len": newGaugeVec("queue_synchronised_slave_nodes_len", "Number of slave nodes in sync to the queue", queueLabels),
21+
"messages_ready": newGaugeVec("queue_messages_ready", "Number of messages ready to be delivered to clients.", queueLabels),
22+
"messages_unacknowledged": newGaugeVec("queue_messages_unacknowledged", "Number of messages delivered to clients but not yet acknowledged.", queueLabels),
23+
"messages": newGaugeVec("queue_messages", "Sum of ready and unacknowledged messages (queue depth).", queueLabels),
24+
"messages_ready_ram": newGaugeVec("queue_messages_ready_ram", "Number of messages from messages_ready which are resident in ram.", queueLabels),
25+
"messages_unacknowledged_ram": newGaugeVec("queue_messages_unacknowledged_ram", "Number of messages from messages_unacknowledged which are resident in ram.", queueLabels),
26+
"messages_ram": newGaugeVec("queue_messages_ram", "Total number of messages which are resident in ram.", queueLabels),
27+
"messages_persistent": newGaugeVec("queue_messages_persistent", "Total number of persistent messages in the queue (will always be 0 for transient queues).", queueLabels),
28+
"message_bytes": newGaugeVec("queue_message_bytes", "Sum of the size of all message bodies in the queue. This does not include the message properties (including headers) or any overhead.", queueLabels),
29+
"message_bytes_ready": newGaugeVec("queue_message_bytes_ready", "Like message_bytes but counting only those messages ready to be delivered to clients.", queueLabels),
30+
"message_bytes_unacknowledged": newGaugeVec("queue_message_bytes_unacknowledged", "Like message_bytes but counting only those messages delivered to clients but not yet acknowledged.", queueLabels),
31+
"message_bytes_ram": newGaugeVec("queue_message_bytes_ram", "Like message_bytes but counting only those messages which are in RAM.", queueLabels),
32+
"message_bytes_persistent": newGaugeVec("queue_message_bytes_persistent", "Like message_bytes but counting only those messages which are persistent.", queueLabels),
33+
"consumers": newGaugeVec("queue_consumers", "Number of consumers.", queueLabels),
34+
"consumer_utilisation": newGaugeVec("queue_consumer_utilisation", "Fraction of the time (between 0.0 and 1.0) that the queue is able to immediately deliver messages to consumers. This can be less than 1.0 if consumers are limited by network congestion or prefetch count.", queueLabels),
35+
"memory": newGaugeVec("queue_memory", "Bytes of memory consumed by the Erlang process associated with the queue, including stack, heap and internal structures.", queueLabels),
36+
"head_message_timestamp": newGaugeVec("queue_head_message_timestamp", "The timestamp property of the first message in the queue, if present. Timestamps of messages only appear when they are in the paged-in state.", queueLabels), //https://github.com/rabbitmq/rabbitmq-server/pull/54
37+
"arguments.x-max-length-bytes": newGaugeVec("queue_max_length_bytes", "Total body size for ready messages a queue can contain before it starts to drop them from its head.", queueLabels),
38+
"arguments.x-max-length": newGaugeVec("queue_max_length", "How many (ready) messages a queue can contain before it starts to drop them from its head.", queueLabels),
39+
"garbage_collection.min_heap_size": newGaugeVec("queue_gc_min_heap", "Minimum heap size in words", queueLabels),
40+
"garbage_collection.min_bin_vheap_size": newGaugeVec("queue_gc_min_vheap", "Minimum binary virtual heap size in words", queueLabels),
41+
"garbage_collection.fullsweep_after": newGaugeVec("queue_gc_collections_before_fullsweep", "Maximum generational collections before fullsweep", queueLabels),
42+
"slave_nodes_len": newGaugeVec("queue_slaves_nodes_len", "Number of slave nodes attached to the queue", queueLabels),
43+
"synchronised_slave_nodes_len": newGaugeVec("queue_synchronised_slave_nodes_len", "Number of slave nodes in sync to the queue", queueLabels),
44+
"message_stats.publish_details.rate": newGaugeVec("queue_messages_publish_rate", "Rate at which messages are entering the server.", queueLabels),
45+
"message_stats.deliver_no_ack_details.rate": newGaugeVec("queue_messages_deliver_no_ack_rate", "Rate at which messages are delivered to consumers that use automatic acknowledgements.", queueLabels),
46+
"message_stats.deliver_details.rate": newGaugeVec("queue_messages_deliver_rate", "Rate at which messages are delivered to consumers that use manual acknowledgements.", queueLabels),
4447
}
4548

4649
queueCounterVec = map[string]*prometheus.Desc{

0 commit comments

Comments
 (0)