Skip to content

Persist Grafana data in Docker Compose - #40

Merged
devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795454440-grafana-persist
Nov 23, 2026
Merged

devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795454440-grafana-persist

Conversation

@moe-berri

@moe-berri moe-berri commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Compose never mounted Grafana's /var/lib/grafana on a volume, so an upgrade or docker compose up --force-recreate deleted user-made dashboards.

  • compose/docker-compose.yaml: named volume grafana-data mounted at /var/lib/grafana. No image pins changed.
  • install.sh: on upgrade, if a legacy Grafana container (no volume) exists, copy its /var/lib/grafana into the new volume before Compose replaces it. If the copy fails, the old container stays untouched. A retry takes a fresh copy, so edits made after a failed upgrade are kept. A partial copy (for example, disk full) is cleared and redone. Mount detection reads /proc/self/mountinfo, so it also works on Docker VFS.
  • docs/setup.md: run the installer before removing or recreating a legacy Grafana container.
  • tests/test_install.py: covers the volume, migration order, stopped containers, repeat installs, copy failure, retry refresh, partial-copy recovery and same-filesystem mounts.

QA: installed the v0.3.1 Compose recipe, created a dashboard through the Grafana API, upgraded through install.sh with a locally packaged bundle, then force-recreated Grafana. The dashboard survived both steps on Grafana 11.4.0 and on 13.3.1 (PR #36), and Grafana (uid 472) could write to the volume. Without the fix, recreating Grafana on v0.3.1 returned 404 for the dashboard. The Python suite (95 tests), browser tests, Helm and CloudFormation lint, and the launcher build all pass.

Details

Link to Devin session: https://app.devin.ai/sessions/ccff2c3bd48e453abc54bf8746d71a6f
Open in Devin Desktop: https://app.devin.ai/desktop/session/ccff2c3bd48e453abc54bf8746d71a6f?variant=devin
Requested by: @moe-berri


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

moe-berri and others added 3 commits November 23, 2026 17:35
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration
devin-ai-integration Bot merged commit 9beed63 into main Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant