@@ -170,7 +170,6 @@ type requestMetric struct {
170170 conSrcDstInfo connectionSrcDst
171171 origDstAddr [4 ]uint32
172172 origDstPort uint16
173- direction uint32
174173 receivedBytes uint32 // total bytes received after previous report
175174 sentBytes uint32 // total bytes sent after previous report
176175 state uint32
@@ -544,7 +543,6 @@ func buildV4Metric(buf *bytes.Buffer, tcpConns map[connectionSrcDst]connMetric)
544543 reqMetric .conSrcDstInfo .src [0 ] = rawStats .SrcAddr
545544 reqMetric .conSrcDstInfo .dst [0 ] = rawStats .DstAddr
546545 reqMetric .conSrcDstInfo .direction = rawStats .Direction
547- reqMetric .direction = rawStats .Direction
548546 reqMetric .conSrcDstInfo .dstPort = rawStats .DstPort
549547 reqMetric .conSrcDstInfo .srcPort = rawStats .SrcPort
550548
@@ -601,7 +599,6 @@ func buildV6Metric(buf *bytes.Buffer, tcpConns map[connectionSrcDst]connMetric)
601599 reqMetric .conSrcDstInfo .src = rawStats .SrcAddr
602600 reqMetric .conSrcDstInfo .dst = rawStats .DstAddr
603601 reqMetric .conSrcDstInfo .direction = rawStats .Direction
604- reqMetric .direction = rawStats .Direction
605602 reqMetric .conSrcDstInfo .dstPort = rawStats .DstPort
606603 reqMetric .conSrcDstInfo .srcPort = rawStats .SrcPort
607604
@@ -670,7 +667,7 @@ func (m *MetricController) buildWorkloadMetric(reqMetric *requestMetric) workloa
670667 trafficLabels .requestProtocol = "tcp"
671668 trafficLabels .connectionSecurityPolicy = "mutual_tls"
672669
673- switch reqMetric .direction {
670+ switch reqMetric .conSrcDstInfo . direction {
674671 case constants .INBOUND :
675672 trafficLabels .reporter = "destination"
676673 case constants .OUTBOUND :
@@ -768,7 +765,7 @@ func (m *MetricController) buildServiceMetric(reqMetric *requestMetric) (service
768765 accesslog .destinationAddress = dstIp + ":" + fmt .Sprintf ("%d" , reqMetric .conSrcDstInfo .dstPort )
769766 accesslog .sourceAddress = srcIp + ":" + fmt .Sprintf ("%d" , reqMetric .conSrcDstInfo .srcPort )
770767
771- switch reqMetric .direction {
768+ switch reqMetric .conSrcDstInfo . direction {
772769 case constants .INBOUND :
773770 trafficLabels .reporter = "destination"
774771 accesslog .direction = "INBOUND"
@@ -813,7 +810,7 @@ func (m *MetricController) buildConnectionMetric(reqMetric *requestMetric) conne
813810 trafficLabels .requestProtocol = "tcp"
814811 trafficLabels .connectionSecurityPolicy = "mutual_tls"
815812
816- switch reqMetric .direction {
813+ switch reqMetric .conSrcDstInfo . direction {
817814 case constants .INBOUND :
818815 trafficLabels .reporter = "destination"
819816 case constants .OUTBOUND :
0 commit comments