sheridan / nftables_exporter Goto Github PK
View Code? Open in Web Editor NEWExport nftables statistics to prometheus
License: GNU General Public License v3.0
Export nftables statistics to prometheus
License: GNU General Public License v3.0
Path to nft binary
# nft list ruleset
table inet filter {
chain input {
type filter hook input priority filter; policy accept;
}
chain forward {
type filter hook forward priority filter; policy accept;
}
chain output {
type filter hook output priority filter; policy accept;
}
chain trace_chain {
type filter hook prerouting priority raw - 1; policy accept;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
}
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
oifname != "lo" counter packets 378 bytes 23254 masquerade
}
}
This crashes a /metrics request:
# curl localhost:9630/metrics
An error has occurred while serving metrics:
2 error(s) occurred:
* collected metric nftables_rule_bytes label:<name:"action" value:"masquerade" > label:<name:"chain" value:"postrouting" > label:<name:"comment" value:"empty" > label:<name:"destination_addresses" value:"any" > label:<name:"destination_ports" value:"any" > label:<name:"family" value:"ip" > label:<name:"input_interfaces" value:"any" > label:<name:"output_interfaces" value:"lo" > label:<name:"source_addresses" value:"any" > label:<name:"source_ports" value:"any" > label:<name:"table" value:"nat" > counter:<value:22834 > with unregistered descriptor Desc{fqName: "nftables_rule_bytes", help: "Bytes, matched by rule per rule comment", constLabels: {}, variableLabels: [chain family table input_interfaces output_interfaces source_addresses destination_addresses source_ports destination_ports comment action]}
* collected metric nftables_rule_packets label:<name:"action" value:"masquerade" > label:<name:"chain" value:"postrouting" > label:<name:"comment" value:"empty" > label:<name:"destination_addresses" value:"any" > label:<name:"destination_ports" value:"any" > label:<name:"family" value:"ip" > label:<name:"input_interfaces" value:"any" > label:<name:"output_interfaces" value:"lo" > label:<name:"source_addresses" value:"any" > label:<name:"source_ports" value:"any" > label:<name:"table" value:"nat" > counter:<value:371 > with unregistered descriptor Desc{fqName: "nftables_rule_packets", help: "Packets, matched by rule per rule comment", constLabels: {}, variableLabels: [chain family table input_interfaces output_interfaces source_addresses destination_addresses source_ports destination_ports comment action]}
Collecting time longaer thsn 1.3 sec :(
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.