I like understanding systems from the lower layers up.
Linux, networks, infrastructure, and security.
Pinned Loading
-
Add Forwarded packet count to node-e...
Add Forwarded packet count to node-exporter netstat 1By default, node exporter supports collecting netstat info, but not all of it. When you run `netstat -s` there are lots of useful information which are not present in the node-exporter's netstat info.
2The statistics in `netstat -s` come from two sources, `/proc/net/netstat` and `/proc/net/snmp`. node-exporter also uses these two sources, but does not collect all of its information. [It uses a regex](https://github.com/prometheus/node_exporter/blob/b6227af54b20d147463e1672a3e8bfca47fa10ee/collector/netstat_linux.go#L39) to filter and collect some of these stats.
3Like me, you may need to collect one of these unexported metrics. In my case, I needed `forwarded` or to be more accurate, `ForwDatagrams` which indicates the number of forwarded packets. It's useful when you're running a software router and want to keep track of it in prometheus and grafana.
4Fortunately, there is a way to change the regex and select which statistics you want to collect without changing the node-exporter source code.
5In my case, I just had to add `Ip_ForwDatagrams` to the default regex and pass it as the following argument:
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.

