diff --git a/collector/filebeat.go b/collector/filebeat.go index ee04b6d..42800a3 100644 --- a/collector/filebeat.go +++ b/collector/filebeat.go @@ -27,6 +27,14 @@ type Filebeat struct { Truncated float64 `json:"truncated"` } `json:"files"` } `json:"log"` + + Netflow struct { + Flows float64 `json:"flows"` + Packets struct { + Received float64 `json:"received"` + Dropped float64 `json:"dropped"` + } `json:"packets"` + } `json:"netflow"` } `json:"input"` } @@ -132,6 +140,33 @@ func NewFilebeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector eval: func(stats *Stats) float64 { return stats.Filebeat.Input.Log.Files.Truncated }, valType: prometheus.UntypedValue, }, + { + desc: prometheus.NewDesc( + prometheus.BuildFQName(beatInfo.Beat, "filebeat", "input_netflow"), + "filebeat.input_netflow", + nil, prometheus.Labels{"netflow": "flows"}, + ), + eval: func(stats *Stats) float64 { return stats.Filebeat.Input.Netflow.Flows }, + valType: prometheus.UntypedValue, + }, + { + desc: prometheus.NewDesc( + prometheus.BuildFQName(beatInfo.Beat, "filebeat", "input_netflow"), + "filebeat.input_netflow", + nil, prometheus.Labels{"netflow": "packets_received"}, + ), + eval: func(stats *Stats) float64 { return stats.Filebeat.Input.Netflow.Packets.Received }, + valType: prometheus.UntypedValue, + }, + { + desc: prometheus.NewDesc( + prometheus.BuildFQName(beatInfo.Beat, "filebeat", "input_netflow"), + "filebeat.input_netflow", + nil, prometheus.Labels{"netflow": "packets_dropped"}, + ), + eval: func(stats *Stats) float64 { return stats.Filebeat.Input.Netflow.Packets.Dropped }, + valType: prometheus.UntypedValue, + }, }, } }