Added parsing netfilter conntrack statistics from net/stat/nf_conntrack#254
Added parsing netfilter conntrack statistics from net/stat/nf_conntrack#254pgier merged 1 commit intoprometheus:masterfrom
Conversation
pgier
left a comment
There was a problem hiding this comment.
Looks good, thanks for the contribution! Just had a few minor comments in-line.
net_conntrackstat.go
Outdated
| // A ConntrackStatEntry represents one line from net/stat/nf_conntrack | ||
| // and contains netfilter conntrack statistics at one CPU core | ||
| type ConntrackStatEntry struct { | ||
| CPU int |
There was a problem hiding this comment.
Is CPU necessary here? Seems like this can be determined by the location in the slice.
There was a problem hiding this comment.
Yeah, probably this is excessive, removed it.
net_conntrackstat.go
Outdated
| @@ -0,0 +1,154 @@ | |||
| // Copyright 2019 The Prometheus Authors | |||
net_conntrackstat_test.go
Outdated
| @@ -0,0 +1,89 @@ | |||
| // Copyright 2018 The Prometheus Authors | |||
|
Fixes #217 |
| } | ||
|
|
||
| // Parses a ConntrackStatEntry from given array of fields | ||
| func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { |
There was a problem hiding this comment.
Check for length of fields to prevent a runtime panic.
|
Thanks for the update, looks like the new commit doesn't have a signoff, you can either squash it into the first commit, or do a |
5089553 to
018e4fe
Compare
Signed-off-by: Aleksandr Kozlov <avlkozlov@avito.ru>
018e4fe to
2285920
Compare
👌 |
Added parsing netfilter conntrack statistics from net/stat/nf_conntrack
Added parsing of conntrack statistics from procfs for this PR in node_exporter project: prometheus/node_exporter#1155
@discordianfish please review