forked from pgexporter/pgexporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pgexporter#78] PostgreSQL V12 metrics examples
- Loading branch information
Showing
1 changed file
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# This is the default minimum version for queries, unless specified otherwise | ||
version: 12 | ||
metrics: | ||
|
||
# GSS Authenticated DB Connections | ||
- queries: | ||
- query: SELECT COUNT(*) | ||
FROM pg_stat_gssapi | ||
JOIN pg_stat_activity | ||
ON pg_stat_gssapi.pid = pg_stat_activity.pid | ||
WHERE gss_authenticated = 't' AND datname IS NOT NULL; | ||
columns: | ||
- type: gauge | ||
description: Number of GSSAPI authenticated DB connections. | ||
tag: pg_gss_auth | ||
collector: gssapi | ||
|
||
# Encrypted DB Connections | ||
- queries: | ||
- query: SELECT COUNT(*) | ||
FROM pg_stat_gssapi | ||
JOIN pg_stat_activity | ||
ON pg_stat_gssapi.pid = pg_stat_activity.pid | ||
WHERE encrypted = 't' AND datname IS NOT NULL; | ||
columns: | ||
- type: gauge | ||
description: Number of encrypted DB connections. | ||
tag: pg_encrypted_conn | ||
collector: encryted_conns | ||
|
||
# DB Stats | ||
- queries: | ||
- query: SELECT | ||
datname, | ||
blk_read_time, | ||
blk_write_time, | ||
blks_hit, | ||
blks_read, | ||
deadlocks, | ||
temp_files, | ||
temp_bytes, | ||
tup_returned, | ||
tup_fetched, | ||
tup_inserted, | ||
tup_updated, | ||
tup_deleted, | ||
xact_commit, | ||
xact_rollback, | ||
conflicts, | ||
numbackends | ||
FROM pg_stat_database | ||
WHERE datname IS NOT NULL | ||
ORDER BY datname; | ||
columns: | ||
- name: database | ||
type: label | ||
- name: blk_read_time | ||
type: counter | ||
description: pg_stat_database_blk_read_time | ||
- name: blk_write_time | ||
type: counter | ||
description: pg_stat_database_blk_write_time | ||
- name: blks_hit | ||
type: counter | ||
description: pg_stat_database_blks_hit | ||
- name: blks_read | ||
type: counter | ||
description: pg_stat_database_blks_read | ||
- name: deadlocks | ||
type: counter | ||
description: pg_stat_database_deadlocks | ||
- name: temp_files | ||
type: gauge | ||
description: pg_stat_database_temp_files | ||
- name: temp_bytes | ||
type: gauge | ||
description: pg_stat_database_temp_bytes | ||
- name: tup_returned | ||
type: counter | ||
description: pg_stat_database_tup_returned | ||
- name: tup_fetched | ||
type: counter | ||
description: pg_stat_database_tup_fetched | ||
- name: tup_inserted | ||
type: counter | ||
description: pg_stat_database_tup_inserted | ||
- name: tup_updated | ||
type: counter | ||
description: pg_stat_database_tup_updated | ||
- name: tup_deleted | ||
type: counter | ||
description: pg_stat_database_tup_deleted | ||
- name: xact_commit | ||
type: counter | ||
description: pg_stat_database_xact_commit | ||
- name: xact_rollback | ||
type: counter | ||
description: pg_stat_database_xact_rollback | ||
- name: conflicts | ||
type: counter | ||
description: pg_stat_database_conflicts | ||
- name: numbackends | ||
type: gauge | ||
description: pg_stat_database_numbackends | ||
version: 10 | ||
|
||
- query: SELECT | ||
datname, | ||
blk_read_time, | ||
blk_write_time, | ||
blks_hit, | ||
blks_read, | ||
checksum_failures, | ||
deadlocks, | ||
temp_files, | ||
temp_bytes, | ||
tup_returned, | ||
tup_fetched, | ||
tup_inserted, | ||
tup_updated, | ||
tup_deleted, | ||
xact_commit, | ||
xact_rollback, | ||
conflicts, | ||
numbackends, | ||
checksum_failures | ||
FROM pg_stat_database WHERE datname IS NOT NULL ORDER BY datname; | ||
columns: | ||
- name: database | ||
type: label | ||
- name: blk_read_time | ||
type: counter | ||
description: pg_stat_database_blk_read_time | ||
- name: blk_write_time | ||
type: counter | ||
description: pg_stat_database_blk_write_time | ||
- name: blks_hit | ||
type: counter | ||
description: pg_stat_database_blks_hit | ||
- name: blks_read | ||
type: counter | ||
description: pg_stat_database_blks_read | ||
- name: deadlocks | ||
type: counter | ||
description: pg_stat_database_deadlocks | ||
- name: temp_files | ||
type: gauge | ||
description: pg_stat_database_temp_files | ||
- name: temp_bytes | ||
type: gauge | ||
description: pg_stat_database_temp_bytes | ||
- name: tup_returned | ||
type: counter | ||
description: pg_stat_database_tup_returned | ||
- name: tup_fetched | ||
type: counter | ||
description: pg_stat_database_tup_fetched | ||
- name: tup_inserted | ||
type: counter | ||
description: pg_stat_database_tup_inserted | ||
- name: tup_updated | ||
type: counter | ||
description: pg_stat_database_tup_updated | ||
- name: tup_deleted | ||
type: counter | ||
description: pg_stat_database_tup_deleted | ||
- name: xact_commit | ||
type: counter | ||
description: pg_stat_database_xact_commit | ||
- name: xact_rollback | ||
type: counter | ||
description: pg_stat_database_xact_rollback | ||
- name: conflicts | ||
type: counter | ||
description: pg_stat_database_conflicts | ||
- name: numbackends | ||
type: gauge | ||
description: pg_stat_database_numbackends | ||
tag: pg_stat_database | ||
collector: stat_db | ||
sort: data |