Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL Prometheus Exporter fails: "column 'checkpoints_timed' does not exist" #31349

Open
Doenerpapst opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
postgresql-ha tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@Doenerpapst
Copy link

Doenerpapst commented Jan 14, 2025

Name and Version

bitnami/postgresql-ha 15.1.5

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Deploy PostgreSQL HA

Are you using any custom parameters or values?

metrics:
  enabled: true
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 250m
      memory: 384Mi
  serviceMonitor:
    enabled: true
    labels:
      release: kube-prometheus-stack

What is the expected behavior?

The PostgreSQL Prometheus Exporter should correctly collect metrics from PostgreSQL database in version >=17 without errors. Queries executed by the exporter should only reference columns and views that exist in the connected database's version.

What do you see instead?

The exporter logs errors indicating that it is trying to query a non-existent column (checkpoints_timed) from the pg_stat_bgwriter view. This results in the failure of the stat_bgwriter collector and prevents the exporter from providing the corresponding metrics.

These errors did not occur when using PostgreSQL versions earlier than 17, suggesting that the issue is specific to PostgreSQL version 17 or a potential mismatch between the exporter and this version.

Log from postgre container:

ERROR:  column "checkpoints_timed" does not exist at character 10
STATEMENT:  SELECT
			checkpoints_timed
			,checkpoints_req
			,checkpoint_write_time
			,checkpoint_sync_time
			,buffers_checkpoint
			,buffers_clean
			,maxwritten_clean
			,buffers_backend
			,buffers_backend_fsync
			,buffers_alloc
			,stats_reset
		FROM pg_stat_bgwriter;

Log from metrics container:

level=ERROR source=collector.go:201 msg="collector failed" name=stat_bgwriter duration_seconds=0.013811522 err="pq: column \"checkpoints_timed\" does not exist"

Additional information

This issue appears to have already been addressed in the Prometheus Community's postgres_exporter repository. Specifically, Pull Request #1072 implements changes to accommodate PostgreSQL version 17. The PR modifies the exporter to avoid referencing columns that no longer exist, such as checkpoints_timed, thereby resolving compatibility issues with this version.

@Doenerpapst Doenerpapst added the tech-issues The user has a technical issue about an application label Jan 14, 2025
@github-actions github-actions bot added the triage Triage is needed label Jan 14, 2025
@carrodher
Copy link
Member

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql-ha tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants