pg exporter will occur error when backup

Open
#1,091 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, postgresql

Research direction

Start by tracing the pg_pg_replication_lag_seconds metric and its PostgreSQL query, including pg_last_xact_replay_timestamp(), during backup. Reproduce the scrape error while a backup is running and compare the behavior of the query in recovery and non-recovery states. Done means backups no longer set pg_exporter_last_scrape_error and the replication-lag metric remains appropriately handled.

Written by the indexing model from the issue text.

Description

postgres exporter catch metric pg_pg_replication_lag_seconds,the sql
SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag

occurs an error every time when backup,
pg_exporter_last_scrape_error = 1

pg_last_xact_replay_timestamp cannot use when backup,so every day we receive an alert

Dominant language
Go
Stars
3.6k
Forks
835
Avg merge
2d 4h
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prometheus-community/postgres_exporter

All issues in prometheus-community/postgres_exporter

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.