Skip to content

Commit

Permalink
add netflow v5 flows counter for prometheus stats
Browse files Browse the repository at this point in the history
  • Loading branch information
psvmcc committed Aug 13, 2019
1 parent ee3bcf9 commit 4f9cca0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utils/nflegacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,21 @@ func (s *StateNFLegacy) DecodeFlow(msg interface{}) error {
return err
}

switch msgDec.(type) {
switch msgDecConv := msgDec.(type) {
case netflowlegacy.PacketNetFlowV5:
NetFlowStats.With(
prometheus.Labels{
"router": key,
"version": "5",
}).
Inc()
NetFlowSetStatsSum.With(
prometheus.Labels{
"router": key,
"version": "5",
"type": "DataFlowSet",
}).
Add(float64(msgDecConv.Count))
}

var flowMessageSet []*flowmessage.FlowMessage
Expand Down

0 comments on commit 4f9cca0

Please sign in to comment.