Skip to content

Conversation

@vooon
Copy link
Contributor

@vooon vooon commented Nov 15, 2025

📦 Package Details

Maintainer: @dhewg

Description:

  • Add a plugin to export go2rtc metrics

Requires additional api_url option to enable:

uci set prometheus-node-exporter-ucode.go2rtc=collector
uci set prometheus-node-exporter-ucode.go2rtc.api_url='http://127.0.0.1:1984'

🧪 Run Testing Details

  • OpenWrt Version: SNAPSHOT
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: KVM

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@dhewg
Copy link
Contributor

dhewg commented Nov 15, 2025 via email

@vooon
Copy link
Contributor Author

vooon commented Nov 15, 2025

@dezhwrt at first i've tried to use native uclient, but cannot make it work. I'm not familiar how uhttp runs ucode, perhaps trouble was somewhere nearby uloop, don't remember.

@dhewg
Copy link
Contributor

dhewg commented Nov 15, 2025 via email

@dhewg
Copy link
Contributor

dhewg commented Nov 15, 2025

github still fails it, let's try again...
0001-prometheus-node-exporter-ucode-fetch-test.patch

@vooon vooon force-pushed the add-go2rtc-exporter branch from 18e01bf to 1e59e36 Compare November 16, 2025 11:48
@vooon
Copy link
Contributor Author

vooon commented Nov 16, 2025

@dhewg thanks! I've changed fetch using your guide, works well.

@dhewg
Copy link
Contributor

dhewg commented Nov 16, 2025 via email

@vooon
Copy link
Contributor Author

vooon commented Nov 16, 2025

Here is example (after grep go2rtc):

go2rtc_up{url="http://127.0.0.1:1984"} 1
# TYPE go2rtc_producer_info gauge
go2rtc_producer_info{stream="cam20_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam20_subs",format_name="rtsp",protocol="rtsp+tcp",remote_addr="192.168.25.20:554",user_agent="go2rtc/1.9.11"} 1
# TYPE go2rtc_producer_received_bytes_total counter
go2rtc_producer_received_bytes_total{stream="cam20_subs",remote_addr="192.168.25.20:554"} 75876
# TYPE go2rtc_consumer_info gauge
go2rtc_consumer_info{stream="cam20_subs",format_name="webrtc",protocol="ws+udp",remote_addr="192.168.106.1:53139 prflx",user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0"} 1
# TYPE go2rtc_consumer_sent_bytes_total counter
go2rtc_consumer_sent_bytes_total{stream="cam20_subs",remote_addr="192.168.106.1:53139 prflx"} 75853
go2rtc_consumer_info{stream="cam20_subs",format_name="webrtc",protocol="ws+udp",remote_addr="192.168.106.1:10056 prflx",user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0"} 1
go2rtc_consumer_sent_bytes_total{stream="cam20_subs",remote_addr="192.168.106.1:10056 prflx"} 37496
go2rtc_producer_info{stream="cam21_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam21_subs",format_name="rtsp",protocol="rtsp+tcp",remote_addr="192.168.25.21:554",user_agent="go2rtc/1.9.11"} 1
go2rtc_producer_received_bytes_total{stream="cam21_subs",remote_addr="192.168.25.21:554"} 43324
go2rtc_consumer_info{stream="cam21_subs",format_name="webrtc",protocol="ws+udp",remote_addr="192.168.106.1:9141 prflx",user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0"} 1
go2rtc_consumer_sent_bytes_total{stream="cam21_subs",remote_addr="192.168.106.1:9141 prflx"} 43333
...
go2rtc_producer_info{stream="cam33_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam33_subs",format_name="rtsp",protocol="rtsp+tcp",remote_addr="192.168.25.33:554",user_agent="go2rtc/1.9.11"} 1
go2rtc_producer_received_bytes_total{stream="cam33_subs",remote_addr="192.168.25.33:554"} 19952
go2rtc_consumer_info{stream="cam33_subs",format_name="webrtc",protocol="ws+udp",remote_addr="192.168.106.1:1065 prflx",user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0"} 1
go2rtc_consumer_sent_bytes_total{stream="cam33_subs",remote_addr="192.168.106.1:1065 prflx"} 19950
...
go2rtc_producer_info{stream="cam42_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam42_subs",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam43_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="cam43_subs",format_name="",protocol="",remote_addr="",user_agent=""} 0
...
go2rtc_producer_info{stream="vto_main",format_name="",protocol="",remote_addr="",user_agent=""} 0
go2rtc_producer_info{stream="vto_subs",format_name="rtsp",protocol="rtsp+tcp",remote_addr="192.168.25.24:554",user_agent="go2rtc/1.9.11"} 1
go2rtc_producer_received_bytes_total{stream="vto_subs",remote_addr="192.168.25.24:554"} 1592034
go2rtc_consumer_info{stream="vto_subs",format_name="webrtc",protocol="ws+udp",remote_addr="192.168.106.1:55321 prflx",user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0"} 1
go2rtc_consumer_sent_bytes_total{stream="vto_subs",remote_addr="192.168.106.1:55321 prflx"} 1516326
node_scrape_collector_duration_seconds{collector="go2rtc"} 0.007565396
node_scrape_collector_success{collector="go2rtc"} 1
100 54247    0 54247    0     0   147k      0 --:--:-- --:--:-- --:--:--  147k
* Connection #0 to host 192.168.60.148 left intact
node_uname_info{sysname="Linux",nodename="go2rtc",release="6.12.57",version="#0 SMP Sun Nov 16 10:23:44 2025",machine="",domainname="(none)"} 1

Currently i only check if Frigate remote connected and consumes data.
With native instrumentation probably more things may be exposed... But that's enough to me.

@dhewg
Copy link
Contributor

dhewg commented Nov 16, 2025 via email

@vooon
Copy link
Contributor Author

vooon commented Nov 16, 2025

Screenshot 2025-11-16 at 14-39-17 Explore - VictoriaMetrics (Prom) - Grafana

Funny, now it 2 times faster than netstat. Obviously ubus call introduced lots of past ~40ms.

@vooon
Copy link
Contributor Author

vooon commented Nov 16, 2025

Screenshot 2025-11-16 at 14-44-03 Explore - VictoriaMetrics (Prom) - Grafana

How it looks now.

@vooon vooon force-pushed the add-go2rtc-exporter branch from 1e59e36 to 48992d6 Compare November 16, 2025 17:17
@dhewg
Copy link
Contributor

dhewg commented Nov 17, 2025 via email

@vooon vooon force-pushed the add-go2rtc-exporter branch from 48992d6 to 19c980d Compare November 17, 2025 09:13
@vooon
Copy link
Contributor Author

vooon commented Nov 17, 2025

@dhewg done.

@vooon vooon force-pushed the add-go2rtc-exporter branch from 19c980d to 6038833 Compare November 17, 2025 09:14
@vooon vooon force-pushed the add-go2rtc-exporter branch 6 times, most recently from 805be0a to 0031418 Compare November 25, 2025 07:54
@vooon vooon force-pushed the add-go2rtc-exporter branch from 0031418 to 9c4585c Compare November 25, 2025 12:17
@vooon
Copy link
Contributor Author

vooon commented Nov 25, 2025

Wtf with that CI? RV64, PPC always fails, even here, where no compilation at all...

@vooon vooon force-pushed the add-go2rtc-exporter branch 2 times, most recently from 2b4e0fa to 8df3cdf Compare December 7, 2025 14:22
@vooon vooon force-pushed the add-go2rtc-exporter branch 3 times, most recently from 2d9d271 to a65ea32 Compare December 10, 2025 18:14
- Add a plugin to export go2rtc metrics

Requires additional api_url option to enable:

```
uci set prometheus-node-exporter-ucode.go2rtc=collector
uci set prometheus-node-exporter-ucode.go2rtc.api_url=\
'http://127.0.0.1:1984'
uci commit
```

Co-authored-by: Andre Heider <[email protected]>
Signed-off-by: Vladimir Ermakov <[email protected]>
@vooon vooon force-pushed the add-go2rtc-exporter branch from a65ea32 to f0c4ed7 Compare December 10, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants