From 7e7b0ac8a9ebb1d33f0b231af1ff64f30ef41f09 Mon Sep 17 00:00:00 2001 From: Dmitry Kondratyev Date: Mon, 7 Sep 2026 14:02:13 -0400 Subject: [PATCH] fix public Grafana crash: delete pyroscope datasource before re-pin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #190 pinned uid: pyroscope on the shared pyroscope datasource, but Grafana (12.3.1) cannot change an existing datasource's uid via provisioning: UpdateDataSource looks the row up by id AND the new uid, gets "data source not found", and the failed provisioning module crash-loops the instance. The public instance's database still had the old auto-generated uid, so its pod went down after the merge; grafana-private survived because its fresh database inserted the datasource with the pinned uid. Add deleteDatasources for pyroscope in the same provisioning file: Grafana deletes any pre-existing row (skipping the delete event when the datasource is re-created in the same pass, and skipping rows that do not exist) and re-creates it with the pinned uid, converging every instance — including a future rebuilt one — to uid pyroscope. Co-Authored-By: Claude Fable 5 --- apps/monitoring/grafana/datasources.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/monitoring/grafana/datasources.yaml b/apps/monitoring/grafana/datasources.yaml index ffac1b51..8c3f0846 100644 --- a/apps/monitoring/grafana/datasources.yaml +++ b/apps/monitoring/grafana/datasources.yaml @@ -7,6 +7,17 @@ datasources: datasources.yaml: apiVersion: 1 + # Grafana cannot CHANGE an existing datasource's uid via provisioning: + # the update looks the row up by id AND the uid from this file, gets + # "data source not found", and the failed provisioning module crash- + # loops the whole instance (took the public instance down 2026-09-07 + # when uid: pyroscope was pinned over the old auto-generated uid). + # Deleting the row first makes provisioning re-create it with the + # pinned uid — Grafana skips the delete event when the datasource is + # re-created in the same pass, and skips rows that don't exist. + deleteDatasources: + - name: pyroscope + orgId: 1 datasources: - name: prometheus uid: prometheus