Skip to content

postgresVersion is hardcoded in the Grafana PostgreSQL datasource provisioning #16

@serdardalgic

Description

@serdardalgic

Grafana's datasource provisioning for PostgreSQL accepts a postgresVersion field inside jsonData. This is a Grafana-internal integer that encodes the PostgreSQL server version — for example 903 for v9.3, 906 for v9.6, 1000 for v10, 1500 for v15, 1800 for v18.

In helm/pgwatch/templates/grafana-deployment.yaml, the grafana-datasources ConfigMap handles two backend scenarios:

  • create_metric_database: "true" (built-in PostgreSQL StatefulSet):
    postgresVersion is hardcoded to 1800 (in the kubernetes-ready-pgwatch branch)

  • use_existing_database (user-provided external PostgreSQL instance):
    postgresVersion is not set at all. Grafana falls back to its internal default, which may not reflect the actual server version.

The same ConfigMap is used when the Grafana subchart (pgwatch.grafana.useSubchart: true) is active — the grafana_datasource: "1" label causes the k8s-sidecar to pick it up, so both Grafana deployment modes are affected.

The TimescaleDB subchart path (timescaledb.enabled: true) is equally affected: no postgresVersion is set for that case either.

There should be a better way to handle this parameter, instead of hardcoding it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions