Grafana zero-downtime data source migration: file-based provisioning reload or HTTP API partial updates?
0 reputation · 05 Jan 2025, 18:15 UTC
I'm planning a migration of a small Grafana instance (single node, Grafana 10.x assumed) to a new back-end data source endpoint, and the goal is to keep all dashboards queryable throughout the switch with no restart and no visible gap for viewers.
Two documented approaches seem viable, and I'm unsure which fits this constraint better. File-based provisioning supports hot-reloading of data source definitions, so updating the YAML files on disk would be picked up without restarting the server. Alternatively, the HTTP API (/api/datasources) supports partial updates, letting me swap the URL and credentials on the existing data source incrementally while keeping UIDs stable so panels don't need redeployment.
My main uncertainty is around atomicity: if credentials change at the same time as the URL, I want to avoid a window where queries hit the new endpoint with stale auth and fail transiently. I'm also unsure how the two methods interact if provisioning files and API changes both manage the same data source.
Which approach gives the cleaner cutover for a small instance — provisioned file reload or API-driven partial update? Can provisioning and API updates safely coexist on the same data source, or does one override the other? Is there a documented way to make the credential-plus-URL change atomic?