File tree Expand file tree Collapse file tree 3 files changed +40
-27
lines changed Expand file tree Collapse file tree 3 files changed +40
-27
lines changed Original file line number Diff line number Diff line change @@ -49,39 +49,39 @@ var (
49
49
)
50
50
51
51
pgLocksQuery = `
52
- SELECT
52
+ SELECT
53
53
pg_database.datname as datname,
54
54
tmp.mode as mode,
55
- COALESCE(count, 0) as count
56
- FROM
55
+ COALESCE(count, 0) as count
56
+ FROM
57
57
(
58
- VALUES
59
- ('accesssharelock'),
60
- ('rowsharelock'),
61
- ('rowexclusivelock'),
62
- ('shareupdateexclusivelock'),
63
- ('sharelock'),
64
- ('sharerowexclusivelock'),
65
- ('exclusivelock'),
66
- ('accessexclusivelock'),
58
+ VALUES
59
+ ('accesssharelock'),
60
+ ('rowsharelock'),
61
+ ('rowexclusivelock'),
62
+ ('shareupdateexclusivelock'),
63
+ ('sharelock'),
64
+ ('sharerowexclusivelock'),
65
+ ('exclusivelock'),
66
+ ('accessexclusivelock'),
67
67
('sireadlock')
68
68
) AS tmp(mode)
69
- CROSS JOIN pg_database
69
+ CROSS JOIN pg_database
70
70
LEFT JOIN (
71
- SELECT
72
- database,
73
- lower(mode) AS mode,
74
- count(*) AS count
75
- FROM
76
- pg_locks
77
- WHERE
78
- database IS NOT NULL
79
- GROUP BY
80
- database,
71
+ SELECT
72
+ database,
73
+ lower(mode) AS mode,
74
+ count(*) AS count
75
+ FROM
76
+ pg_locks
77
+ WHERE
78
+ database IS NOT NULL
79
+ GROUP BY
80
+ database,
81
81
lower(mode)
82
- ) AS tmp2 ON tmp.mode = tmp2.mode
83
- and pg_database.oid = tmp2.database
84
- ORDER BY
82
+ ) AS tmp2 ON tmp.mode = tmp2.mode
83
+ and pg_database.oid = tmp2.database
84
+ ORDER BY
85
85
1
86
86
`
87
87
)
Original file line number Diff line number Diff line change
1
+ // Copyright 2025 The Prometheus Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
1
14
package collector
2
15
3
16
import (
Original file line number Diff line number Diff line change 1
- // Copyright 2023 The Prometheus Authors
1
+ // Copyright 2025 The Prometheus Authors
2
2
// Licensed under the Apache License, Version 2.0 (the "License");
3
3
// you may not use this file except in compliance with the License.
4
4
// You may obtain a copy of the License at
You can’t perform that action at this time.
0 commit comments