Commit Graph

39 Commits

Author SHA1 Message Date
Cody Lee 0ffe6152ab
Fix multi-WAN speed test reporting (issue #841)
Speed tests were not being reported correctly for multi-WAN setups
because the device-level speedtest-status field was returning zeros.
The data has moved to a new aggregated dashboard API endpoint.

Changes:
- Add GetSpeedTests() and GetSiteSpeedTests() methods to fetch from
  /v2/api/site/{site}/aggregated-dashboard endpoint
- Create SpeedTestResult data structures to capture per-WAN metrics
- Update Prometheus exporter with new speedtest_* metrics per interface
- Update InfluxDB exporter to write speedtest measurements per WAN
- Update Datadog exporter with unifi.speedtest.* metrics per WAN
- Update metrics collection to include speed test data for all sites

Metrics now include labels/tags for:
- wan_interface: Physical interface (eth8, eth9, etc.)
- wan_group: Logical WAN name (WAN, WAN2, etc.)
- site_name: Site identifier
- source: Controller URL

Gracefully handles older controllers without the new API endpoint.

Fixes #841

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 16:46:14 -06:00
Cody Lee c61d2651a2
Enhance InfluxDB and Datadog UBB outputs with comprehensive metrics
This change significantly expands the metrics exported for UBB devices
to InfluxDB and Datadog, matching the comprehensive coverage added to
the Prometheus output.

Changes to InfluxDB (pkg/influxunifi/ubb.go):
- Added batchUBBstats() to export comprehensive statistics separated
  by radio (total, wifi0, terra2, user-wifi0, user-terra2)
- Added VAP table export via processVAPTable()
- Added Radio table export via processRadTable()
- Added P2P stats (rx_rate, tx_rate, throughput)
- Added link quality metrics (link_quality, link_quality_current,
  link_capacity)
- Comprehensive stats exported to new "ubb_stats" table with full
  breakdown of traffic per radio

Changes to Datadog (pkg/datadogunifi/ubb.go):
- Added batchUBBstats() to export comprehensive statistics separated
  by radio (total, wifi0, terra2, user-wifi0, user-terra2)
- Added VAP table export via processVAPTable()
- Added Radio table export via processRadTable()
- Added P2P stats (rx_rate, tx_rate, throughput)
- Added link quality metrics (link_quality, link_quality_current,
  link_capacity)
- Comprehensive stats exported with namespace "ubb.stats"

All implementations now fully support:
- 5GHz radio (wifi0) metrics
- 60GHz radio (terra2/ad) metrics - Full 802.11ad support!
- Per-radio RX/TX packets, bytes, errors, dropped, retries
- User-specific metrics for each radio
- Interface-specific metrics (ath0 for 5GHz, wlan0 for 60GHz)
- Point-to-point link statistics and quality metrics

Fixes: #409

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 11:04:35 -06:00
Cody Lee 7e2fb0135e
fix dd client interface change, update deprecated context lib in influxdb 2025-12-03 11:51:40 -06:00
Cody Lee 6f4384c18d
fix linting 2025-12-03 11:40:21 -06:00
Cody Lee c3126d27e3
interface change updates 2025-08-20 11:36:29 -05:00
Cody Lee 4b19b873ab
address issue 2025-04-04 08:33:58 -05:00
Cody Lee 6d4065113f
fixes metrics prefix names for ubb and uci devices 2025-01-15 15:50:47 -06:00
Cody Lee ed3c222992
oops fix dd expectation 2025-01-02 12:51:37 -06:00
Cody Lee 9d1f8606df
update expectations 2025-01-02 12:46:17 -06:00
Cody Lee 4da299ff46
adds device uplink stats for issue #585 2025-01-02 12:41:34 -06:00
Cody Lee 1b120a258a
tests pass locally; 2025-01-02 11:33:28 -06:00
Cody Lee 3602d8cc8f
adds in UBB & UCI support 2025-01-02 08:57:47 -06:00
Cody Lee a30c82093d
add ubb and uci initial support 2024-12-31 16:26:54 -06:00
Cody Lee 78f30e0056
fix vet 2024-12-31 14:47:06 -06:00
Cody Lee b372198840
painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
Cody Lee b9d668abee
upgrading dependencies 2024-12-31 14:23:53 -06:00
Cody Lee 9bdc6e8d0f
auto fix lint rules 2024-09-09 08:55:12 -05:00
Cody Lee 4bd56677c9
fix type 2024-04-19 15:43:00 -05:00
Cody Lee 7308a1c2e6
fix type errors 2024-04-03 12:17:24 -05:00
Mike Piatek-Jimenez 5514be1a57 Update the test expectations for the datadog output package. 2023-09-10 22:15:50 -04:00
Cody Lee 7e87e7f4fb
rename package per per comment, add comments, and drop unnecessary compile time check 2023-08-03 09:27:09 -05:00
Cody Lee 11142c0209
remove nl 2023-07-31 16:16:48 -05:00
Cody Lee ffb8579369
add integration test guard;
datadog integration test works

influx package tests

update unifi version

golanglint-ci and address *all* issues.

all tests pass

bump unifi version
2023-07-31 14:40:33 -05:00
Cody Lee 0e4affbcd5
update unifi to v0.3.5, fix flexint conversions 2023-07-18 11:59:41 -05:00
Cody Lee 0f915e88c9
bump unifi version and fix data types
https://github.com/unpoller/unpoller/issues/575
2023-07-18 10:57:23 -05:00
Cody Lee 1edb580084
bump unifi client and address
https://github.com/unpoller/dashboards/issues/20\#issuecomment-1364716049
and the duplicate https://github.com/unpoller/unpoller/issues/492
2023-01-06 21:12:24 -06:00
Cody Lee 3768c53512
CLI works 2022-12-22 18:16:43 -06:00
Cody Lee db9bcd5687
add new interface for testing 2022-12-22 17:44:39 -06:00
Cody Lee 0ab3de2ec4
add dd support 2022-12-21 21:48:02 -06:00
Cody Lee 0329066fe5
remote upgrade metrics for #433 2022-12-21 20:14:22 -06:00
Cody Lee acd6592f5c
another NPE for #422 2022-12-20 21:35:06 -06:00
Cody Lee 2e8fb0b2ec
FlexInt adaptation 2022-12-20 21:29:56 -06:00
Cody Lee 97b3a476f9
fixes NPE on issue #422 2022-12-20 20:53:48 -06:00
Cody Lee 3f509198fe
change the order for which we check these to avoid a NPE 2022-12-20 20:09:04 -06:00
Cody Lee fded91ce40
fixed start loop 2022-12-11 13:00:40 -06:00
Cody Lee bd51cf59f3
move to a common pattern on output plugins to catch common issues 2022-12-05 22:00:48 -06:00
Cody Lee 247cc868b3
go 1.19 interface{} -> any 2022-12-03 16:32:12 -06:00
Cody Lee 1900e69d7a
all to pkg 2022-12-02 20:48:01 -05:00
Cody Lee 06594f67eb
move to the pkg dir 2022-12-02 20:46:16 -05:00