Skip to content

Commit 04645da

Browse files
PMM-12897 Move DB specific metrics queries to low resolution (percona#199)
1 parent 1b1eb48 commit 04645da

File tree

2 files changed

+99
-100
lines changed

2 files changed

+99
-100
lines changed

queries.yaml renamed to queries-lr.yaml

-100
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
#### Queries are commented due to PMM-8859
2-
pg_replication:
3-
query: "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"
4-
master: true
5-
metrics:
6-
- lag:
7-
usage: "GAUGE"
8-
description: "Replication lag behind master in seconds"
9-
10-
pg_postmaster:
11-
query: "SELECT pg_postmaster_start_time as start_time_seconds from pg_postmaster_start_time()"
12-
master: true
13-
metrics:
14-
- start_time_seconds:
15-
usage: "GAUGE"
16-
description: "Time at which postmaster started"
17-
181
pg_stat_user_tables:
192
query: |
203
SELECT
@@ -146,86 +129,3 @@ pg_statio_user_tables:
146129
- tidx_blks_hit:
147130
usage: "COUNTER"
148131
description: "Number of buffer hits in this table's TOAST table indexes (if any)"
149-
150-
pg_database:
151-
query: "SELECT pg_database.datname, pg_database_size(pg_database.datname) as size_bytes FROM pg_database"
152-
master: true
153-
cache_seconds: 30
154-
metrics:
155-
- datname:
156-
usage: "LABEL"
157-
description: "Name of the database"
158-
- size_bytes:
159-
usage: "GAUGE"
160-
description: "Disk space used by the database"
161-
####
162-
#pg_stat_statements:
163-
# query: "SELECT t2.rolname, t3.datname, queryid, calls, total_time / 1000 as total_time_seconds, min_time / 1000 as min_time_seconds, max_time / 1000 as max_time_seconds, mean_time / 1000 as mean_time_seconds, stddev_time / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin'"
164-
# master: true
165-
# metrics:
166-
# - rolname:
167-
# usage: "LABEL"
168-
# description: "Name of user"
169-
# - datname:
170-
# usage: "LABEL"
171-
# description: "Name of database"
172-
# - queryid:
173-
# usage: "LABEL"
174-
# description: "Query ID"
175-
# - calls:
176-
# usage: "COUNTER"
177-
# description: "Number of times executed"
178-
# - total_time_seconds:
179-
# usage: "COUNTER"
180-
# description: "Total time spent in the statement, in milliseconds"
181-
# - min_time_seconds:
182-
# usage: "GAUGE"
183-
# description: "Minimum time spent in the statement, in milliseconds"
184-
# - max_time_seconds:
185-
# usage: "GAUGE"
186-
# description: "Maximum time spent in the statement, in milliseconds"
187-
# - mean_time_seconds:
188-
# usage: "GAUGE"
189-
# description: "Mean time spent in the statement, in milliseconds"
190-
# - stddev_time_seconds:
191-
# usage: "GAUGE"
192-
# description: "Population standard deviation of time spent in the statement, in milliseconds"
193-
# - rows:
194-
# usage: "COUNTER"
195-
# description: "Total number of rows retrieved or affected by the statement"
196-
# - shared_blks_hit:
197-
# usage: "COUNTER"
198-
# description: "Total number of shared block cache hits by the statement"
199-
# - shared_blks_read:
200-
# usage: "COUNTER"
201-
# description: "Total number of shared blocks read by the statement"
202-
# - shared_blks_dirtied:
203-
# usage: "COUNTER"
204-
# description: "Total number of shared blocks dirtied by the statement"
205-
# - shared_blks_written:
206-
# usage: "COUNTER"
207-
# description: "Total number of shared blocks written by the statement"
208-
# - local_blks_hit:
209-
# usage: "COUNTER"
210-
# description: "Total number of local block cache hits by the statement"
211-
# - local_blks_read:
212-
# usage: "COUNTER"
213-
# description: "Total number of local blocks read by the statement"
214-
# - local_blks_dirtied:
215-
# usage: "COUNTER"
216-
# description: "Total number of local blocks dirtied by the statement"
217-
# - local_blks_written:
218-
# usage: "COUNTER"
219-
# description: "Total number of local blocks written by the statement"
220-
# - temp_blks_read:
221-
# usage: "COUNTER"
222-
# description: "Total number of temp blocks read by the statement"
223-
# - temp_blks_written:
224-
# usage: "COUNTER"
225-
# description: "Total number of temp blocks written by the statement"
226-
# - blk_read_time_seconds:
227-
# usage: "COUNTER"
228-
# description: "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"
229-
# - blk_write_time_seconds:
230-
# usage: "COUNTER"
231-
# description: "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"

queries-mr.yaml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#### Queries are commented due to PMM-8859
2+
pg_replication:
3+
query: "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"
4+
master: true
5+
metrics:
6+
- lag:
7+
usage: "GAUGE"
8+
description: "Replication lag behind master in seconds"
9+
10+
pg_postmaster:
11+
query: "SELECT pg_postmaster_start_time as start_time_seconds from pg_postmaster_start_time()"
12+
master: true
13+
metrics:
14+
- start_time_seconds:
15+
usage: "GAUGE"
16+
description: "Time at which postmaster started"
17+
18+
pg_database:
19+
query: "SELECT pg_database.datname, pg_database_size(pg_database.datname) as size_bytes FROM pg_database"
20+
master: true
21+
cache_seconds: 30
22+
metrics:
23+
- datname:
24+
usage: "LABEL"
25+
description: "Name of the database"
26+
- size_bytes:
27+
usage: "GAUGE"
28+
description: "Disk space used by the database"
29+
####
30+
#pg_stat_statements:
31+
# query: "SELECT t2.rolname, t3.datname, queryid, calls, total_time / 1000 as total_time_seconds, min_time / 1000 as min_time_seconds, max_time / 1000 as max_time_seconds, mean_time / 1000 as mean_time_seconds, stddev_time / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin'"
32+
# master: true
33+
# metrics:
34+
# - rolname:
35+
# usage: "LABEL"
36+
# description: "Name of user"
37+
# - datname:
38+
# usage: "LABEL"
39+
# description: "Name of database"
40+
# - queryid:
41+
# usage: "LABEL"
42+
# description: "Query ID"
43+
# - calls:
44+
# usage: "COUNTER"
45+
# description: "Number of times executed"
46+
# - total_time_seconds:
47+
# usage: "COUNTER"
48+
# description: "Total time spent in the statement, in milliseconds"
49+
# - min_time_seconds:
50+
# usage: "GAUGE"
51+
# description: "Minimum time spent in the statement, in milliseconds"
52+
# - max_time_seconds:
53+
# usage: "GAUGE"
54+
# description: "Maximum time spent in the statement, in milliseconds"
55+
# - mean_time_seconds:
56+
# usage: "GAUGE"
57+
# description: "Mean time spent in the statement, in milliseconds"
58+
# - stddev_time_seconds:
59+
# usage: "GAUGE"
60+
# description: "Population standard deviation of time spent in the statement, in milliseconds"
61+
# - rows:
62+
# usage: "COUNTER"
63+
# description: "Total number of rows retrieved or affected by the statement"
64+
# - shared_blks_hit:
65+
# usage: "COUNTER"
66+
# description: "Total number of shared block cache hits by the statement"
67+
# - shared_blks_read:
68+
# usage: "COUNTER"
69+
# description: "Total number of shared blocks read by the statement"
70+
# - shared_blks_dirtied:
71+
# usage: "COUNTER"
72+
# description: "Total number of shared blocks dirtied by the statement"
73+
# - shared_blks_written:
74+
# usage: "COUNTER"
75+
# description: "Total number of shared blocks written by the statement"
76+
# - local_blks_hit:
77+
# usage: "COUNTER"
78+
# description: "Total number of local block cache hits by the statement"
79+
# - local_blks_read:
80+
# usage: "COUNTER"
81+
# description: "Total number of local blocks read by the statement"
82+
# - local_blks_dirtied:
83+
# usage: "COUNTER"
84+
# description: "Total number of local blocks dirtied by the statement"
85+
# - local_blks_written:
86+
# usage: "COUNTER"
87+
# description: "Total number of local blocks written by the statement"
88+
# - temp_blks_read:
89+
# usage: "COUNTER"
90+
# description: "Total number of temp blocks read by the statement"
91+
# - temp_blks_written:
92+
# usage: "COUNTER"
93+
# description: "Total number of temp blocks written by the statement"
94+
# - blk_read_time_seconds:
95+
# usage: "COUNTER"
96+
# description: "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"
97+
# - blk_write_time_seconds:
98+
# usage: "COUNTER"
99+
# description: "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"

0 commit comments

Comments
 (0)