fix: use `id` uniformly as the label key for rules and actions

This commit is contained in:
JimMoen 2024-01-15 11:07:32 +08:00
parent 4b23930fce
commit f457def201
No known key found for this signature in database
1 changed files with 4 additions and 4 deletions

View File

@ -384,7 +384,7 @@ merge_acc_with_rules(Id, RuleMetrics, PointsAcc) ->
).
rule_point(Id, V) ->
{[{rule_id, Id}], V}.
{[{id, Id}], V}.
get_metric(#{id := Id} = _Rule) ->
case emqx_metrics_worker:get_metrics(rule_metrics, Id) of
@ -448,14 +448,14 @@ action_specific_data() ->
merge_acc_with_bridges(Id, BridgeMetrics, PointsAcc) ->
maps:fold(
fun(K, V, AccIn) ->
AccIn#{K => [bridge_point(Id, V) | ?MG(K, AccIn)]}
AccIn#{K => [action_point(Id, V) | ?MG(K, AccIn)]}
end,
PointsAcc,
BridgeMetrics
).
bridge_point(Id, V) ->
{[{action_id, Id}], V}.
action_point(Id, V) ->
{[{id, Id}], V}.
get_bridge_metric(Type, Name) ->
case emqx_bridge:get_metrics(Type, Name) of