The Wayback Machine - https://web.archive.org/web/20241203182752/https://github.com/rabbitmq/rabbitmq-server/pull/3314
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

Observer CLI plugin: classic queues #3314

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Conversation

lhoguin
Copy link
Contributor

@lhoguin lhoguin commented Aug 17, 2021

We can write observer_cli plugins. Here's one 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.

Types of Changes

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • 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

This comment has been minimized.

@lhoguin
Copy link
Contributor Author

lhoguin commented Aug 19, 2021

More recent screenshot:

Screenshot 2021-08-19 at 15 01 28

@lhoguin
Copy link
Contributor Author

lhoguin commented Aug 19, 2021

Next steps:

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

@mergify mergify bot added the make label Aug 24, 2021
@gerhard
Copy link
Contributor

gerhard commented Sep 1, 2021

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

@gerhard
Copy link
Contributor

gerhard commented Sep 1, 2021

@gerhard
Copy link
Contributor

gerhard commented Sep 1, 2021

@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

@mergify
Copy link

mergify bot commented Mar 11, 2022

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

@lhoguin
Copy link
Contributor Author

lhoguin commented Sep 29, 2022

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.

@essen essen force-pushed the lh-observer-cli-plugin branch 4 times, most recently from cda71db to 7300a1f Compare October 7, 2022 08:51
@lhoguin lhoguin changed the title DO NOT MERGE WIP experiment with Observer CLI plugins Observer CLI plugin: classic queues Oct 7, 2022
@lhoguin lhoguin marked this pull request as ready for review October 7, 2022 09:49
@lhoguin
Copy link
Contributor Author

lhoguin commented Oct 7, 2022

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

@lhoguin
Copy link
Contributor Author

lhoguin commented Oct 7, 2022

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

@lhoguin
Copy link
Contributor Author

lhoguin commented Oct 7, 2022

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

This specifically targets CQv2 and aims to identify where messages
are located (Erlang/GS2 mailbox, memory/disk/buffer, pending acks
and confirms).

This commit also makes it easy to add more plugins in the future.
@lhoguin
Copy link
Contributor Author

lhoguin commented Oct 7, 2022

Most recent commit should fix it.

@michaelklishin michaelklishin added this to the 3.12.0 milestone Oct 7, 2022
@michaelklishin michaelklishin merged commit b22acba into main Oct 7, 2022
@michaelklishin michaelklishin deleted the lh-observer-cli-plugin branch October 7, 2022 15:21
@illotum
Copy link

illotum commented Oct 7, 2022

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

@michaelklishin
Copy link
Member

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

@lhoguin
Copy link
Contributor Author

lhoguin commented Oct 10, 2022

I will soon open a PR for 3.11 and 3.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants