diff --git a/argocd/manifests/grafana/deployment.yaml b/argocd/manifests/grafana/deployment.yaml index 5fbb8eb..57d3b10 100644 --- a/argocd/manifests/grafana/deployment.yaml +++ b/argocd/manifests/grafana/deployment.yaml @@ -123,8 +123,9 @@ spec: sed -i 's/"uid": *"\${DS_PROMETHEUS}"/"uid": "prometheus"/g' "$DEST"/*.json # Stamp stable top-level UIDs so stars/bookmarks survive pod restarts. # Match root-level uid (2-space indent) to avoid clobbering datasource refs. + # UIDs must be ≤40 chars (Grafana 12+ enforcement). for f in "$DEST"/*.json; do - slug=$(basename "$f" .json | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//') + slug=$(basename "$f" .json | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | sed 's/^unifi-poller-//') uid="unpoller-${slug}" sed -i "s/^ \"uid\": *\"[^\"]*\"/ \"uid\": \"${uid}\"/" "$f" done diff --git a/docs/changelog.d/+fix-unpoller-dashboard-uids.bugfix.md b/docs/changelog.d/+fix-unpoller-dashboard-uids.bugfix.md new file mode 100644 index 0000000..f29e05f --- /dev/null +++ b/docs/changelog.d/+fix-unpoller-dashboard-uids.bugfix.md @@ -0,0 +1 @@ +Fix UnPoller (UniFi) Grafana dashboards failing to load due to UID exceeding Grafana 12's 40-character limit.