Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Netflow input metrics #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions collector/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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,
},
},
}
}
Expand Down