From 4d0a8c4c1d2bd45c4464f917ac09b57d31c2cf6a Mon Sep 17 00:00:00 2001 From: markus812498 Date: Wed, 6 Dec 2023 11:11:02 +1300 Subject: [PATCH] rabbit_stream_consumer -> stream_consumer_metrics --- .../prometheus_rabbitmq_core_metrics_collector.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deps/rabbitmq_prometheus/src/collectors/prometheus_rabbitmq_core_metrics_collector.erl b/deps/rabbitmq_prometheus/src/collectors/prometheus_rabbitmq_core_metrics_collector.erl index a474430b599..a0557bf7793 100644 --- a/deps/rabbitmq_prometheus/src/collectors/prometheus_rabbitmq_core_metrics_collector.erl +++ b/deps/rabbitmq_prometheus/src/collectors/prometheus_rabbitmq_core_metrics_collector.erl @@ -136,6 +136,12 @@ {5, undefined, queue_process_reductions_total, counter, "Total number of queue process reductions"} ]}, + {stream_consumer_metrics, [ + {2, undefined, stream_consumer_offset, counter, "Total nunber of offset", offset}, + {2, undefined, stream_consumer_offset_lag, counter, "Total offset lag of connection", offset_lag}, + {2, undefined, stream_consumer_consumed_total, counter, "Total number of messages consumed on connection", consumed} + ]}, + {queue_consumer_count, [ {2, undefined, queue_consumers, gauge, "Consumers on a queue", consumers} ]}, @@ -302,7 +308,7 @@ mutually_exclusive_mf(false, auth_attempt_detailed_metrics, _) -> %% `proplists:get_value/2` calls. mutually_exclusive_mf(_, queue_consumer_count, MFs) -> lists:keymember(queue_metrics, 1, MFs); -%%mutually_exclusive_mf(_, rabbit_stream_consumer, MFs) -> +%%mutually_exclusive_mf(_,stream_consumer_metric, MFs) -> %% lists:keymember(rabbit_stream_consumer_created, 1, MFs); mutually_exclusive_mf(_, _, _) -> false. @@ -537,8 +543,8 @@ get_data(rabbit_stream_publisher_created = Table, false, _, _) -> } end, empty(Table), Table), [{Table, [{published, A1}, {confirmed, A2}, {errored, A3}]}]; -%%get_data(rabbit_stream_consumer, true, _, _) -> - %% ets:tab2list(rabbit_stream_consumer_created); +%get_data(stream_consumer_metrics, true, _, _) -> +% ets:tab2list(rabbit_stream_consumer_created); get_data(rabbit_stream_consumer_created = Table, false, _, _) -> %% Table = rabbit_stream_consumer_created, %% real table name {Table, A1, A2, A3} = ets:foldl(fun({_, Props}, {T, A1, A2, A3}) ->