Skip to content

Commit

Permalink
Merge pull request cloudflare#37 from psvmcc/netflow_v5_flows_counter
Browse files Browse the repository at this point in the history
Extend netflow v5 flows metrics
  • Loading branch information
lspgn authored Aug 17, 2019
2 parents ee3bcf9 + 4f9cca0 commit 04c3ca1
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 04c3ca1

Please sign in to comment.