Release series support: announce in more places

* Log file on boot
 * Startup banner
 * HTTP API response @ GET /api/overview
This commit is contained in:
Michael Klishin 2022-08-28 02:13:42 +04:00
parent fc0de65393
commit 25e5182801
3 changed files with 28 additions and 8 deletions

View File

@ -691,10 +691,7 @@ status() ->
[Tuple] when is_tuple(Tuple) -> Tuple;
Tuple when is_tuple(Tuple) -> Tuple
end,
SeriesSupportStatus = case rabbit_release_series:is_currently_supported() of
false -> <<"out of support">>;
_ -> <<"supported">>
end,
SeriesSupportStatus = rabbit_release_series:readable_support_status(),
S1 = [{pid, list_to_integer(os:getpid())},
%% The timeout value used is twice that of gen_server:call/2.
{running_applications, rabbit_misc:which_applications()},
@ -865,6 +862,7 @@ start(normal, []) ->
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE],
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH})
end,
maybe_warn_about_release_series_eol(),
log_motd(),
{ok, SupPid} = rabbit_sup:start_link(),
@ -1188,6 +1186,7 @@ print_banner() ->
%% padded list lines
{LogFmt, LogLocations} = LineListFormatter("~n ~ts", log_locations()),
{CfgFmt, CfgLocations} = LineListFormatter("~n ~ts", config_locations()),
SeriesSupportStatus = rabbit_release_series:readable_support_status(),
{MOTDFormat, MOTDArgs} = case motd() of
undefined ->
{"", []};
@ -1205,6 +1204,7 @@ print_banner() ->
MOTDFormat ++
"~n Erlang: ~ts [~ts]"
"~n TLS Library: ~ts"
"~n Release series support status: ~ts"
"~n"
"~n Doc guides: https://rabbitmq.com/documentation.html"
"~n Support: https://rabbitmq.com/contact.html"
@ -1215,11 +1215,22 @@ print_banner() ->
"~n Config file(s): ~ts" ++ CfgFmt ++ "~n"
"~n Starting broker...",
[Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++
[rabbit_misc:otp_release(), emu_flavor(), crypto_version()] ++
[rabbit_misc:otp_release(), emu_flavor(), crypto_version(),
SeriesSupportStatus] ++
MOTDArgs ++
LogLocations ++
CfgLocations).
maybe_warn_about_release_series_eol() ->
case rabbit_release_series:is_currently_supported() of
false ->
?LOG_WARNING("This release series has reached end of life "
"and is no longer supported. "
"Please visit https://rabbitmq.com/versions.html "
"to learn more and upgrade");
_ -> ok
end.
emu_flavor() ->
%% emu_flavor was introduced in Erlang 24 so we need to catch the error on Erlang 23
case catch(erlang:system_info(emu_flavor)) of

View File

@ -11,7 +11,8 @@
-export([
eol_date/0,
is_currently_supported/0
is_currently_supported/0,
readable_support_status/0
]).
-spec eol_date() -> rabbit_types:maybe(calendar:date()).
@ -29,3 +30,10 @@ is_currently_supported() ->
none -> true;
Date -> not rabbit_date_time:is_in_the_past(Date)
end.
-spec readable_support_status() -> binary().
readable_support_status() ->
case is_currently_supported() of
false -> <<"out of support">>;
_ -> <<"supported">>
end.

View File

@ -49,8 +49,9 @@ to_json(ReqData, Context = #context{user = User = #user{tags = Tags}}) ->
{cluster_name, rabbit_nodes:cluster_name()},
{erlang_version, erlang_version()},
{erlang_full_version, erlang_full_version()},
{disable_stats, rabbit_mgmt_util:disable_stats(ReqData)},
{enable_queue_totals, rabbit_mgmt_util:enable_queue_totals(ReqData)}],
{release_series_support_status, rabbit_release_series:readable_support_status()},
{disable_stats, rabbit_mgmt_util:disable_stats(ReqData)},
{enable_queue_totals, rabbit_mgmt_util:enable_queue_totals(ReqData)}],
try
case rabbit_mgmt_util:disable_stats(ReqData) of
false ->