Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb407cf4

Browse files
Fixed db_stats query for pg17
1 parent972811a commitb407cf4

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

‎config/pgwatch-prometheus/metrics.yml‎

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -311,57 +311,8 @@ metrics:
311311
pg_stat_database, pg_control_system()
312312
where
313313
datname = current_database()
314-
17:|-
315-
select /* pgwatch_generated */
316-
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
317-
current_database() as tag_datname,
318-
numbackends,
319-
xact_commit,
320-
xact_rollback,
321-
blks_read,
322-
blks_hit,
323-
tup_returned,
324-
tup_fetched,
325-
tup_inserted,
326-
tup_updated,
327-
tup_deleted,
328-
conflicts,
329-
temp_files,
330-
temp_bytes,
331-
deadlocks,
332-
shared_blk_read_time as blk_read_time,
333-
shared_blk_write_time as blk_write_time,
334-
extract(epoch from (now() - pg_postmaster_start_time()))::int8 as postmaster_uptime_s,
335-
checksum_failures,
336-
extract(epoch from (now() - checksum_last_failure))::int8 as checksum_last_failure_s,
337-
case when pg_is_in_recovery() then 1 else 0 end as in_recovery_int,
338-
system_identifier::text as tag_sys_id,
339-
session_time::int8,
340-
active_time::int8,
341-
idle_in_transaction_time::int8,
342-
sessions,
343-
sessions_abandoned,
344-
sessions_fatal,
345-
sessions_killed,
346-
(select count(*) from pg_index i
347-
where not indisvalid
348-
and not exists ( /* leave out ones that are being actively rebuilt */
349-
select * from pg_locks l
350-
join pg_stat_activity a using (pid)
351-
where l.relation = i.indexrelid
352-
and a.state = 'active'
353-
and a.query ~* 'concurrently'
354-
)) as invalid_indexes
355-
from
356-
pg_stat_database, pg_control_system()
357-
where
358-
datname = current_database()
359314
gauges:
360-
-numbackends
361-
-postmaster_uptime_s
362-
-backup_duration_s
363-
-backup_duration_s
364-
-checksum_last_failure_s
315+
-'*'
365316
locks_mode:
366317
description:>
367318
Retrieves lock mode statistics from the PostgreSQL `pg_locks` view, providing insights into the different lock modes currently held in the database.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp