Fix metrics call to ranch:info()

Bug was introduced when we upgraded to ranch 2.x.x in
fc9ec1d326
This commit is contained in:
Sergey Prokhorov 2026-04-09 00:48:02 +02:00
parent dfa991f803
commit f2bdf3cb7f
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337
3 changed files with 3 additions and 3 deletions

View file

@ -808,5 +808,5 @@ Helpers
Number of connections
```bash
/opt/mtp_proxy/bin/mtp_proxy eval 'lists:sum([proplists:get_value(all_connections, L) || {_, L} <- ranch:info()]).'
/opt/mtp_proxy/bin/mtp_proxy eval 'lists:sum([maps:get(all_connections, L) || {_, L} <- maps:to_list(ranch:info())]).'
```

View file

@ -98,7 +98,7 @@ passive_metrics() ->
|
[{gauge, [?APP, connections, count],
"Count of ranch connections",
[{#{listener => H}, proplists:get_value(all_connections, P)}
[{#{listener => H}, maps:get(all_connections, P)}
|| {H, P} <- mtproto_proxy_app:mtp_listeners()]}] ].
-spec active_metrics() -> [{metric_type(), metric_name(), metric_doc(), Opts}]

View file

@ -92,7 +92,7 @@ diff_env(NewEnv, OldEnv) ->
%% @doc List of ranch listeners running mtproto_proxy
-spec mtp_listeners() -> [tuple()].
-spec mtp_listeners() -> [{ranch:ref(), #{atom() => term()}}].
mtp_listeners() ->
maps:to_list(
maps:filter(