Skip to content

Commit

Permalink
fix console NotEnoughTagException (#792)
Browse files Browse the repository at this point in the history
Co-authored-by: lishanglin <[email protected]>
  • Loading branch information
LanternLee and lishanglin authored Apr 15, 2024
1 parent 991054d commit 2b6a211
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.ctrip.xpipe.redis.core.proxy.monitor.TunnelSocketStatsResult;
import com.ctrip.xpipe.redis.core.proxy.monitor.TunnelStatsResult;
import com.ctrip.xpipe.tuple.Pair;
import com.ctrip.xpipe.utils.StringUtil;
import com.google.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -94,8 +95,8 @@ private MetricData getBackendMetric(MetricData metric, DefaultTunnelInfo info, S
SocketStatsResult socketStatsResult = tunnelSocketStatsResult.getBackendSocketStats();
metric.setTimestampMilli(socketStatsResult.getTimestamp());
metric.setValue(analyze(socketStatsResult.getResult()));
if (backupDc != null) metric.addTag(METRIC_TAG_SRC_DC, backupDc);
if (peerDc != null) metric.addTag(METRIC_TAG_DST_DC, peerDc);
metric.addTag(METRIC_TAG_SRC_DC, StringUtil.isEmpty(backupDc) ? "-" : backupDc);
metric.addTag(METRIC_TAG_DST_DC, StringUtil.isEmpty(peerDc) ? "-" : peerDc);

TunnelStatsResult tunnelStatsResult = info.getTunnelStatsResult();
if (tunnelStatsResult == null) {
Expand All @@ -119,8 +120,8 @@ private MetricData getFrontendMetric(MetricData metric, DefaultTunnelInfo info,
SocketStatsResult socketStatsResult = tunnelSocketStatsResult.getFrontendSocketStats();
metric.setTimestampMilli(socketStatsResult.getTimestamp());
metric.setValue(analyze(socketStatsResult.getResult()));
if (backupDc != null) metric.addTag(METRIC_TAG_SRC_DC, backupDc);
if (peerDc != null) metric.addTag(METRIC_TAG_DST_DC, peerDc);
metric.addTag(METRIC_TAG_SRC_DC, StringUtil.isEmpty(backupDc) ? "-" : backupDc);
metric.addTag(METRIC_TAG_DST_DC, StringUtil.isEmpty(peerDc) ? "-" : peerDc);

TunnelStatsResult tunnelStatsResult = info.getTunnelStatsResult();
if (tunnelStatsResult == null) {
Expand Down

0 comments on commit 2b6a211

Please sign in to comment.