rabbitmq / rabbitmq-management

RabbitMQ Management UI and HTTP API
https://www.rabbitmq.com/management.html
Other
370 stars 165 forks source link

Missing confirm metrics from /api/exchanges/?message_stats #852

Closed dcarley closed 3 years ago

dcarley commented 3 years ago

The API docs and server code indicate that there should be metrics for the number of confirms on an exchange. We're looking to monitor these with Datadog in order to see which exchanges aren't using publisher confirms. However I can't see them when:

  1. Starting the latest version with the management plugin:

    $ docker run -p 5672:5672 -p 15672:15672 rabbitmq:3.8.9-management
  2. Declaring an exchange and publishing messages with confirms.

  3. Querying the API returns no confirm or confirm_details:

    $ http --auth "guest:guest" 'localhost:15672/api/exchanges?message_stats'
    …
        {
            "arguments": {},
            "auto_delete": false,
            "durable": true,
            "internal": false,
            "message_stats": {
                "publish_in": 1000,
                "publish_in_details": {
                    "rate": 0.0
                },
                "publish_out": 1000,
                "publish_out_details": {
                    "rate": 0.0
                }
            },
            "name": "test-exchange21853",
            "type": "fanout",
            "user_who_performed_action": "guest",
            "vhost": "/"
        }
    ]

Going back through previous minor versions, I found that this last worked in RabbitMQ 3.5:

$ http --auth "guest:guest" 'localhost:15672/api/exchanges?message_stats'
…
    {
        "arguments": {},
        "auto_delete": false,
        "durable": true,
        "internal": false,
        "message_stats": {
            "confirm": 1000,
            "confirm_details": {
                "rate": 0.0
            },
            "publish_in": 1000,
            "publish_in_details": {
                "rate": 0.0
            },
            "publish_out": 1000,
            "publish_out_details": {
                "rate": 0.0
            }
        },
        "name": "test-exchange21706",
        "type": "fanout",
        "vhost": "/"
    }
]
michaelklishin commented 3 years ago

My guess is that these require fine-grained metrics. @dcorbacho am I right?

dcorbacho commented 3 years ago

The confirm stats are still available on individual exchange endpoints, such as http://localhost:15672/api/exchanges/%2F/amq.default, and channels endpoint http://localhost:15672/api/channels