rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

DO NOT MERGE WIP experiment with Observer CLI plugins

Open lhoguin opened this issue 3 years ago • 7 comments

We can write observer_cli plugins. Here's what that could look like for classic queues.

I see these as shortcuts for us to retrieve information about a system we need to debug, especially for cases where we would need to deal with customers directly and ask them to retrieve information from the Erlang node. But it could be used for any useful information to retrieve from the system.

The hard part moving forward is determining what values are the most useful.

Types of Changes

  • [ ] Bug fix (non-breaking change which fixes issue #NNNN)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • [ ] Documentation improvements (corrections, new content, etc)
  • [ ] Cosmetic change (whitespace, formatting, etc)

Checklist

  • [ ] I have added this change to the first version(s) in release-notes that I expect to introduce it

lhoguin avatar Aug 17 '21 14:08 lhoguin

Example screenshot:

Screenshot 2021-08-17 at 16 32 43

lhoguin avatar Aug 17 '21 14:08 lhoguin

More recent screenshot:

Screenshot 2021-08-19 at 15 01 28

lhoguin avatar Aug 19 '21 13:08 lhoguin

Next steps:

  • Wait/Help with https://github.com/zhongwencool/observer_cli/issues/78
  • Wait/Help with https://github.com/zhongwencool/observer_cli/issues/79
  • Create more plugins/panels (I can think of one more for classic queues)

Let's see what @gerhard thinks about this as well.

lhoguin avatar Aug 19 '21 13:08 lhoguin

Oh wow, I can't believe that I haven't thought about this! This would be an amazing addition. Love it! 💙

gerhard avatar Sep 01 '21 17:09 gerhard

Relevant: https://github.com/rabbitmq/rabbitmq-server/commit/09b92bacedc85c0878480feb559f2c57bb22d168#diff-18813c86948efc57e661623d7ba48ff94325c9b5421ec9177f724922dd553a35R35

gerhard avatar Sep 01 '21 17:09 gerhard

@lhoguin The hard part moving forward is determining what values are the most useful.

This looks like a good starting point to me:

  • vhost
  • name
  • reductions / s
  • process memory
  • minor GCs
  • major GCs
  • process mailbox
  • gen_server2 buffer

gerhard avatar Sep 01 '21 17:09 gerhard

This pull request modifies the erlang.mk build only. Should the makefiles be updated as well @lhoguin?

mergify[bot] avatar Mar 11 '22 10:03 mergify[bot]

Following the work on CQv2 and beyond the needs for this type of plugin have changed. I propose the following fields:

  • queue pid/vhost/name
  • mailbox + GS2 mailbox size
  • # messages in memory (q3)
  • (v2 only) index buffer size (with/without acks?) (delta, not yet flushed to disk)
  • (v2 only) store buffer size (delta, not yet flushed to disk)
  • # messages on disk (delta, flushed to disk)
  • # messages in transit (pending acks)
  • # messages to be confirmed

With that we should have a clear view of where messages are in each CQ.

lhoguin avatar Sep 29 '22 15:09 lhoguin

To test, create some work using classic queues, then connect via rabbitmq-diagnostics observer and press P and Enter to access the plugin.

lhoguin avatar Oct 07 '22 09:10 lhoguin

Screenshot from 2022-10-07 11-52-28

lhoguin avatar Oct 07 '22 09:10 lhoguin

Hold on before merge there's a small visual bug when there are many queues.

lhoguin avatar Oct 07 '22 12:10 lhoguin

Most recent commit should fix it.

lhoguin avatar Oct 07 '22 13:10 lhoguin

Fantastic addition. Any chance to backport it into earlier versions?

illotum avatar Oct 07 '22 19:10 illotum

It cannot even be backported to 3.11 as it targets a CQv2 revision scheduled to ship in 3.12.0.

michaelklishin avatar Oct 08 '22 12:10 michaelklishin

I will soon open a PR for 3.11 and 3.10.

lhoguin avatar Oct 10 '22 14:10 lhoguin