Skip to content

prometheus-node-exporter-ucode: add nat_traffic collector#29705

Open
ricardnacher wants to merge 1 commit into
openwrt:masterfrom
ricardnacher:prometheus-node-exporter-ucode-nat-traffic
Open

prometheus-node-exporter-ucode: add nat_traffic collector#29705
ricardnacher wants to merge 1 commit into
openwrt:masterfrom
ricardnacher:prometheus-node-exporter-ucode-nat-traffic

Conversation

@ricardnacher

@ricardnacher ricardnacher commented Jun 10, 2026

Copy link
Copy Markdown

Maintainer: @dhewg

Summary

  • Adds a nat_traffic collector to prometheus-node-exporter-ucode, ported from the equivalent Lua collector in prometheus-node-exporter-lua
  • Reads /proc/net/nf_conntrack and exports per-(src, dst) pair byte totals (both directions summed) as node_nat_traffic gauge metrics
  • Adds a ucode-based unit test with a fixture file (test/nat_traffic.uc) for local development testing

Test plan

  • Unit test passes locally: ucode test/nat_traffic.uc (3/3 assertions)
  • CI test.sh handles prometheus-node-exporter-ucode-nat_traffic package variant; skips gracefully if /proc/net/nf_conntrack is absent
  • Verified collector output format matches the Lua version metric name (node_nat_traffic) and label schema (src, dst)

Signed-off-by: ricardnacher ricard.nacher@midokura.com

@ricardnacher ricardnacher force-pushed the prometheus-node-exporter-ucode-nat-traffic branch from fd8f965 to b494294 Compare June 26, 2026 11:02
@ricardnacher

Copy link
Copy Markdown
Author

Hi, just a friendly ping — this PR has been open for a couple of weeks. Would appreciate a review when you have a moment, and happy to make any changes if needed. Thanks! @GeorgeSapkin

@ricardnacher ricardnacher force-pushed the prometheus-node-exporter-ucode-nat-traffic branch from b494294 to 3ca7f8a Compare June 29, 2026 07:55
@ricardnacher

Copy link
Copy Markdown
Author

Hi @GeorgeSapkin, I fixed the signed-off name by amending the commit. Is there anything else needed before it can be reviewed? thanks

@GeorgeSapkin

GeorgeSapkin commented Jun 30, 2026

Copy link
Copy Markdown
Member

I'm neither a maintainer, nor a user of this package, so I don't have an opinion about this PR. At the very least, PKG_RELEASE needs to be bumped.

@BKPepe BKPepe force-pushed the prometheus-node-exporter-ucode-nat-traffic branch from 6f0655f to 38c330f Compare June 30, 2026 17:11
@BKPepe BKPepe requested a review from champtar June 30, 2026 17:12
@ricardnacher

Copy link
Copy Markdown
Author

I'm neither a maintainer, nor a user of this package, so I don't have an opinion about this PR. At the very least, PKG_RELEASE needs to be bumped.

I am sorry, thanks!

@champtar

champtar commented Jul 1, 2026

Copy link
Copy Markdown
Member

@ricardnacher can you fix the formalities please

@dhewg ping

@ricardnacher ricardnacher force-pushed the prometheus-node-exporter-ucode-nat-traffic branch 2 times, most recently from 96259d5 to 2f00592 Compare July 1, 2026 21:31
Add a nat_traffic collector for prometheus-node-exporter-ucode,
ported from the equivalent Lua collector in prometheus-node-exporter-lua.

Reads /proc/net/nf_conntrack and exports per-(src, dst) pair byte
totals (both directions summed) as node_nat_traffic gauge metrics.

Also includes a ucode-based unit test with a fixture file that can be
run locally with: ucode test/nat_traffic.uc

Signed-off-by: Ricard Nacher <ricard.nacher@midokura.com>
@ricardnacher ricardnacher force-pushed the prometheus-node-exporter-ucode-nat-traffic branch from 2f00592 to a696219 Compare July 1, 2026 21:36
@ricardnacher

Copy link
Copy Markdown
Author

@ricardnacher can you fix the formalities please

@dhewg ping

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants