From f457def2010694a486d5886c09b9ccc7dedd8183 Mon Sep 17 00:00:00 2001 From: JimMoen Date: Mon, 15 Jan 2024 11:07:32 +0800 Subject: [PATCH] fix: use `id` uniformly as the label key for rules and actions --- .../src/emqx_prometheus_data_integration.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/emqx_prometheus/src/emqx_prometheus_data_integration.erl b/apps/emqx_prometheus/src/emqx_prometheus_data_integration.erl index 092ed3a71..318b0fa16 100644 --- a/apps/emqx_prometheus/src/emqx_prometheus_data_integration.erl +++ b/apps/emqx_prometheus/src/emqx_prometheus_data_integration.erl @@ -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