|
|
@@ -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.
|