From cd4227b8511809d3ba2b084153ba38ff47ab7325 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Wed, 22 Dec 2021 10:24:52 +0800 Subject: [PATCH] fix(rules): don't show the module name 'emqx_rule_outputs' in outputs --- apps/emqx_rule_engine/src/emqx_rule_engine_api.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/emqx_rule_engine/src/emqx_rule_engine_api.erl b/apps/emqx_rule_engine/src/emqx_rule_engine_api.erl index 205f85488..cbfda16db 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_engine_api.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_engine_api.erl @@ -257,11 +257,16 @@ format_output(Outputs) -> [do_format_output(Out) || Out <- Outputs]. do_format_output(#{mod := Mod, func := Func, args := Args}) -> - #{function => list_to_binary(lists:concat([Mod,":",Func])), + #{function => printable_function_name(Mod, Func), args => maps:remove(preprocessed_tmpl, Args)}; do_format_output(BridgeChannelId) when is_binary(BridgeChannelId) -> BridgeChannelId. +printable_function_name(emqx_rule_outputs, Func) -> + Func; +printable_function_name(Mod, Func) -> + list_to_binary(lists:concat([Mod,":",Func])). + get_rule_metrics(Id) -> Format = fun (Node, #{matched := Matched, rate := Current,