GithubHelp home page GithubHelp logo

sheridan / nftables_exporter Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 4.0 65 KB

Export nftables statistics to prometheus

License: GNU General Public License v3.0

Makefile 3.87% Go 91.71% Shell 4.42%

nftables_exporter's People

Contributors

sheridan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nftables_exporter's Issues

"An error has occurred while serving metrics" with "counter"

# 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]}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.