30 Commits

Author SHA1 Message Date
Cody Lee
8c7f1cb854 fix: remove age==0 guard that silently dropped all rogue AP metrics (#972)
save_rogue = true collected data from the controller but never wrote
any of it to the output backends. All three exporters (InfluxDB, Datadog,
Prometheus) had the same guard:

    if s.Age.Val == 0 { return }

The intent was to drop stale entries, but the logic is inverted: Age==0
means brand-new or (more commonly) that the UniFi controller did not
include an "age" field in the JSON response, causing FlexInt to default
to 0. This silently discarded every rogue AP record.

Remove the guard entirely. The data was just fetched on-demand from the
controller; if the user opted in to save_rogue, they want all of it.

Fixes #405

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:53:07 -05:00
brngates98
6d85ea76ab Add device tag support to Prometheus metrics
- Add 'tag' label to all device metric descriptors
- Update exportWithTags helper to create separate metric series per tag
- Update all device export functions (UAP, USW, UDM, USG, UXG, PDU, UBB, UCI) to include tags
- Update all label arrays (VAP, Radio, Port, etc.) to include tag label
- Devices with multiple tags create multiple metric series (one per tag)
- Devices without tags export with tag=""

Requires unpoller/unifi#92
2026-01-28 20:48:10 -05:00
Cody Lee
b372198840 painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
Patrik Boström
d4dc0d76d6 Fix for upgradable metric for Prometheus 2023-02-25 22:46:26 +01:00
Cody Lee
06594f67eb move to the pkg dir 2022-12-02 20:46:16 -05:00
davidnewhall2
5e203701b5 initial 2019-12-28 17:08:16 -08:00
davidnewhall2
84edadaa94 Make a new docker image 2019-12-24 23:43:49 -08:00
davidnewhall2
0b8473657e convert input to plugin 2019-12-15 20:56:42 -08:00
davidnewhall2
b8d9ac9f88 not sure how far I got.. 2019-12-13 14:17:28 -08:00
davidnewhall2
ecd1c64004 Updates 2019-12-10 01:19:56 -08:00
davidnewhall2
65dfedcf27 got it 2019-12-10 01:01:54 -08:00
davidnewhall2
a512418a18 :( 2019-12-10 00:50:46 -08:00
davidnewhall2
39b25739be :( 2019-12-10 00:30:27 -08:00
davidnewhall2
4f77e5ea36 update deps, fix channel bug for uap_vaps 2019-12-03 12:09:07 -08:00
davidnewhall2
a7259bf3f0 add uptime back 2019-12-03 02:26:27 -08:00
davidnewhall2
9a48c771eb fixes 2019-12-03 02:18:32 -08:00
davidnewhall2
dbe0a6bc94 comments 2019-12-03 00:59:37 -08:00
davidnewhall2
4d485769d6 move pieces into methods 2019-12-03 00:19:47 -08:00
davidnewhall2
d565ee9c32 combine more counters, fix cpu/mem graphs, fix udmp type 2019-12-02 20:18:55 -08:00
davidnewhall2
09dbed72f8 comment cleanup 2019-12-02 19:40:29 -08:00
davidnewhall2
04789d54e9 add more labels, ditch uptime 2019-12-02 19:28:24 -08:00
davidnewhall2
bf74687f42 fixes 2019-12-02 18:38:58 -08:00
Ben Kochie
21de375c80 Cleanup duplicate station metrics
Combine "user" and "guest" station metrics into a single labeled metric
to avoid duplicate storage of the same data.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-12-02 22:41:43 +01:00
davidnewhall2
2212692d88 a couple more fixes 2019-12-01 19:04:17 -08:00
davidnewhall2
fa64b364c9 fix more ratios, combine export loops 2019-12-01 17:42:13 -08:00
David Newhall II
356ce45eb6 Apply suggestions from code review 2019-12-01 17:24:35 -08:00
Ben Kochie
1df763e684 Convert Prometheus percents to ratio
Typically we like to use ratio in Prometheus rather than percent as it
is easier to do math with.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-12-01 19:48:59 +01:00
Ben Kochie
3b515b854e Fix radio_transmit metric type
The metrics radio_transmit_{packets,retries} appear to gauges, not
counters.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-12-01 19:28:53 +01:00
Ben Kochie
1294cd8ccf Update channel utilization metrics
* Unit is percent.
* Drop "total" as it is the sum of transmit and receive.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-12-01 18:29:58 +01:00
davidnewhall2
ebe05ec3e5 move pkgs, update readme, add two more metrics to influx client 2019-11-30 01:45:42 -08:00