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
#15925)

* Revise postgresql.replication_delay to Function with Archive WAL-driv… (#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]>

* update changelog

* update changelog

* update changelog

* remove duplicate changelog entry

* update changelog

---------

Co-authored-by: boluwaji-deriv <[email protected]>
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]>
  • Loading branch information
7 people authored Sep 28, 2023
1 parent b820284 commit cc109e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion postgres/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

***Fixed***:

* Revise `postgresql.replication_delay` to function with archive WAL-driven replica ([#15925](https://github.com/DataDog/integrations-core/pull/15925))
* Prevent Postgres integration from collecting WAL metrics from Aurora instances that cannot be collected ([#15896](https://github.com/DataDog/integrations-core/pull/15896))
* Set lower log level for relations metrics truncated ([#15903](https://github.com/DataDog/integrations-core/pull/15903))

Expand Down Expand Up @@ -47,7 +48,6 @@

***Fixed***:

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

## 14.2.1 / 2023-08-29
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 cc109e7

Please sign in to comment.