fix(rule_engine): don't increment unknown counter on unrecoverable errors
Closes: EMQX-8786
This commit is contained in:
parent
e1d5894209
commit
aca65ca2d4
|
@ -514,6 +514,8 @@ inc_action_metrics({error, {recoverable_error, _}}, RuleId) ->
|
|||
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.failed.out_of_service');
|
||||
inc_action_metrics(?RESOURCE_ERROR_M(R, _), RuleId) when ?IS_RES_DOWN(R) ->
|
||||
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.failed.out_of_service');
|
||||
inc_action_metrics({error, {unrecoverable_error, _}}, RuleId) ->
|
||||
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.failed');
|
||||
inc_action_metrics(R, RuleId) ->
|
||||
case is_ok_result(R) of
|
||||
false ->
|
||||
|
@ -523,9 +525,7 @@ inc_action_metrics(R, RuleId) ->
|
|||
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.success')
|
||||
end.
|
||||
|
||||
is_ok_result(ok) ->
|
||||
true;
|
||||
is_ok_result(R) when is_tuple(R) ->
|
||||
ok == erlang:element(1, R);
|
||||
is_ok_result(ok) ->
|
||||
is_ok_result(_) ->
|
||||
false.
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Don't increment 'actions.failed.unknown' rule metrics counter upon receiving unrecoverable bridge errors.
|
||||
This counter is displayed on the dashboard's rule overview tab ('Action statistics' - 'Unknown').
|
||||
The fix is only applicable for synchronous bridges, as all rule actions for asynchronous bridges
|
||||
are counted as successful (they increment 'actions.success' which is displayed as 'Action statistics' - 'Success').
|
Loading…
Reference in New Issue