openwrt / openwrt/packages

prometheus-node-exporter-lua: Cannot bind to tailscale0

Open
#28,449 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Package Name

prometheus-node-exporter-lua

Maintainer

@champtar

OpenWrt Version

24.10.5

OpenWrt Target/Subtarget

mediatek/mt7622

Steps to Reproduce
  1. Install and setup tailscale following the docs: https://openwrt.org/docs/guide-user/services/vpn/tailscale/start?s[]=open&s[]=general#initial_setup
  2. Install prometheus-node-exporter-lua and try to set it to listen in tailscale0:
config prometheus-node-exporter-lua 'main'
	option listen_interface 'tailscale0'
	option listen_port '9100'
  1. It never starts properly: defering start until listen interface tailscale0 becomes ready
Actual Behaviour

It never opens up the 9100 port and reports that tailscale0 is not ready which is not true. The interesting thing is that with interface '*' it also listens to tailscale0 as it should.

I think the problem is that tailscale0 is unamanaged, so network_get_ipaddr bind4 "$interface" returns nothing for tailscale0.

Not sure how to fix this. I could do something like but its a bit ugly and hacky:

[ -z "$bind4$bind6" ] && {
    # Fallback for unmanaged interfaces - get IP directly
    bind4=$(ip -4 addr show "$interface" 2>/dev/null | grep -oP 'inet \K[\d.]+' | head -1)
    bind6=$(ip -6 addr show "$interface" 2>/dev/null | grep -oP 'inet6 \K[^/]+' | grep -v '^fe80' | head -1)
}

Thank you.

Confirmation Checklist

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the prometheus-node-exporter-lua init script at the network_get_ipaddr bind4 call linked in the issue, and compare its handling of tailscale0 with the wildcard interface. Verify the behavior with the reported configuration and confirm that the exporter starts and opens port 9100 on tailscale0.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, prometheus, shell
Domain
networking, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.