Fix UnPoller dashboard UIDs exceeding Grafana 12's 40-char limit
Strip redundant "unifi-poller-" prefix from generated slugs, bringing UIDs from 45-48 chars down to 32-35 chars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3c894e659d
commit
936d29bbe1
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
1
docs/changelog.d/+fix-unpoller-dashboard-uids.bugfix.md
Normal file
1
docs/changelog.d/+fix-unpoller-dashboard-uids.bugfix.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fix UnPoller (UniFi) Grafana dashboards failing to load due to UID exceeding Grafana 12's 40-character limit.
|
||||
Loading…
Add table
Add a link
Reference in a new issue