Skip to content

Commit

Permalink
Revise postgresql.replication_delay to Function with Archive WAL-driv… (
Browse files Browse the repository at this point in the history
#15629)

* Revise postgresql.replication_delay to Function with Archive WAL-driven PostgreSQL Replica

* modify query and also add changelog message

* update master with branch

* update master with branch

* Add short hand for force env rebuild in test (#15716)

* add short hand for force-env-rebuild

* add changelog entry

* styling

* [Release] Update metadata (#15717)

* [Release] Bumped postgres version to 14.2.1 (#15713)

* Bump oracledb version (#15595)

* Bump oracledb version

* update reqs

* update changelog

* Mark one metric as optional (#15719)

* Update the test environments (#15644)

* Update the test environments

* Apply suggestions from code review

Co-authored-by: Ofek Lev <[email protected]>

* update metadata.csv

---------

Co-authored-by: Ofek Lev <[email protected]>

* [DBM-2685] Fix explaining parameterized queries flood server logs (#15612)

* check if query is parameterized before blindly explain then fail

* update CHANGELOG

* skip explain parameterized query test for pg version < 12

* fix rate limited activity collection test case (#15715)

* [DBM-2734] fix test_snapshot_xmin for pg > 13 (#15718)

* fix test_snapshot_xmin for pg > 13

* reorder the steps to first collect metrics

* remove check.cancel()

---------

Co-authored-by: Steven Yuen <[email protected]>
Co-authored-by: Andrew Zhang <[email protected]>
Co-authored-by: vivek-datadog <[email protected]>
Co-authored-by: Florent Clarret <[email protected]>
Co-authored-by: Ofek Lev <[email protected]>
Co-authored-by: Zhengda Lu <[email protected]>
  • Loading branch information
7 people committed Sep 27, 2023
1 parent 1e667e0 commit c730d93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions postgres/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

***Fixed***:

* Revise postgresql.replication_delay to Function with Archive WAL-driven PostgreSQL Replica ([#15629](https://github.com/DataDog/integrations-core/pull/15629))

Check failure on line 57 in postgres/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / run / Check PR

The first line of every new changelog entry must end with a link to the associated PR: ` ([#15925](https://github.com/DataDog/integrations-core/pull/15925))`

Check failure on line 57 in postgres/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / run / Check PR

The first line of every new changelog entry must end with a link to the associated PR: ` ([#15925](https://github.com/DataDog/integrations-core/pull/15925))`
* Return Azure AD auth token in correct format ([#15701](https://github.com/DataDog/integrations-core/pull/15701))

## 14.2.0 / 2023-08-18
Expand Down
7 changes: 4 additions & 3 deletions postgres/datadog_checks/postgres/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ def payload_pg_version(version):
}

q1 = (
'CASE WHEN pg_last_wal_receive_lsn() IS NULL OR '
'pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0 ELSE GREATEST '
'(0, EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())) END'
'CASE WHEN exists(SELECT * FROM pg_stat_wal_receiver) '
'AND (pg_last_wal_receive_lsn() IS NULL '
'OR pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn()) THEN 0 '
'ELSE GREATEST(0, EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())) END'
)
q2 = 'abs(pg_wal_lsn_diff(pg_last_wal_receive_lsn(), pg_last_wal_replay_lsn()))'
REPLICATION_METRICS_10 = {
Expand Down

0 comments on commit c730d93

Please sign in to comment.