Upgrade unpoller v2.34.0 → v3.2.0, migrate to container.py (#361)

## Summary

- Service Review pickup: unpoller (last reviewed 73 days ago).
- Upgrades unpoller from v2.34.0 to v3.2.0 (major version bump).
- Migrates the container build from a Dockerfile to a native Dagger pipeline (`containers/unpoller/container.py`) following the navidrome / miniflux pattern.
- Refreshes `service-versions.yaml` (last-reviewed, current-version).

## Breaking changes (upstream)

- **v3.0.0** — UniFi network API shifts (later 10.x). Some metric / event / log names and labels may have changed. Worth a follow-up sweep of the unpoller Grafana dashboard for missing series.
- **v3.2.0** — defaults to a 60s background poll feeding cached Prometheus scrapes (was on-demand poll per scrape). To restore previous behavior, set `interval = 0` in `up.conf`. Leaving the new default in this PR — every-15s scrapes will simply serve from cache, which is fine for our use.

## Build

- Image: `registry.ops.eblu.me/blumeops/unpoller:v3.2.0-1b27242`
- Built by build-container workflow run #559 from this branch.

## Test plan

- [ ] `argocd app set unpoller --revision unpoller-v3 && argocd app sync unpoller`
- [ ] Pod comes Ready
- [ ] Verify metrics exported (`Site/Client/UAP/USG/USW` counts in logs, `unpoller_*` series in Prometheus)
- [ ] Spot-check unpoller Grafana dashboard for missing series after the v3 API shift
- [ ] After merge: `argocd app set unpoller --revision main && argocd app sync unpoller`

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

Reviewed-on: #361
This commit is contained in:
Erich Blume 2026-05-28 09:59:46 -07:00
commit 4d1f4af25b
5 changed files with 57 additions and 46 deletions

View file

@ -10,7 +10,7 @@ resources:
images: images:
- name: registry.ops.eblu.me/blumeops/unpoller - name: registry.ops.eblu.me/blumeops/unpoller
newTag: v2.34.0-613f05d newTag: v3.2.0-1b27242
configMapGenerator: configMapGenerator:
- name: unpoller-config - name: unpoller-config

View file

@ -1,43 +0,0 @@
# UnPoller — UniFi metrics exporter for Prometheus
# Two-stage build: Go compilation, then minimal Alpine runtime
ARG CONTAINER_APP_VERSION=v2.34.0
FROM golang:alpine3.22 AS build
ARG CONTAINER_APP_VERSION
RUN apk add --no-cache git
RUN git clone --depth 1 --branch ${CONTAINER_APP_VERSION} \
https://forge.ops.eblu.me/mirrors/unpoller.git /app
WORKDIR /app
ENV CGO_ENABLED=0
RUN go build -ldflags="-s -w \
-X main.version=${CONTAINER_APP_VERSION} \
-X main.builtBy=blumeops \
-X golift.io/version.Version=${CONTAINER_APP_VERSION} \
-X golift.io/version.Branch=HEAD \
-X golift.io/version.BuildUser=blumeops \
-X golift.io/version.Revision=blumeops-build" \
-o /bin/unpoller .
FROM alpine:3.22
ARG CONTAINER_APP_VERSION
LABEL org.opencontainers.image.title="UnPoller"
LABEL org.opencontainers.image.description="UniFi metrics exporter for Prometheus"
LABEL org.opencontainers.image.version="${CONTAINER_APP_VERSION}"
LABEL org.opencontainers.image.source="https://forge.eblu.me/eblume/blumeops"
LABEL org.opencontainers.image.vendor="blumeops"
RUN apk add --no-cache ca-certificates tzdata
COPY --from=build /bin/unpoller /usr/bin/unpoller
EXPOSE 9130
USER 65534:65534
ENTRYPOINT ["/usr/bin/unpoller"]
CMD ["--config", "/etc/unpoller/up.conf"]

View file

@ -0,0 +1,53 @@
"""UnPoller — UniFi metrics exporter for Prometheus.
Two-stage build: Go backend, Alpine runtime.
Source cloned from forge mirror.
"""
import dagger
from blumeops.containers import (
alpine_runtime,
clone_from_forge,
go_build,
oci_labels,
)
VERSION = "v3.2.0"
async def build(src: dagger.Directory) -> dagger.Container:
source = clone_from_forge("unpoller", VERSION)
backend = go_build(
source,
"/unpoller",
ldflags=(
f"-s -w "
f"-X main.version={VERSION} "
f"-X main.builtBy=blumeops "
f"-X golift.io/version.Version={VERSION} "
f"-X golift.io/version.Branch=HEAD "
f"-X golift.io/version.BuildUser=blumeops "
f"-X golift.io/version.Revision=blumeops-build"
),
)
runtime = alpine_runtime(
extra_apk=["ca-certificates", "tzdata"],
create_user=False,
)
runtime = oci_labels(
runtime,
title="UnPoller",
description="UniFi metrics exporter for Prometheus",
version=VERSION,
)
return (
runtime.with_file("/usr/bin/unpoller", backend.file("/unpoller"))
.with_exposed_port(9130)
.with_user("65534")
.with_default_args(
args=["/usr/bin/unpoller", "--config", "/etc/unpoller/up.conf"]
)
)

View file

@ -0,0 +1 @@
Upgrade unpoller v2.34.0 → v3.2.0 and migrate container build from Dockerfile to native Dagger (container.py). v3.0.0 carries breaking UniFi API changes; v3.2.0 introduces a 60s background poll (cached scrapes) by default — set `interval = 0` in `up.conf` to restore on-demand polling.

View file

@ -345,8 +345,8 @@ services:
- name: unpoller - name: unpoller
type: argocd type: argocd
last-reviewed: 2026-03-16 last-reviewed: 2026-05-28
current-version: "v2.34.0" current-version: "v3.2.0"
upstream-source: https://github.com/unpoller/unpoller/releases upstream-source: https://github.com/unpoller/unpoller/releases
notes: UniFi metrics exporter for Prometheus notes: UniFi metrics exporter for Prometheus