Commit Graph

7 Commits

Author SHA1 Message Date
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
Sven Grossmann
07e1e5bc4d feat: add UniFi Protect logs support with Loki integration
- Add SaveProtectLogs config option to enable Protect log collection
- Add ProtectThumbnails config option to fetch event thumbnails
- Add collectProtectLogs function with 24h default fetch window
- Add ProtectLogEvent for Loki reporting with separate thumbnail log lines
- Add PII redaction for Protect log entries
- Filter thumbnail fetching to camera events only (motion, smartDetect*, etc.)
- Update log output to show Protect logs status
2025-12-22 22:55:30 +01:00
Sven Grossmann
a3dc4cd0b2 feat: add save_syslog option for v2 system-log API
Add new save_syslog config option to collect events from the v2 UniFi
system-log API (/v2/api/site/{site}/system-log/all).

Changes:
- Add SaveSyslog field to Controller struct
- Add collectSyslog() function using v2 API
- Keep collectEvents() using v1 API for backwards compatibility
- Add RedactIPPII() helper for PII redaction
- Update lokiunifi to log raw JSON (parseable with Loki | json)
- Reduce indexed labels to low-cardinality fields only
- Add SystemLogEntry handler in lokiunifi report

Config: save_syslog (v2 API) vs save_events (v1 API)
Env: UP_UNIFI_DEFAULT_SAVE_SYSLOG=true
2025-12-22 17:23:53 +01:00
Cody Lee
b372198840 painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
Cody Lee
9bdc6e8d0f auto fix lint rules 2024-09-09 08:55:12 -05: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