unpoller_unpoller/pkg
Cody Lee dabfeffe66
fix(prometheus): serve scrapes from cached background poll (#1013)
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>
2026-05-11 17:43:44 -05:00
..
datadogunifi test: update integration expectations for new UAP uplink fields 2026-05-09 09:27:30 -05:00
influxunifi test: update integration expectations for new UAP uplink fields 2026-05-09 09:27:30 -05:00
inputunifi feat: upgrade unifi to v5.26.0 and add Integration/v1 + new legacy metrics 2026-05-08 16:45:47 -05:00
lokiunifi chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00
mysqlunifi add integration test guard; 2023-07-31 14:40:33 -05:00
otelunifi chore: apply linter auto-fixes (wsl_v5, nlreturn, tagalign) (#984) 2026-03-23 21:10:52 -05:00
poller feat: upgrade unifi to v5.26.0 and add Integration/v1 + new legacy metrics 2026-05-08 16:45:47 -05:00
promunifi fix(prometheus): serve scrapes from cached background poll (#1013) 2026-05-11 17:43:44 -05:00
unittest Temp fix for test cases and warning from Dockerfile 2025-12-24 00:23:05 -05:00
webserver Fix health check port binding conflict (issue #892) 2025-12-09 08:11:21 -06:00