From cc56ba29394a6724753c7165939870d9d7ebfff8 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sat, 18 Apr 2026 23:23:07 +0000 Subject: [PATCH] [payslip-ingest] Move Payslips datasource 'database' into jsonData MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Grafana 11.2+ Postgres plugin reads the DB name from jsonData.database (see grafana/grafana#112418). The top-level 'database' field is silently ignored by the frontend — datasource health checks and POST /api/ds/query still work because the backend honors it, but every dashboard panel fails with 'you do not have default database'. Rolling back to the supported shape fixes rendering for all 4 uk-payslip panels. --- stacks/payslip-ingest/main.tf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/stacks/payslip-ingest/main.tf b/stacks/payslip-ingest/main.tf index 0f13e036..7e4d0006 100644 --- a/stacks/payslip-ingest/main.tf +++ b/stacks/payslip-ingest/main.tf @@ -312,14 +312,18 @@ resource "kubernetes_config_map" "grafana_payslips_datasource" { "payslips-datasource.yaml" = yamlencode({ apiVersion = 1 datasources = [{ - name = "Payslips" - type = "postgres" - access = "proxy" - url = "${var.postgresql_host}:5432" - database = "payslip_ingest" - user = "payslip_ingest" - uid = "payslips-pg" + name = "Payslips" + type = "postgres" + access = "proxy" + url = "${var.postgresql_host}:5432" + user = "payslip_ingest" + uid = "payslips-pg" + # Grafana 11.2+ Postgres plugin reads the DB name from jsonData.database; + # the top-level `database` field is silently ignored by the frontend and + # triggers "you do not have default database" on every panel. + # See github.com/grafana/grafana#112418. jsonData = { + database = "payslip_ingest" sslmode = "disable" postgresVersion = 1600 timescaledb = false