github.com/netdata/go.d.plugin@v0.58.1/modules/rabbitmq/metrics.go (about) 1 // SPDX-License-Identifier: GPL-3.0-or-later 2 3 package rabbitmq 4 5 // https://www.rabbitmq.com/monitoring.html#cluster-wide-metrics 6 type overviewStats struct { 7 ObjectTotals struct { 8 Consumers int64 `json:"consumers" stm:"consumers"` 9 Queues int64 `json:"queues" stm:"queues"` 10 Exchanges int64 `json:"exchanges" stm:"exchanges"` 11 Connections int64 `json:"connections" stm:"connections"` 12 Channels int64 `json:"channels" stm:"channels"` 13 } `json:"object_totals" stm:"object_totals"` 14 ChurnRates struct { 15 ChannelClosed int64 `json:"channel_closed" stm:"channel_closed"` 16 ChannelCreated int64 `json:"channel_created" stm:"channel_created"` 17 ConnectionClosed int64 `json:"connection_closed" stm:"connection_closed"` 18 ConnectionCreated int64 `json:"connection_created" stm:"connection_created"` 19 QueueCreated int64 `json:"queue_created" stm:"queue_created"` 20 QueueDeclared int64 `json:"queue_declared" stm:"queue_declared"` 21 QueueDeleted int64 `json:"queue_deleted" stm:"queue_deleted"` 22 } `json:"churn_rates" stm:"churn_rates"` 23 QueueTotals struct { 24 Messages int64 `json:"messages" stm:"messages"` 25 MessagesReady int64 `json:"messages_ready" stm:"messages_ready"` 26 MessagesUnacknowledged int64 `json:"messages_unacknowledged" stm:"messages_unacknowledged"` 27 } `json:"queue_totals" stm:"queue_totals"` 28 MessageStats messageStats `json:"message_stats" stm:"message_stats"` 29 Node string 30 } 31 32 // https://www.rabbitmq.com/monitoring.html#node-metrics 33 type nodeStats struct { 34 FDTotal int64 `json:"fd_total" stm:"fd_total"` 35 FDUsed int64 `json:"fd_used" stm:"fd_used"` 36 MemLimit int64 `json:"mem_limit" stm:"mem_limit"` 37 MemUsed int64 `json:"mem_used" stm:"mem_used"` 38 SocketsTotal int64 `json:"sockets_total" stm:"sockets_total"` 39 SocketsUsed int64 `json:"sockets_used" stm:"sockets_used"` 40 ProcTotal int64 `json:"proc_total" stm:"proc_total"` 41 ProcUsed int64 `json:"proc_used" stm:"proc_used"` 42 DiskFree int64 `json:"disk_free" stm:"disk_free"` 43 RunQueue int64 `json:"run_queue" stm:"run_queue"` 44 } 45 46 type vhostStats struct { 47 Name string `json:"name"` 48 Messages int64 `json:"messages" stm:"messages"` 49 MessagesReady int64 `json:"messages_ready" stm:"messages_ready"` 50 MessagesUnacknowledged int64 `json:"messages_unacknowledged" stm:"messages_unacknowledged"` 51 MessageStats messageStats `json:"message_stats" stm:"message_stats"` 52 } 53 54 // https://www.rabbitmq.com/monitoring.html#queue-metrics 55 type queueStats struct { 56 Name string `json:"name"` 57 Vhost string `json:"vhost"` 58 State string `json:"state"` 59 Type string `json:"type"` 60 Messages int64 `json:"messages" stm:"messages"` 61 MessagesReady int64 `json:"messages_ready" stm:"messages_ready"` 62 MessagesUnacknowledged int64 `json:"messages_unacknowledged" stm:"messages_unacknowledged"` 63 MessagesPagedOut int64 `json:"messages_paged_out" stm:"messages_paged_out"` 64 MessagesPersistent int64 `json:"messages_persistent" stm:"messages_persistent"` 65 MessageStats messageStats `json:"message_stats" stm:"message_stats"` 66 } 67 68 // https://rawcdn.githack.com/rabbitmq/rabbitmq-server/v3.11.5/deps/rabbitmq_management/priv/www/api/index.html 69 type messageStats struct { 70 Ack int64 `json:"ack" stm:"ack"` 71 Publish int64 `json:"publish" stm:"publish"` 72 PublishIn int64 `json:"publish_in" stm:"publish_in"` 73 PublishOut int64 `json:"publish_out" stm:"publish_out"` 74 Confirm int64 `json:"confirm" stm:"confirm"` 75 Deliver int64 `json:"deliver" stm:"deliver"` 76 DeliverNoAck int64 `json:"deliver_no_ack" stm:"deliver_no_ack"` 77 Get int64 `json:"get" stm:"get"` 78 GetNoAck int64 `json:"get_no_ack" stm:"get_no_ack"` 79 DeliverGet int64 `json:"deliver_get" stm:"deliver_get"` 80 Redeliver int64 `json:"redeliver" stm:"redeliver"` 81 ReturnUnroutable int64 `json:"return_unroutable" stm:"return_unroutable"` 82 }