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

Added support for exposing Stream Connection metrics

Open markus812498 opened this issue 1 year ago • 11 comments

Proposed Changes

This PR adds support for metrics from the rabbit_stream_consumer_created and rabbit_stream_publisher_created ETS tables to be exposed through prometheus through more user-friendly named metrics endpoints. Based off the conversation in a previous PR: https://github.com/rabbitmq/rabbitmq-server/pull/3043

The change is requested to ensure customers using stream connections can scrape metrics from the prometheus endpoints.

Types of Changes

What types of changes does your code introduce to this project? Put an x in the boxes that apply

  • [ ] 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)
  • [ ] Build system and/or CI

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask on the mailing list. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [x] I have read the CONTRIBUTING.md document
  • [x] I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] All tests pass locally with my changes
  • [ ] If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • [ ] If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If PR is accepted I think this should also be pushed to the documentation on the rabbitmq-website. Do I create a PR to that repo once this is merged? Or is there another procedure to follow?

Thanks!

markus812498 avatar Jan 04 '24 01:01 markus812498

This has conflicts with main and needs rebasing.

michaelklishin avatar Jan 04 '24 09:01 michaelklishin

there are valid test failures. We are working on fixing them...

gomoripeti avatar Jan 08 '24 20:01 gomoripeti

after @gomoripeti 's push above, I believe this PR is ready for review as all Prometheus related tests passing and conflicts are resolved. (looks like failing tests are related to MQTT_V5)

markus812498 avatar Jan 14 '24 19:01 markus812498

Hi!

This looks very good, thank you for implementing it.

What do you think of the idea to expose the segments count as well for a stream, then the rough stream size could be calculated from max-segment-size * segments? (Maybe in a separate PR.)

luos avatar Feb 13 '24 08:02 luos

Exposing the current segment count sounds OK to me.

michaelklishin avatar Feb 13 '24 14:02 michaelklishin

that sounds good! perhaps I could look into that in a different PR once this gets merged :)

markus812498 avatar Feb 13 '24 21:02 markus812498

force-push was a rebase to latest main. google-github-actions/auth fails in CI

gomoripeti avatar Jun 21 '24 07:06 gomoripeti

CI fails because external PRs do not have access to the necessary secrets. We will run the tests locally.

michaelklishin avatar Jun 22 '24 22:06 michaelklishin

Indeed, https://github.com/cloudamqp/rabbitmq-server/ still uses master as its default branch and https://github.com/cloudamqp/rabbitmq-server/tree/main specifically is from May 15th.

michaelklishin avatar Jun 22 '24 22:06 michaelklishin

Rebasing cloudamqp/rabbitmq-server@main onto rabbitmq/rabbitmq-server@main is a fast forward.

Then rebasing this PR onto the result will conflict with https://github.com/rabbitmq/rabbitmq-server/pull/11431 but that should be it.

michaelklishin avatar Jun 22 '24 23:06 michaelklishin

I used the github UI button "Rebase" previously, sorry if it caused some trouble.

Now I manually rebased to latest main @ rabbitmq/rabbitmq-server and fixed the conflict with #11431

gomoripeti avatar Jun 24 '24 09:06 gomoripeti