jwkohnen / conntrack-stats-exporter Goto Github PK
View Code? Open in Web Editor NEWNetfilter Conntrack Stats Exporter
License: GNU General Public License v3.0
Netfilter Conntrack Stats Exporter
License: GNU General Public License v3.0
Hello! Thanks for conntrack-stats-exporter.
For example:
# HELP conntrack_open_connections How many open connections are there to the remote host
# TYPE conntrack_open_connections gauge
conntrack_open_connections{host="10.0.1.5:3306"} 49
conntrack_open_connections{host="10.0.1.12:8080"} 19
In kubernetes (azure aks 1.23) with image v0.4.4 i get the following erros in the pod logs:
k logs -f conntrack-stats-exporter-wtg6p
listening on :9371 with endpoint "/metrics"
error gathering metrics for netns "": op(tool_output_no_match): <nil>
....
Metrics are missing too:
# HELP conntrack_stats_scrape_error Total of error when calling/parsing conntrack command
# TYPE conntrack_stats_scrape_error counter
conntrack_stats_scrape_error{netns="",cause="timeout"} 0
conntrack_stats_scrape_error{netns="",cause="client_gone"} 0
conntrack_stats_scrape_error{netns="",cause="netns_restore"} 0
conntrack_stats_scrape_error{netns="",cause="netns_enter"} 0
conntrack_stats_scrape_error{netns="",cause="netns_cleanup"} 0
conntrack_stats_scrape_error{netns="",cause="netns_prepare"} 0
conntrack_stats_scrape_error{netns="",cause="tool_exec"} 8
conntrack_stats_scrape_error{netns="",cause="tool_output_no_match"} 0
Last working image in k8s is v0.3.2 for me.
Locally the newer v0.4.4 image works via:
docker run -it --net=host --privileged --rm jwkohnen/conntrack-stats-exporter:v0.4.4
imho it broke when the support for network namespaces was introduced.
Hello! Thanks for conntrack-stats-exporter!
I builb conntrack-stats-exporter in ubuntu 22.04 and simple run.
Get error
./conntrack-stats-exporter
listening on :9371 with endpoint "/metrics"
error gathering metrics for netns "": op(tool_exec): failed to exec conntrack tool: error running the conntrack command with the --stats flag: exit status 1
Kernel
uname -r
5.15.0-56-generic
Golang
go version
go version go1.18.1 linux/amd64
This is a proposal to replace usage of conntrack
tool to fetch statistics on the conntrack table, with a golang lib able to bring this information directly over the Netlink socket. The main benefit would be to get rid of the conntrack's output parsing.
There is already a lib allowing to do that: https://github.com/ti-mo/conntrack
I have used it for another project and it seems pretty easy to get stats and have the result in a proper golang struct.
I can work on this but I'd like to have your opinion before rushing into it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.