Bumps the all group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).
Updates `golang.org/x/crypto` from 0.51.0 to 0.52.0
- [Commits](https://github.com/golang/crypto/compare/v0.51.0...v0.52.0)
---
updated-dependencies:
- dependency-name: golang.org/x/crypto
dependency-version: 0.52.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all
...
Signed-off-by: dependabot[bot] <support@github.com>
Adds two new Prometheus metrics for UCI (UniFi Cable Internet) devices:
- unpoller_device_ci_state_operational (gauge): 1 if DOCSIS CI state ==
"Operational", else 0. Suitable for alerting on cable link health.
- unpoller_device_ci_state_info (gauge=1, info-style): exposes the full
DOCSIS CI state table as labels (ci_state, ci_sw_dl_status, ci_mac,
ci_version, ci_mode) for diagnostic dashboards.
The controller does expose a top-level `internet` boolean on UCI
devices, but it is not a reliable WAN-reachability signal — it stays
false even when the cable link is fully operational and the upstream
WAN is up. The UCI is a cable bridge with no independent internet-
reachability probe; real WAN health lives on the upstream gateway
(e.g. UDM wan1.up).
The ci_state field from ci_state_table IS reported reliably and is the
correct source-of-truth for DOCSIS link health.
Verified on a UCI in Operational state (ci_mode=D3.1).
Decouples Prometheus scrape cadence from upstream UniFi API calls so a
429 backoff loop on the controller side no longer stalls /metrics. The
output plugin now owns a 60s background poller (configurable) whose
result is served from an in-memory cache. Concurrent /scrape requests
for the same target are coalesced via singleflight to prevent a noisy
scraper from multiplying upstream load.
Adds two new metrics so operators can detect cache staleness and
refresh failures independently:
- unpoller_prometheus_cache_age_seconds
- unpoller_prometheus_refresh_failures_total
Background goroutine recovers from panics so a malformed input payload
no longer silently kills refreshes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The v3.1.2 release failed because homebrew_casks filters archives by
goarch=[amd64 arm64], but universal_binaries.replace=true collapses the
darwin amd64+arm64 builds into a single darwin/all archive — which the
cask filter rejects.
Drop the universal_binaries block. The unpoller-mac build still produces
darwin amd64 and darwin arm64 separately, and the cask resolves them
into per-arch on_intel/on_arm blocks. Net effect on release artifacts:
the single universal macOS archive is replaced by two per-arch archives.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Rename archives.builds/nfpms.builds to ids; convert format/format_overrides.format to formats arrays.
- Collapse three dockers + six docker_manifests entries into one dockers_v2 block; update Dockerfile to use $TARGETPLATFORM for multi-arch buildx.
- Migrate brews to homebrew_casks (binary->binaries, url_template->url.template, install/post_install->hooks.post.install). Cask is macOS-only, so ids is reduced to unpoller-mac.
Per-arch image tags (e.g. :latest-amd64, :latest-arm64v8, :latest-armv7) are no longer published; only the multi-arch manifest tags (latest, v{Major}, full version) remain. Linuxbrew install path is dropped; Linux users should use the deb/rpm or Docker image.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Picks up the gzip decompression fix for the Site Manager remote API
(unpoller/unifi#220), which restores remote-API discovery for Official
UniFi Cloud Hosted consoles whose responses are gzip-compressed but
served without a Content-Encoding header.
Closes#997
Bumps github.com/unpoller/unifi/v5 from v5.26.0 to v5.27.0 along with
golang.org/x/crypto, term, sys, and text to their latest releases.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Influx and Datadog integration tests assert that the captured field/gauge
sets exactly match the YAML. Add the new uap uplink_* entries so the
TestInfluxV1Integration and Datadog integration tests stay green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Exposes the uplink medium (wire vs wireless) and link speed for UniFi access
points so users can detect when an AP downgrades from gigabit to fast ethernet,
which was the original ask in #988. UAPs previously had zero uplink coverage
in any output plugin; now influxunifi, datadogunifi, and promunifi all report
uplink_type, uplink_speed, uplink_max_speed, and related fields.
Also brings Prometheus to parity with Influx/Datadog by emitting uplink
metrics for USW, UBB, and UDB devices (previously only USG/UDM/UXG had them
in promunifi). A new exportDeviceUplink helper in promunifi/usg.go reuses
the existing unpoller_device_uplink_* descriptors to avoid descriptor
collision (per c48b9917).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes#1001. Mirrors the DataDog plugin's global tags feature for
InfluxDB. Per-metric tags take precedence on key collision so
site/device identifiers can never be overwritten by a misconfigured
global. Configurable via TOML/JSON/YAML under influxdb.tags.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
descIntegrationDevice was registered with namespace prefix
"unpoller_device_", producing "unpoller_device_uptime_seconds" with
labels {device_id} and a different help string than the existing
descDevice() metric of the same FQDN (labels {type, site_name, name,
source, tag}, help "Device Uptime"). Prometheus MustRegister panics on
inconsistent descriptors for the same fully-qualified name, causing
v3.0.0 to crashloop on startup whenever the Prometheus output was
enabled.
Move the Integration/v1 device metrics under a dedicated
"integration_device_" name prefix, matching the convention used by the
other Integration/v1 collectors added in the same release (e.g.
wifi_broadcast_*, acl_rule_*, mclag_domain_*, pending_device_*), where
the bare namespace prefix is passed in and the type prefix is baked
into each metric name string.
Affected metric renames:
unpoller_device_uptime_seconds -> unpoller_integration_device_uptime_seconds
unpoller_device_cpu_utilization_pct -> unpoller_integration_device_cpu_utilization_pct
unpoller_device_memory_utilization_pct -> unpoller_integration_device_memory_utilization_pct
unpoller_device_load_average_{1,5,15}min -> unpoller_integration_device_load_average_{1,5,15}min
unpoller_device_radio_tx_retries_pct -> unpoller_integration_device_radio_tx_retries_pct
unpoller_device_uplink_{rx,tx}_rate_bps -> unpoller_integration_device_uplink_{rx,tx}_rate_bps
Fixes#1002Fixes#1004
The Homebrew formula's install/post_install blocks referenced
examples/up.conf, but the source tarball ships examples/up.conf.example,
causing brew install to fail with ENOENT. Update both references to use
the correct filename, matching how the rest of .goreleaser.yaml already
sources this file.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds 21 new data types from unifi v5.26.0 across all metric output plugins
(InfluxDB, Prometheus, DataDog). Per-site Integration/v1 calls are gated on
API key configuration and only run for user-configured sites; ErrEndpointNotFound
is handled gracefully so older firmware continues to work without log spam.
Also migrates events collection (collectAlarms, collectAnomalies, collectEvents,
collectIDs, collectProtectLogs) to handle Network 10.x+ endpoint removals via
ErrEndpointNotFound, with debug-level logging to avoid per-poll noise.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps the all group with 2 updates: [golang.org/x/crypto](https://github.com/golang/crypto) and [golang.org/x/term](https://github.com/golang/term).
Updates `golang.org/x/crypto` from 0.49.0 to 0.50.0
- [Commits](https://github.com/golang/crypto/compare/v0.49.0...v0.50.0)
Updates `golang.org/x/term` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/term/compare/v0.41.0...v0.42.0)
---
updated-dependencies:
- dependency-name: golang.org/x/crypto
dependency-version: 0.50.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all
- dependency-name: golang.org/x/term
dependency-version: 0.42.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all
...
Signed-off-by: dependabot[bot] <support@github.com>
Adds docker-compose-remote.yml and matching env example for running
unifi-poller against the UniFi cloud API instead of a local controller.
Uses UP_UNIFI_REMOTE and UP_UNIFI_REMOTE_API_KEY for auto-discovery of
all Network-capable consoles via api.ui.com.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The legacy /stat/stadpi and /stat/sitedpi endpoints return empty data
on UniFi Network 9.1+ (issue #834). The v2 /traffic endpoint already
existed in the unifi library and in the collector, but was only called
when both SaveTraffic and SaveDPI were enabled — most users only set
SaveDPI=true and never saw any data.
- Remove the SaveTraffic gate on GetClientTraffic; call it whenever
SaveDPI is enabled, treating it as a DPI data source
- Downgrade GetClientTraffic errors to debug-log so old firmware that
lacks the v2 endpoint continues to use the legacy API without error
- Add convertToSiteDPI to aggregate per-client v2 data into per-site
DPITable entries, filling SitesDPI when the legacy endpoint is empty
- Legacy API results are preserved; v2 data only supplements sites not
already covered, so old-firmware users are unaffected
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
golangci-lint auto-fixes across multiple packages:
- wsl_v5: blank lines between logical blocks
- nlreturn: newlines before return statements
- tagalign: struct field tag alignment
No logic changes.
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* feat: add Site Magic site-to-site VPN metrics (closes#926)
Bump github.com/unpoller/unifi/v5 to v5.25.0 which adds:
- GetMagicSiteToSiteVPN / GetMagicSiteToSiteVPNSite API methods
- MagicSiteToSiteVPN types with mesh, connection, device, and status structs
- Missing VPN health fields on Site.Health (SiteToSiteNumActive/Inactive,
SiteToSiteRxBytes/TxBytes/RxPackets/TxPackets)
Implement VPN metrics collection across all output plugins:
- Collect Site Magic VPN mesh data per-site in inputunifi pollController
- Propagate VPNMeshes through poller.Metrics / AppendMetrics
- Apply DefaultSiteNameOverride for VPN meshes in augmentMetrics /
applySiteNameOverride
- influxunifi: vpn_mesh, vpn_mesh_connection, vpn_mesh_status tables
- promunifi: vpn_mesh_*, vpn_tunnel_*, vpn_mesh_status_* gauges
- datadogunifi: unifi.vpn_mesh.*, unifi.vpn_tunnel.*, unifi.vpn_mesh_status.*
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* feat(otelunifi): add Site Magic VPN metrics to OpenTelemetry output
Adds exportVPNMeshes to the otel output plugin, emitting the same
unifi_vpn_mesh_*, unifi_vpn_tunnel_*, and unifi_vpn_mesh_status_*
gauges as the other output plugins.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Collect port anomalies from the UniFi v2 API endpoint
/proxy/network/v2/api/site/{site}/ports/port-anomalies and export
them to all output plugins (Prometheus, InfluxDB, DataDog, OpenTelemetry).
Metrics exported per port:
- port_anomaly_count – number of anomaly events
- port_anomaly_last_seen – unix timestamp of last event
Labels: site_name, source, device_mac, port_idx, anomaly_type
Bumps github.com/unpoller/unifi/v5 to v5.24.0 which adds GetPortAnomalies.
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Bumps github.com/unpoller/unifi/v5 to v5.23.0 which adds
GetTopology() fetching vertices (devices/clients) and edges
(wired/wireless connections) from /proxy/network/v2/api/site/{site}/topology.
Changes across the stack:
- poller.Metrics: add Topologies []any field + AppendMetrics support
- inputunifi: collect topology per-site (non-fatal on older controllers),
pass through augmentMetrics with site name override support
- promunifi: new topology.go with summary, connection-type, link-quality,
and band-distribution gauges
- influxunifi: new topology.go with topology_summary and topology_edge
measurements
- datadogunifi: new topology.go with equivalent Datadog gauges
- otelunifi: new topology.go with OpenTelemetry gauge observations
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* feat(clients): add MIMO spatial stream metrics for WiFi clients
Add tx_nss, rx_nss (spatial stream count) and tx_mcs, rx_mcs (MCS
index) metrics for WiFi clients, sourced from UniFi controller API
fields. These fields are only populated for wireless clients.
- promunifi: adds unifi_client_radio_transmit_spatial_streams,
unifi_client_radio_receive_spatial_streams,
unifi_client_radio_transmit_mcs_index, and
unifi_client_radio_receive_mcs_index gauges
- influxunifi: adds tx_nss, rx_nss, tx_mcs, rx_mcs fields to the
clients measurement
- go.mod: replace directive to use local unifi library with new fields
Closes#535
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix: use published unifi commit for MIMO fields instead of local replace
Remove the local path replace directive for github.com/unpoller/unifi/v5
and pin to the published pseudo-version at commit f363f61cdbe3a863db5fb3176ef1c0fc282c5674
which contains the RxMcs, RxNSS, TxMcs, TxNSS MIMO fields.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add job=unpoller to every Loki stream (alarm, anomaly, event, ids,
system_log, protect_log, protect_thumbnail) for standard Grafana/Loki
source filtering with {job="unpoller"}
- Add event_type and inner_alert_action labels to IDS streams using
EventType and InnerAlertAction fields
- Add event_type and inner_alert_action labels to Alarm streams using
Key and InnerAlertAction fields
- Skip severity/category on Anomaly: the unifi.Anomaly struct has no
such fields
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add the site_to_site_enabled FlexBool field from the vpn subsystem
health entry to both InfluxDB and Prometheus outputs. The field was
present in the unifi.Health struct but never exported.
- influxunifi: add site_to_site_enabled to subsystems fields map
- promunifi: add SiteToSiteEnabled gauge descriptor and emit it in
the vpn case of exportSite
- Update integration_test_expectations.yaml to include the new field
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add an ExtraLabels map[string]string field to the Loki Config struct so
users can define static key=value labels that are merged into the stream
labels of every log line sent to Loki. This allows users to distinguish
streams (e.g., by environment or datacenter) without hardcoding values.
Built-in dynamic labels (application, site_name, source, etc.) always
take precedence over extra labels to preserve existing behavior.
Example config (TOML):
[loki.extra_labels]
environment = "production"
datacenter = "us-east-1"
Closes#691
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add a per-controller `<namespace>_controller_up` Prometheus GaugeVec with
a `source` label (controller URL or configured ID). The gauge is set to 1
after each successful poll and 0 on failure, giving operators a standard
metric to alert on controller connectivity issues.
Changes:
- pkg/poller/config.go: add ControllerStatus type and ControllerStatuses
field to Metrics so any output plugin can consume per-controller health.
- pkg/poller/inputs.go: merge ControllerStatuses when AppendMetrics is
called (multiple input sources).
- pkg/inputunifi/interface.go: populate ControllerStatuses with Up=true
on success and Up=false (while still continuing) on per-controller error.
- pkg/promunifi/collector.go: declare and register a prometheus.GaugeVec
`<namespace>_controller_up`; set the gauge for each controller status
after every Collect cycle.
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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>