gitlab-exporter 12.1.1 → 13.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +2 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +17 -17
- data/gitlab-exporter.gemspec +3 -3
- data/lib/gitlab_exporter/cli.rb +15 -1
- data/lib/gitlab_exporter/database/row_count.rb +0 -134
- data/lib/gitlab_exporter/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 772759981296901f1bd6ed3d38a9f98cf882ddbc851605c8dfb31b47aceed046
|
|
4
|
+
data.tar.gz: 82f8e5ce3795f3349dd1cd053161302cf01eafe0c57485ec3074e7a8844606a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed3d74142e8da3b4bf367c9bf26b91b1e55a42f904e494479797d1bc10f07324e0734247a271a44e1a6db6ca745dddaddf97688d0ba659ff3e27f3f927fa6973
|
|
7
|
+
data.tar.gz: f0af44afc5e5c3d425bdfe09e1d846b550b53f9b1bc24cad7549715a8d18dc751f60dda5a8e7c934d1a0b6c2f0285ea533c64419deaab78087ef102c2161d40b
|
data/.gitlab-ci.yml
CHANGED
|
@@ -43,7 +43,7 @@ rspec:
|
|
|
43
43
|
before_script: *before_scripts
|
|
44
44
|
parallel:
|
|
45
45
|
matrix:
|
|
46
|
-
- RUBY_VERSION: ["2.7", "3.0"]
|
|
46
|
+
- RUBY_VERSION: ["2.7", "3.0", "3.1", "3.2"]
|
|
47
47
|
|
|
48
48
|
rspec_integration:
|
|
49
49
|
script:
|
|
@@ -55,7 +55,7 @@ rspec_integration:
|
|
|
55
55
|
REDIS_URL: "redis://redis"
|
|
56
56
|
parallel:
|
|
57
57
|
matrix:
|
|
58
|
-
- RUBY_VERSION: ["2.7", "3.0"]
|
|
58
|
+
- RUBY_VERSION: ["2.7", "3.0", "3.1", "3.2"]
|
|
59
59
|
|
|
60
60
|
rubocop:
|
|
61
61
|
script:
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gitlab-exporter (
|
|
4
|
+
gitlab-exporter (13.0.3)
|
|
5
5
|
connection_pool (= 2.2.5)
|
|
6
6
|
faraday (~> 1.8.0)
|
|
7
|
-
pg (= 1.
|
|
7
|
+
pg (= 1.5.3)
|
|
8
8
|
puma (= 5.6.5)
|
|
9
9
|
quantile (= 0.2.1)
|
|
10
10
|
redis (= 4.4.0)
|
|
@@ -18,7 +18,7 @@ GEM
|
|
|
18
18
|
specs:
|
|
19
19
|
ast (2.4.1)
|
|
20
20
|
connection_pool (2.2.5)
|
|
21
|
-
diff-lcs (1.
|
|
21
|
+
diff-lcs (1.5.0)
|
|
22
22
|
faraday (1.8.0)
|
|
23
23
|
faraday-em_http (~> 1.0)
|
|
24
24
|
faraday-em_synchrony (~> 1.0)
|
|
@@ -45,7 +45,7 @@ GEM
|
|
|
45
45
|
parallel (1.20.1)
|
|
46
46
|
parser (3.0.0.0)
|
|
47
47
|
ast (~> 2.4.1)
|
|
48
|
-
pg (1.
|
|
48
|
+
pg (1.5.3)
|
|
49
49
|
puma (5.6.5)
|
|
50
50
|
nio4r (~> 2.0)
|
|
51
51
|
quantile (0.2.1)
|
|
@@ -58,19 +58,19 @@ GEM
|
|
|
58
58
|
redis (>= 4)
|
|
59
59
|
regexp_parser (2.0.3)
|
|
60
60
|
rexml (3.2.4)
|
|
61
|
-
rspec (3.
|
|
62
|
-
rspec-core (~> 3.
|
|
63
|
-
rspec-expectations (~> 3.
|
|
64
|
-
rspec-mocks (~> 3.
|
|
65
|
-
rspec-core (3.
|
|
66
|
-
rspec-support (~> 3.
|
|
67
|
-
rspec-expectations (3.
|
|
61
|
+
rspec (3.12.0)
|
|
62
|
+
rspec-core (~> 3.12.0)
|
|
63
|
+
rspec-expectations (~> 3.12.0)
|
|
64
|
+
rspec-mocks (~> 3.12.0)
|
|
65
|
+
rspec-core (3.12.2)
|
|
66
|
+
rspec-support (~> 3.12.0)
|
|
67
|
+
rspec-expectations (3.12.3)
|
|
68
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
69
|
-
rspec-support (~> 3.
|
|
70
|
-
rspec-mocks (3.
|
|
69
|
+
rspec-support (~> 3.12.0)
|
|
70
|
+
rspec-mocks (3.12.5)
|
|
71
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
72
|
-
rspec-support (~> 3.
|
|
73
|
-
rspec-support (3.
|
|
72
|
+
rspec-support (~> 3.12.0)
|
|
73
|
+
rspec-support (3.12.0)
|
|
74
74
|
rubocop (0.93.1)
|
|
75
75
|
parallel (~> 1.10)
|
|
76
76
|
parser (>= 2.7.1.5)
|
|
@@ -102,8 +102,8 @@ PLATFORMS
|
|
|
102
102
|
|
|
103
103
|
DEPENDENCIES
|
|
104
104
|
gitlab-exporter!
|
|
105
|
-
rspec (~> 3.
|
|
106
|
-
rspec-expectations (~> 3.
|
|
105
|
+
rspec (~> 3.12)
|
|
106
|
+
rspec-expectations (~> 3.12.0)
|
|
107
107
|
rubocop (~> 0.42)
|
|
108
108
|
|
|
109
109
|
BUNDLED WITH
|
data/gitlab-exporter.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
|
|
23
23
|
s.add_runtime_dependency "connection_pool", "2.2.5"
|
|
24
24
|
s.add_runtime_dependency "faraday", "~> 1.8.0"
|
|
25
|
-
s.add_runtime_dependency "pg", "1.
|
|
25
|
+
s.add_runtime_dependency "pg", "1.5.3"
|
|
26
26
|
s.add_runtime_dependency "puma", "5.6.5"
|
|
27
27
|
s.add_runtime_dependency "quantile", "0.2.1"
|
|
28
28
|
s.add_runtime_dependency "redis", "4.4.0"
|
|
@@ -31,6 +31,6 @@ Gem::Specification.new do |s|
|
|
|
31
31
|
s.add_runtime_dependency "sinatra", "~> 2.2.0"
|
|
32
32
|
s.add_runtime_dependency "webrick", "~> 1.7"
|
|
33
33
|
|
|
34
|
-
s.add_development_dependency "rspec", "~> 3.
|
|
35
|
-
s.add_development_dependency "rspec-expectations", "~> 3.
|
|
34
|
+
s.add_development_dependency "rspec", "~> 3.12.0"
|
|
35
|
+
s.add_development_dependency "rspec-expectations", "~> 3.12.0"
|
|
36
36
|
end
|
data/lib/gitlab_exporter/cli.rb
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
require "yaml"
|
|
2
2
|
|
|
3
|
+
# TODO: Remove this once we're on Ruby 3
|
|
4
|
+
# https://gitlab.com/gitlab-org/gitlab/-/issues/393651
|
|
5
|
+
unless YAML.respond_to?(:safe_load_file)
|
|
6
|
+
module YAML # rubocop:disable Style/Documentation
|
|
7
|
+
# Temporary Ruby 2 back-compat workaround.
|
|
8
|
+
#
|
|
9
|
+
# This method only exists as of stdlib 3.0.0:
|
|
10
|
+
# https://ruby-doc.org/stdlib-3.0.0/libdoc/psych/rdoc/Psych.html
|
|
11
|
+
def self.safe_load_file(path, **options)
|
|
12
|
+
YAML.safe_load(File.read(path), **options)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
3
17
|
module GitLab
|
|
4
18
|
module Exporter
|
|
5
19
|
# Stores runner classes in a single place
|
|
@@ -184,7 +198,7 @@ module GitLab
|
|
|
184
198
|
def run
|
|
185
199
|
validate!
|
|
186
200
|
|
|
187
|
-
config = Utils.deep_symbolize_hash_keys(YAML.
|
|
201
|
+
config = Utils.deep_symbolize_hash_keys(YAML.safe_load_file(@config_file, aliases: true))
|
|
188
202
|
|
|
189
203
|
WebExporter.setup(config)
|
|
190
204
|
WebExporter.run!
|
|
@@ -8,7 +8,6 @@ module GitLab
|
|
|
8
8
|
# This class works under the assumption you do COUNT(*) queries, define
|
|
9
9
|
# queries in the QUERIES constant. If in doubt how these work, read
|
|
10
10
|
# #construct_query
|
|
11
|
-
# rubocop:disable Metrics/ClassLength
|
|
12
11
|
class RowCountCollector < Base
|
|
13
12
|
# We ignore mirrors with a next_execution_timestamp before
|
|
14
13
|
# 2020-03-28 because this is when we stopped processing mirrors
|
|
@@ -118,138 +117,6 @@ module GitLab
|
|
|
118
117
|
visibility_level: {},
|
|
119
118
|
root: { definition: "(parent_id IS NULL)" }
|
|
120
119
|
}
|
|
121
|
-
},
|
|
122
|
-
container_repositories_migration_pending: {
|
|
123
|
-
select: :container_repositories,
|
|
124
|
-
where: <<~SQL
|
|
125
|
-
migration_state <> 'import_done'
|
|
126
|
-
AND created_at < '2022-08-17 00:00:00'
|
|
127
|
-
SQL
|
|
128
|
-
},
|
|
129
|
-
container_repositories_pre_importing: {
|
|
130
|
-
select: :container_repositories,
|
|
131
|
-
where: "migration_state = 'pre_importing'"
|
|
132
|
-
},
|
|
133
|
-
container_repositories_importing: {
|
|
134
|
-
select: :container_repositories,
|
|
135
|
-
where: "migration_state = 'importing'"
|
|
136
|
-
},
|
|
137
|
-
container_repositories_pre_import_done: {
|
|
138
|
-
select: :container_repositories,
|
|
139
|
-
where: "migration_state = 'pre_import_done'"
|
|
140
|
-
},
|
|
141
|
-
container_repositories_import_done: {
|
|
142
|
-
select: :container_repositories,
|
|
143
|
-
where: "migration_state = 'import_done'"
|
|
144
|
-
},
|
|
145
|
-
container_repositories_import_skipped: {
|
|
146
|
-
select: :container_repositories,
|
|
147
|
-
where: "migration_state = 'import_skipped'"
|
|
148
|
-
},
|
|
149
|
-
container_repositories_import_aborted: {
|
|
150
|
-
select: :container_repositories,
|
|
151
|
-
where: "migration_state = 'import_aborted'"
|
|
152
|
-
},
|
|
153
|
-
container_repositories_migration_all_free: {
|
|
154
|
-
select: :container_repositories,
|
|
155
|
-
where: <<~SQL
|
|
156
|
-
migration_plan IN ('free', 'early_adopter')
|
|
157
|
-
OR migration_plan IS NULL
|
|
158
|
-
SQL
|
|
159
|
-
},
|
|
160
|
-
container_repositories_migration_pending_free: {
|
|
161
|
-
select: :container_repositories,
|
|
162
|
-
where: <<~SQL
|
|
163
|
-
migration_state <> 'import_done'
|
|
164
|
-
AND created_at < '2022-08-17 00:00:00'
|
|
165
|
-
AND (migration_plan IN ('free', 'early_adopter')
|
|
166
|
-
OR migration_plan IS NULL)
|
|
167
|
-
SQL
|
|
168
|
-
},
|
|
169
|
-
container_repositories_import_done_free: {
|
|
170
|
-
select: :container_repositories,
|
|
171
|
-
where: <<~SQL
|
|
172
|
-
(migration_state = 'import_done' OR created_at >= '2022-08-17 00:00:00')
|
|
173
|
-
AND (migration_plan IN ('free', 'early_adopter')
|
|
174
|
-
OR migration_plan IS NULL)
|
|
175
|
-
SQL
|
|
176
|
-
},
|
|
177
|
-
container_repositories_stalled_pre_importing: {
|
|
178
|
-
select: :container_repositories,
|
|
179
|
-
where: <<~SQL
|
|
180
|
-
migration_state = 'pre_importing'
|
|
181
|
-
AND (COALESCE(migration_pre_import_started_at, TO_TIMESTAMP(0)) < (now() - INTERVAL '20 minutes'))
|
|
182
|
-
SQL
|
|
183
|
-
},
|
|
184
|
-
container_repositories_stalled_pre_import_done: {
|
|
185
|
-
select: :container_repositories,
|
|
186
|
-
where: <<~SQL
|
|
187
|
-
migration_state = 'pre_import_done'
|
|
188
|
-
AND (COALESCE(migration_pre_import_done_at, TO_TIMESTAMP(0)) < (now() - INTERVAL '5 minutes'))
|
|
189
|
-
SQL
|
|
190
|
-
},
|
|
191
|
-
container_repositories_stalled_importing: {
|
|
192
|
-
select: :container_repositories,
|
|
193
|
-
where: <<~SQL
|
|
194
|
-
migration_state = 'importing'
|
|
195
|
-
AND (COALESCE(migration_import_started_at, TO_TIMESTAMP(0)) < (now() - INTERVAL '5 minutes'))
|
|
196
|
-
SQL
|
|
197
|
-
},
|
|
198
|
-
container_repositories_skipped_not_in_plan: {
|
|
199
|
-
select: :container_repositories,
|
|
200
|
-
where: <<~SQL
|
|
201
|
-
migration_state = 'import_skipped'
|
|
202
|
-
AND migration_skipped_reason = 0
|
|
203
|
-
SQL
|
|
204
|
-
},
|
|
205
|
-
container_repositories_skipped_too_many_retries: {
|
|
206
|
-
select: :container_repositories,
|
|
207
|
-
where: <<~SQL
|
|
208
|
-
migration_state = 'import_skipped'
|
|
209
|
-
AND migration_skipped_reason = 1
|
|
210
|
-
SQL
|
|
211
|
-
},
|
|
212
|
-
container_repositories_skipped_too_many_tags: {
|
|
213
|
-
select: :container_repositories,
|
|
214
|
-
where: <<~SQL
|
|
215
|
-
migration_state = 'import_skipped'
|
|
216
|
-
AND migration_skipped_reason = 2
|
|
217
|
-
SQL
|
|
218
|
-
},
|
|
219
|
-
container_repositories_skipped_deny_list: {
|
|
220
|
-
select: :container_repositories,
|
|
221
|
-
where: <<~SQL
|
|
222
|
-
migration_state = 'import_skipped'
|
|
223
|
-
AND migration_skipped_reason = 3
|
|
224
|
-
SQL
|
|
225
|
-
},
|
|
226
|
-
container_repositories_skipped_canceled: {
|
|
227
|
-
select: :container_repositories,
|
|
228
|
-
where: <<~SQL
|
|
229
|
-
migration_state = 'import_skipped'
|
|
230
|
-
AND migration_skipped_reason IN (4, 8)
|
|
231
|
-
SQL
|
|
232
|
-
},
|
|
233
|
-
container_repositories_skipped_not_found: {
|
|
234
|
-
select: :container_repositories,
|
|
235
|
-
where: <<~SQL
|
|
236
|
-
migration_state = 'import_skipped'
|
|
237
|
-
AND migration_skipped_reason = 5
|
|
238
|
-
SQL
|
|
239
|
-
},
|
|
240
|
-
container_repositories_skipped_native: {
|
|
241
|
-
select: :container_repositories,
|
|
242
|
-
where: <<~SQL
|
|
243
|
-
migration_state = 'import_skipped'
|
|
244
|
-
AND migration_skipped_reason = 6
|
|
245
|
-
SQL
|
|
246
|
-
},
|
|
247
|
-
container_repositories_skipped_force_canceled: {
|
|
248
|
-
select: :container_repositories,
|
|
249
|
-
where: <<~SQL
|
|
250
|
-
migration_state = 'import_skipped'
|
|
251
|
-
AND migration_skipped_reason = 7
|
|
252
|
-
SQL
|
|
253
120
|
}
|
|
254
121
|
}.freeze
|
|
255
122
|
|
|
@@ -315,7 +182,6 @@ module GitLab
|
|
|
315
182
|
query_string << ";"
|
|
316
183
|
end
|
|
317
184
|
end
|
|
318
|
-
# rubocop:enable Metrics/ClassLength
|
|
319
185
|
|
|
320
186
|
# The prober which is called when gathering metrics
|
|
321
187
|
class RowCountProber
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-exporter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 13.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pablo Carranza
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - '='
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.
|
|
47
|
+
version: 1.5.3
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - '='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.
|
|
54
|
+
version: 1.5.3
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: puma
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -156,28 +156,28 @@ dependencies:
|
|
|
156
156
|
requirements:
|
|
157
157
|
- - "~>"
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 3.
|
|
159
|
+
version: 3.12.0
|
|
160
160
|
type: :development
|
|
161
161
|
prerelease: false
|
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
163
|
requirements:
|
|
164
164
|
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: 3.
|
|
166
|
+
version: 3.12.0
|
|
167
167
|
- !ruby/object:Gem::Dependency
|
|
168
168
|
name: rspec-expectations
|
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
|
170
170
|
requirements:
|
|
171
171
|
- - "~>"
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: 3.
|
|
173
|
+
version: 3.12.0
|
|
174
174
|
type: :development
|
|
175
175
|
prerelease: false
|
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
177
|
requirements:
|
|
178
178
|
- - "~>"
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: 3.
|
|
180
|
+
version: 3.12.0
|
|
181
181
|
description: GitLab metrics exporter to use with prometheus
|
|
182
182
|
email: pablo@gitlab.com
|
|
183
183
|
executables:
|