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

Prometheus: a handful of new per-exchange and per-queue metrics #11559

Conversation

LoisSotoLopez
Copy link
Contributor

Proposed Changes

Solves the issue explained at #11217

  • Defines 3 more rabbit_core_metrics tables, where per queue, per exchange and per queue/exchange metrics will be stored without including a channel ID on the key.
  • Initializes those tables and configures rabbit_core_metrics to populate them on channel_stats calls, apart from populating those metrics per channel.
  • Configures the rabbit_mgmt and prometheus_rabbitmq_core _metrics_collectors to collect those metrics.
  • Provides a few tests in the rabbit_prometheus_http_SUITE

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

Checklist

@michaelklishin
Copy link
Member

cd deps/rabbitmq_prometheus
gmake tests

on this branch fails for me with

rabbit_prometheus_http_SUITE > per_object_metrics > globally_configure_per_object_metrics_test
    #1. {error,
            {{assertEqual,
                 [{module,rabbit_prometheus_http_SUITE},
                  {line,413},
                  {expression,
                      "re : run ( Body , \"^rabbitmq_queue_get_ack_total{\" , [ { capture , none } , multiline ] )"},
                  {expected,match},
                  {value,nomatch}]},
             [{rabbit_prometheus_http_SUITE,per_object_metrics_test,2,
                  [{file,"rabbit_prometheus_http_SUITE.erl"},{line,413}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1302}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1234}]}]}}

rabbit_prometheus_http_SUITE > per_object_endpoint_metrics > endpoint_per_object_metrics
    #1. {error,
            {{assertEqual,
                 [{module,rabbit_prometheus_http_SUITE},
                  {line,413},
                  {expression,
                      "re : run ( Body , \"^rabbitmq_queue_get_ack_total{\" , [ { capture , none } , multiline ] )"},
                  {expected,match},
                  {value,nomatch}]},
             [{rabbit_prometheus_http_SUITE,per_object_metrics_test,2,
                  [{file,"rabbit_prometheus_http_SUITE.erl"},{line,413}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1302}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1234}]}]}}

and one more error that can be inspected by opening logs/index.html after the CT test run.

@LoisSotoLopez LoisSotoLopez force-pushed the feat/provide-metrics-without-channel-id-as-label-value branch 5 times, most recently from dbc5592 to 7423bc6 Compare June 26, 2024 12:33
@LoisSotoLopez LoisSotoLopez force-pushed the feat/provide-metrics-without-channel-id-as-label-value branch from 7423bc6 to 3ed2e30 Compare June 26, 2024 13:19
@LoisSotoLopez
Copy link
Contributor Author

cd deps/rabbitmq_prometheus
gmake tests

on this branch fails for me with

rabbit_prometheus_http_SUITE > per_object_metrics > globally_configure_per_object_metrics_test
    #1. {error,
            {{assertEqual,
                 [{module,rabbit_prometheus_http_SUITE},
                  {line,413},
                  {expression,
                      "re : run ( Body , \"^rabbitmq_queue_get_ack_total{\" , [ { capture , none } , multiline ] )"},
                  {expected,match},
                  {value,nomatch}]},
             [{rabbit_prometheus_http_SUITE,per_object_metrics_test,2,
                  [{file,"rabbit_prometheus_http_SUITE.erl"},{line,413}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1302}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1234}]}]}}

rabbit_prometheus_http_SUITE > per_object_endpoint_metrics > endpoint_per_object_metrics
    #1. {error,
            {{assertEqual,
                 [{module,rabbit_prometheus_http_SUITE},
                  {line,413},
                  {expression,
                      "re : run ( Body , \"^rabbitmq_queue_get_ack_total{\" , [ { capture , none } , multiline ] )"},
                  {expected,match},
                  {value,nomatch}]},
             [{rabbit_prometheus_http_SUITE,per_object_metrics_test,2,
                  [{file,"rabbit_prometheus_http_SUITE.erl"},{line,413}]},
              {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
              {test_server,run_test_case_eval1,6,
                  [{file,"test_server.erl"},{line,1302}]},
              {test_server,run_test_case_eval,9,
                  [{file,"test_server.erl"},{line,1234}]}]}}

and one more error that can be inspected by opening logs/index.html after the CT test run.

Yep. Should be fixed up right now. Wasn't expecting the core team to look at draft PRs. Won't open them any more if that's the case. 👍

@LoisSotoLopez LoisSotoLopez marked this pull request as ready for review June 26, 2024 13:20
Acc
end, [], Table);
get_data(exchange_metrics, true, _VhostsFilter) ->
[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the opposite of the intended behaviour. If VHostsFilter is undefined (false) then metrics from all vhosts should be included
After second thought this clauses is not needed as the last clause of get_data which just calls ets:tab2list(Table). will cover what is needed

…re_metrics_collector.erl

Co-authored-by: Péter Gömöri <gomoripeti@users.noreply.github.com>
@LoisSotoLopez LoisSotoLopez force-pushed the feat/provide-metrics-without-channel-id-as-label-value branch from 5e6116f to 64e0812 Compare June 27, 2024 07:50
Make new metrics return on detailed only and adjust some of the
help messages.
Co-authored-by: Péter Gömöri <gomoripeti@users.noreply.github.com>
@michaelklishin michaelklishin changed the title [Prometheus] Provide per-exchange/per-queue metrics Prometheus: a handful of new per-exchange and per-queue metrics Jul 11, 2024
@michaelklishin michaelklishin merged commit ec828e9 into rabbitmq:main Jul 11, 2024
124 of 127 checks passed
@michaelklishin michaelklishin added this to the 4.0.0 milestone Jul 11, 2024
@michaelklishin
Copy link
Member

@LoisSotoLopez @gomoripeti thank you. This will ship in 4.0 this fall.

I'd appreciate if your rabbitmq-server fork was updated a little bit more frequently than once every ≈ 4 weeks. Rebasing a triple digit number of commits can take a while.

@michaelklishin
Copy link
Member

michaelklishin commented Jul 12, 2024

I'm afraid deps/rabbitmq_prometheus test suites reliably fail with this PR, even with the new tests excluded from mixed version runs that they cannot possibly pass (against a 3.13.x node) #11687.

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

Successfully merging this pull request may close these issues.

3 participants