Skip to content

Commit

Permalink
Add new flow metrics (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Parente authored Sep 19, 2022
1 parent b083020 commit 32ff723
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 295 deletions.
8 changes: 8 additions & 0 deletions sinker/backend/pktvisor/pktvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ func convertFlowToPromParticle(ctxt *context, statsMap map[string]interface{}, l
ipv4_regex := `^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})`

if ok, _ := regexp.MatchString(ipv4_regex+`|`+ipv6_regex, key); ok {
if ok = strings.Contains(label, "Devices"); !ok {
return
}
label = strings.ReplaceAll(label, "Devices", "")
ctxt.deviceID = key
convertFlowToPromParticle(ctxt, statistic, label, tsList)
} else {
Expand Down Expand Up @@ -389,6 +393,10 @@ func topNMetricsParser(label string) (string, error) {
mapNMetrics["TopSRVFAIL"] = "qname"
mapNMetrics["TopUDPPorts"] = "port"
mapNMetrics["TopSlow"] = "qname"
mapNMetrics["TopGeoLocBytes"] = "geo_loc"
mapNMetrics["TopGeoLocPackes"] = "geo_loc"
mapNMetrics["TopAsnBytes"] = "asn"
mapNMetrics["TopAsnPackets"] = "asn"
mapNMetrics["TopDstIpsBytes"] = "ip"
mapNMetrics["TopDstIpsPackets"] = "ip"
mapNMetrics["TopSrcIpsBytes"] = "ip"
Expand Down
Loading

0 comments on commit 32ff723

Please sign in to comment.