Skip to content

feat: add transaction ID age to postgres_exporter - #2375

Open
valigula wants to merge 2 commits into
developfrom
andres/INDATA-1261-add-max-transaction-id-age-metric
Open

feat: add transaction ID age to postgres_exporter#2375
valigula wants to merge 2 commits into
developfrom
andres/INDATA-1261-add-max-transaction-id-age-metric

Conversation

@valigula

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

feature INDATA-1261

What is the current behavior?

What is the new behavior?

Add pg_wraparound custom metric to postgres_exporter that tracks the maximum transaction ID age across all databases. This enables proactive monitoring of wraparound risk before it reaches critical thresholds.

  • New queries.yml with max(age(datfrozenxid)) query
  • Deployed to /opt/postgres_exporter/ via Ansible

Additional context

Add pg_wraparound custom metric to postgres_exporter that tracks the
maximum transaction ID age across all databases. This enables proactive
monitoring of wraparound risk before it reaches critical thresholds.

- New queries.yml with max(age(datfrozenxid)) query
- Deployed to /opt/postgres_exporter/ via Ansible

Related: INDATA-1261
@valigula
valigula requested review from a team as code owners August 18, 2026 12:41
@valigula
valigula requested a lite review from Copilot August 18, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a custom postgres_exporter metric to monitor wraparound risk by exporting the maximum age(datfrozenxid) across all databases, deployed via Ansible.

Changes:

  • Deploy a new queries.yml containing the pg_wraparound custom query/metric definition.
  • Copy queries.yml into /opt/postgres_exporter/ during exporter provisioning.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ansible/tasks/internal/postgres-exporter.yml Copies the new custom queries.yml into the exporter install directory during provisioning.
ansible/files/queries.yml Defines the pg_wraparound extended query exporting max transaction ID age across databases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +44 to +48
src: files/queries.yml
dest: /opt/postgres_exporter/queries.yml
owner: root
group: root
mode: '0644'
Comment thread ansible/files/queries.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants