From 5d186fdb2c6fe962436071783bf4b9156fb6c1a9 Mon Sep 17 00:00:00 2001 From: zhuofeng Date: Fri, 17 Jan 2025 16:38:07 +0800 Subject: [PATCH] fix: traffic Balancing cannot get traffic from Trident --- server/ingester/ext_metrics/decoder/decoder.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/ingester/ext_metrics/decoder/decoder.go b/server/ingester/ext_metrics/decoder/decoder.go index fc915828826..a4420800ee4 100644 --- a/server/ingester/ext_metrics/decoder/decoder.go +++ b/server/ingester/ext_metrics/decoder/decoder.go @@ -240,6 +240,16 @@ func (d *Decoder) StatsToExtMetrics(vtapID uint16, s *pb.Stats) (*dbwriter.ExtMe writerDBID = dbwriter.DEEPFLOW_TENANT_DB_ID } } + // adapt to the name of the metric sent by Trident + if m.VTableName == "deepflow_agent_collect_sender" { + for i, name := range m.MetricsFloatNames { + if name == "tx_bytes" { + m.MetricsFloatNames = append(m.MetricsFloatNames, "tx-bytes") + m.MetricsFloatValues = append(m.MetricsFloatValues, m.MetricsFloatValues[i]) + break + } + } + } return m, writerDBID }