fix: two observability bugs from initial deployment #3

Merged
greg merged 1 commits from klaatu/nixos:fix/observability-bugs into main 2026-03-25 21:40:06 +00:00
Collaborator

Two bugs surfaced after the observability stack was deployed.

Fix 1 — UnPoller 404 on UDM Pro

The UDM Pro runs UniFi OS, which uses a completely different internal API path (/proxy/network/) compared to the classic UniFi controller (which used :8443). UnPoller handles this path rewriting internally — but only if the URL has no port. With :8443 appended, it hits the wrong endpoint and gets a 404.

From the unpoller docs:

When configuring, make sure that you do not include :8443 on the url of the controller if you are using UniFi OS. Those are: UDM Pro, UDM, UXG, or CloudKey with recent firmware.

Fix: UP_UNIFI_DEFAULT_URL changed from https://10.42.1.1:8443https://10.42.1.1.

Fix 2 — Grafana dashboards showing invalid datasource

Without an explicit uid in the datasource provisioning YAML, Grafana auto-generates a random UID on first startup. All four dashboard JSON files reference datasource.uid = "prometheus" — which only resolves if the provisioning explicitly sets that UID.

Fix: added uid = "prometheus" to the Prometheus datasource in hosea/default.nix.

After deploying this, Grafana will need a restart (or the datasource reprovisioned) to pick up the UID change. The dashboards should work immediately after.

Opened by Klaatu 🌌

Two bugs surfaced after the observability stack was deployed. ### Fix 1 — UnPoller 404 on UDM Pro The UDM Pro runs UniFi OS, which uses a completely different internal API path (`/proxy/network/`) compared to the classic UniFi controller (which used `:8443`). UnPoller handles this path rewriting internally — but **only** if the URL has no port. With `:8443` appended, it hits the wrong endpoint and gets a 404. From the unpoller docs: > When configuring, make sure that you do not include `:8443` on the url of the controller if you are using UniFi OS. Those are: UDM Pro, UDM, UXG, or CloudKey with recent firmware. Fix: `UP_UNIFI_DEFAULT_URL` changed from `https://10.42.1.1:8443` → `https://10.42.1.1`. ### Fix 2 — Grafana dashboards showing invalid datasource Without an explicit `uid` in the datasource provisioning YAML, Grafana auto-generates a random UID on first startup. All four dashboard JSON files reference `datasource.uid = "prometheus"` — which only resolves if the provisioning explicitly sets that UID. Fix: added `uid = "prometheus"` to the Prometheus datasource in `hosea/default.nix`. After deploying this, Grafana will need a restart (or the datasource reprovisioned) to pick up the UID change. The dashboards should work immediately after. > Opened by Klaatu 🌌
klaatu added 1 commit 2026-03-25 17:37:55 +00:00
fix: two observability bugs from initial deployment
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
2d874d3969
Fix 1 - UnPoller 404 on UDM Pro:
  Remove :8443 from UP_UNIFI_DEFAULT_URL. UniFi OS devices (UDM Pro,
  UDM, UXG, CloudKey) use a different API path and do NOT use port 8443.
  URL should be https://10.42.1.1 (no port); unpoller handles the
  /proxy/network path internally for UniFi OS devices.

Fix 2 - Grafana dashboards showing invalid datasource:
  Add uid = "prometheus" to the provisioned Prometheus datasource.
  Without an explicit UID, Grafana auto-generates one on first run.
  All dashboard JSON references datasource uid "prometheus" which
  only works if the provisioning explicitly sets that UID.
greg merged commit 9b8f883de5 into main 2026-03-25 21:40:06 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: greg/nixos#3