Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Remove remote_port label from flow_traffic metrics #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions utils/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ var (
Name: "flow_traffic_bytes",
Help: "Bytes received by the application.",
},
[]string{"remote_ip", "remote_port", "local_ip", "local_port", "type"},
[]string{"remote_ip", "local_ip", "local_port", "type"},
)
MetricTrafficPackets = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "flow_traffic_packets",
Help: "Packets received by the application.",
},
[]string{"remote_ip", "remote_port", "local_ip", "local_port", "type"},
[]string{"remote_ip", "local_ip", "local_port", "type"},
)
MetricPacketSizeSum = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Name: "flow_traffic_summary_size_bytes",
Help: "Summary of packet size.",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"remote_ip", "remote_port", "local_ip", "local_port", "type"},
[]string{"remote_ip", "local_ip", "local_port", "type"},
)
DecoderStats = prometheus.NewCounterVec(
prometheus.CounterOpts{
Expand Down
3 changes: 0 additions & 3 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ func UDPRoutine(name string, decodeFunc decoder.DecoderFunc, workers int, addr s
MetricTrafficBytes.With(
prometheus.Labels{
"remote_ip": pktAddr.IP.String(),
"remote_port": strconv.Itoa(pktAddr.Port),
"local_ip": localIP,
"local_port": strconv.Itoa(addrUDP.Port),
"type": name,
Expand All @@ -325,7 +324,6 @@ func UDPRoutine(name string, decodeFunc decoder.DecoderFunc, workers int, addr s
MetricTrafficPackets.With(
prometheus.Labels{
"remote_ip": pktAddr.IP.String(),
"remote_port": strconv.Itoa(pktAddr.Port),
"local_ip": localIP,
"local_port": strconv.Itoa(addrUDP.Port),
"type": name,
Expand All @@ -334,7 +332,6 @@ func UDPRoutine(name string, decodeFunc decoder.DecoderFunc, workers int, addr s
MetricPacketSizeSum.With(
prometheus.Labels{
"remote_ip": pktAddr.IP.String(),
"remote_port": strconv.Itoa(pktAddr.Port),
"local_ip": localIP,
"local_port": strconv.Itoa(addrUDP.Port),
"type": name,
Expand Down