sidekiq-prometheus-exporter 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6abd894355205259e60c8804e17560ca107d88f0299aea7fae7c495130521dd
4
- data.tar.gz: 5665a775e383a91b129d12e84128740904321da0e099fc1237c9381701bd2b91
3
+ metadata.gz: 35e10d4b151d755705e57fabba8497aceb6d83ebfe042dc09e4dd310e7c62c5a
4
+ data.tar.gz: cbe9fc29d375d66550ff05077dcb00e0fa24c2ffc843e660ef2509e7e39df8f7
5
5
  SHA512:
6
- metadata.gz: 95a6c12a03307b5cd4651bb6190d1bf4659005554d1f42839f6f340f9bf55faab6a5335dc29ec49982f381312502ef10dec9fff2578e9120179d1f04350a980d
7
- data.tar.gz: 1d4c635db97afde9d894c5294ef5d592fe2f3caf5cc72f0a33b7d1dd8ba70614eee1b54e4d3b2f54a744a03587bd669f1f7d442bfc7b803ed6f8e904b2c73edf
6
+ metadata.gz: 29d0f796a65f70debbc1ae73d8e71ba3425b9a16b0b1b8f79fad7c4668941b88f2ef82c004af9e537bf6cbc9d1c17df4095e9ac69a1c1e296342557a94bd79e0
7
+ data.tar.gz: eae4aa3a3326cb67e8e63189e8857bcf21d082c883ef55cd213f4de40b3bd566f7a998a282b3193b992ef2b5df3471ec0b6800f9cdc4b7b8b22e7b47b859f3d4
@@ -6,37 +6,45 @@ on:
6
6
  pull_request:
7
7
  branches: ["master"]
8
8
  jobs:
9
+ rubocop:
10
+ name: Rubocop
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 3.0.2
17
+ - name: rubocop
18
+ uses: reviewdog/action-rubocop@v2
19
+ with:
20
+ github_token: ${{ secrets.GITHUB_TOKEN }}
21
+ rubocop_version: gemfile
22
+ rubocop_extensions: rubocop-rake:gemfile rubocop-rspec:gemfile rubocop-performance:gemfile
23
+ reporter: github-pr-review
24
+ fail_on_error: true
25
+
9
26
  test:
10
- runs-on: ubuntu-16.04
27
+ needs: rubocop
28
+ runs-on: ubuntu-latest
11
29
  name: Ruby ${{ matrix.ruby }} / Sidekiq ${{ matrix.sidekiq }}
12
30
  strategy:
13
31
  matrix:
14
- ruby: ["2.3.8", "2.4.10", "2.5.8", "2.6.6", "2.7.2", "latest"]
32
+ # Always keep a window of "5 most recent" including (or on top with) HEAD
33
+ ruby: ["2.5.9", "2.6.8", "2.7.4", "3.0.2", "latest"]
15
34
  sidekiq: ["3.3.1", "3.x", "4.x", "5.x", "6.x", "latest"]
16
- include:
17
- - ruby: "2.6.6"
18
- sidekiq: "5.x"
19
- codeclimate: "true"
35
+ # Allow failures ... kind-a
20
36
  exclude:
21
- - ruby: "2.3.8"
22
- sidekiq: "6.x"
23
- - ruby: "2.4.10"
24
- sidekiq: "6.x"
25
- - ruby: "2.3.8"
37
+ - ruby: "2.5.9"
26
38
  sidekiq: "latest"
27
- - ruby: "2.4.10"
39
+ - ruby: "2.6.8"
28
40
  sidekiq: "latest"
29
- - ruby: "2.5.8"
41
+ - ruby: "2.7.4"
30
42
  sidekiq: "latest"
31
- - ruby: "2.6.6"
32
- sidekiq: "latest"
33
- - ruby: "2.7.2"
43
+ - ruby: "3.0.2"
34
44
  sidekiq: "latest"
35
45
 
36
46
  container:
37
47
  image: ruby:${{ matrix.ruby }}
38
- env:
39
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
40
48
 
41
49
  steps:
42
50
  - uses: actions/checkout@v2
@@ -50,27 +58,11 @@ jobs:
50
58
  - name: Upgrade Bundler to 2.x (for older Ruby versions)
51
59
  run: gem install bundler -v '~> 2.1'
52
60
 
53
- - name: Install CodeClimate test reporter
54
- if: steps.vendor-cache.outputs.cache-hit != 'true'
55
- run: |
56
- mkdir -p ./vendor
57
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
58
- > ./vendor/cc-test-reporter
59
- chmod +x ./vendor/cc-test-reporter
60
-
61
61
  - name: Bundle install
62
62
  run: |
63
63
  bundle config path vendor/bundle
64
64
  bundle config gemfile gemfiles/sidekiq_${{ matrix.sidekiq }}.Gemfile
65
65
  bundle install
66
66
 
67
- - name: Start recording Codeclimate test coverage
68
- if: matrix.codeclimate == 'true'
69
- run: ./vendor/cc-test-reporter before-build
70
-
71
67
  - name: Run RSpec
72
68
  run: bundle exec rake spec
73
-
74
- - name: Finish recording Codeclimate test coverage
75
- if: matrix.codeclimate == 'true'
76
- run: ./vendor/cc-test-reporter after-build
data/.rubocop.yml CHANGED
@@ -1,46 +1,24 @@
1
1
  ---
2
- require: rubocop-rspec
2
+ require:
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+ - rubocop-performance
3
6
 
4
7
  AllCops:
8
+ NewCops: enable
9
+ SuggestExtensions: false
5
10
  TargetRubyVersion: ~
6
11
 
7
- Style/Alias:
8
- EnforcedStyle: prefer_alias_method
9
-
10
- Style/AndOr:
11
- # Whether `and` and `or` are banned only in conditionals (conditionals)
12
- # or completely (always).
13
- EnforcedStyle: conditionals
14
-
15
- # Use ` or %x around command literals.
16
- Style/CommandLiteral:
17
- EnforcedStyle: mixed
18
- # backticks: Always use backticks.
19
- # percent_x: Always use %x.
20
- # mixed: Use backticks on single-line commands, and %x on multi-line commands.
21
- SupportedStyles:
22
- - backticks
23
- - percent_x
24
- - mixed
25
- # If false, the cop will always recommend using %x if one or more backticks
26
- # are found in the command string.
27
- AllowInnerBackticks: false
12
+ Gemspec/RequiredRubyVersion:
13
+ Enabled: false
28
14
 
29
15
  Style/Documentation:
30
16
  Enabled: false
31
17
 
32
18
  Style/FrozenStringLiteralComment:
33
19
  EnforcedStyle: always
34
- SupportedStyles:
35
- # `when_needed` will add the frozen string literal comment to files
36
- # only when the `TargetRubyVersion` is set to 2.3+.
37
- - when_needed
38
- # `always` will always add the frozen string literal comment to a file
39
- # regardless of the Ruby version or if `freeze` or `<<` are called on a
40
- # string literal. If you run code against multiple versions of Ruby, it is
41
- # possible that this will create errors in Ruby 2.3.0+.
42
- - always
43
20
  Exclude:
21
+ - "Appraisals"
44
22
  - "Gemfile"
45
23
  - "Rakefile"
46
24
  - "bin/*"
@@ -49,240 +27,52 @@ Style/FrozenStringLiteralComment:
49
27
  - "**/*.gemspec"
50
28
  - "**/*.rake"
51
29
 
52
- # Enable when it will respect line length rules
53
- Style/IfUnlessModifier:
30
+ Style/PercentLiteralDelimiters:
31
+ PreferredDelimiters:
32
+ "%i": "()"
33
+ "%w": "()"
34
+
35
+ Style/TernaryParentheses:
36
+ EnforcedStyle: require_parentheses_when_complex
37
+
38
+ Style/RedundantFreeze:
54
39
  Enabled: false
55
40
 
56
- Style/Lambda:
57
- EnforcedStyle: literal
58
- SupportedStyles:
59
- - line_count_dependent
60
- - lambda
61
- - literal
62
-
63
- Style/Next:
64
- # With `always` all conditions at the end of an iteration needs to be
65
- # replaced by next - with `skip_modifier_ifs` the modifier if like this one
66
- # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
67
- EnforcedStyle: skip_modifier_ifs
68
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
69
- # needs to have to trigger this cop
70
- MinBodyLength: 3
71
- SupportedStyles:
72
- - skip_modifier_ifs
73
- - always
74
-
75
- Style/NonNilCheck:
76
- # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
77
- # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
78
- # **usually** OK, but might change behavior.
79
- #
80
- # With `IncludeSemanticChanges` set to `false`, this cop does not report
81
- # offenses for `!x.nil?` and does no changes that might change behavior.
82
- IncludeSemanticChanges: false
41
+ Style/IfUnlessModifier:
42
+ Enabled: false
83
43
 
84
44
  Style/NumericPredicate:
85
45
  EnforcedStyle: predicate
86
- SupportedStyles:
87
- - predicate
88
- - comparison
89
- # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
90
- # false positives.
91
46
  Exclude:
92
47
  - "spec/**/*"
93
48
 
94
- Style/MethodCalledOnDoEndBlock:
95
- Description: "Avoid chaining a method call on a do...end block."
96
- StyleGuide: "#single-line-blocks"
97
- Enabled: true
98
-
99
- Style/PercentLiteralDelimiters:
100
- PreferredDelimiters:
101
- "%": ()
102
- "%i": ()
103
- "%I": ()
104
- "%q": ()
105
- "%Q": ()
106
- "%r": "{}"
107
- "%s": ()
108
- "%w": ()
109
- "%W": ()
110
- "%x": "{}"
111
-
112
- Style/SpecialGlobalVars:
113
- EnforcedStyle: use_english_names
114
- SupportedStyles:
115
- - use_perl_names
116
- - use_english_names
117
-
118
- Style/StabbyLambdaParentheses:
119
- EnforcedStyle: require_parentheses
120
- SupportedStyles:
121
- - require_parentheses
122
- - require_no_parentheses
123
-
124
- Style/StringLiterals:
125
- EnforcedStyle: single_quotes
126
- SupportedStyles:
127
- - single_quotes
128
- - double_quotes
129
- # If true, strings which span multiple lines using \ for continuation must
130
- # use the same type of quotes on each line.
131
- ConsistentQuotesInMultiline: false
132
-
133
- Style/StringLiteralsInInterpolation:
134
- EnforcedStyle: single_quotes
135
- SupportedStyles:
136
- - single_quotes
137
- - double_quotes
138
-
139
- Style/StringMethods:
140
- # Mapping from undesired method to desired_method
141
- # e.g. to use `to_sym` over `intern`:
142
- #
143
- # StringMethods:
144
- # PreferredMethods:
145
- # intern: to_sym
146
- PreferredMethods:
147
- intern: to_sym
148
-
149
- Style/TernaryParentheses:
150
- EnforcedStyle: require_parentheses_when_complex
151
- SupportedStyles:
152
- - require_parentheses
153
- - require_no_parentheses
154
- - require_parentheses_when_complex
155
- AllowSafeAssignment: true
156
-
157
- #################### Naming ####################################
158
-
159
- Naming/AccessorMethodName:
160
- Description: Check the naming of accessor methods for get_/set_.
161
- StyleGuide: "#accessor_mutator_method_names"
162
-
163
- # https://rubocop.readthedocs.io/en/latest/cops_naming/#naminguncommunicativemethodparamname
164
- Naming/MethodParameterName:
165
- AllowedNames:
166
- - _
167
- - io
168
- - id
169
- - to
170
- - by
171
- - on
172
- - in
173
- - at
174
-
175
- #################### Layout ####################################
49
+ Style/NumericLiterals:
50
+ Exclude:
51
+ - "spec/**/*"
176
52
 
177
53
  Layout/LineLength:
178
- # Default: 80
179
54
  Max: 120
180
55
 
181
- Layout/ParameterAlignment:
182
- # Alignment of parameters in multi-line method calls.
183
- #
184
- # The `with_first_parameter` style aligns the following lines along the same
185
- # column as the first parameter.
186
- #
187
- # method_call(a,
188
- # b)
189
- #
190
- # The `with_fixed_indentation` style aligns the following lines with one
191
- # level of indentation relative to the start of the line with the method call.
192
- #
193
- # method_call(a,
194
- # b)
195
- EnforcedStyle: with_fixed_indentation
196
- SupportedStyles:
197
- - with_first_parameter
198
- - with_fixed_indentation
199
-
200
- # Checks the indentation of the first element in an array literal.
201
- Layout/FirstArrayElementIndentation:
202
- # The value `special_inside_parentheses` means that array literals with
203
- # brackets that have their opening bracket on the same line as a surrounding
204
- # opening round parenthesis, shall have their first element indented relative
205
- # to the first position inside the parenthesis.
206
- #
207
- # The value `consistent` means that the indentation of the first element shall
208
- # always be relative to the first position of the line where the opening
209
- # bracket is.
210
- #
211
- # The value `align_brackets` means that the indentation of the first element
212
- # shall always be relative to the position of the opening bracket.
213
- EnforcedStyle: consistent
214
- SupportedStyles:
215
- - special_inside_parentheses
216
- - consistent
217
- - align_brackets
218
- # By default, the indentation width from Style/IndentationWidth is used
219
- # But it can be overridden by setting this parameter
220
- IndentationWidth: ~
221
-
222
- # Checks the indentation of the first key in a hash literal.
223
- Layout/FirstHashElementIndentation:
224
- # The value `special_inside_parentheses` means that hash literals with braces
225
- # that have their opening brace on the same line as a surrounding opening
226
- # round parenthesis, shall have their first key indented relative to the
227
- # first position inside the parenthesis.
228
- #
229
- # The value `consistent` means that the indentation of the first key shall
230
- # always be relative to the first position of the line where the opening
231
- # brace is.
232
- #
233
- # The value `align_braces` means that the indentation of the first key shall
234
- # always be relative to the position of the opening brace.
235
- EnforcedStyle: consistent
236
- SupportedStyles:
237
- - special_inside_parentheses
238
- - consistent
239
- - align_braces
240
- # By default, the indentation width from Style/IndentationWidth is used
241
- # But it can be overridden by setting this parameter
242
- IndentationWidth: ~
243
-
244
- Layout/SpaceBeforeFirstArg:
245
- # When true, allows most uses of extra spacing if the intent is to align
246
- # things with the previous or next line, not counting empty lines or comment
247
- # lines.
248
- AllowForAlignment: false
249
-
250
56
  Layout/SpaceAroundBlockParameters:
251
57
  EnforcedStyleInsidePipes: no_space
252
58
 
253
59
  Layout/SpaceInsideHashLiteralBraces:
254
60
  EnforcedStyle: no_space
255
61
  EnforcedStyleForEmptyBraces: no_space
256
- SupportedStyles:
257
- - space
258
- - no_space
259
- # 'compact' normally requires a space inside hash braces, with the exception
260
- # that successive left braces or right braces are collapsed together
261
- - compact
262
62
 
263
63
  Layout/MultilineMethodCallIndentation:
264
64
  EnforcedStyle: indented
265
- SupportedStyles:
266
- - aligned
267
- - indented
268
- - indented_relative_to_receiver
269
- # By default, the indentation width from Layout/IndentationWidth is used
270
- # But it can be overridden by setting this parameter
271
65
  IndentationWidth: ~
272
66
 
273
67
  Layout/MultilineOperationIndentation:
274
68
  EnforcedStyle: indented
275
- SupportedStyles:
276
- - aligned
277
- - indented
278
- # By default, the indentation width from Style/IndentationWidth is used
279
- # But it can be overridden by setting this parameter
280
69
  IndentationWidth: ~
281
70
 
282
- ##################### Metrics ##################################
71
+ Metrics/AbcSize:
72
+ Max: 25
73
+ CountRepeatedAttributes: false
283
74
 
284
75
  Metrics/MethodLength:
285
- # Default: 10
286
76
  Max: 15
287
77
 
288
78
  Metrics/BlockLength:
@@ -292,94 +82,51 @@ Metrics/BlockLength:
292
82
  - "**/*.rake"
293
83
  - "spec/**/*.rb"
294
84
 
295
- ##################### Lint ##################################
296
-
297
- # https://rubocop.readthedocs.io/en/latest/cops_lint/#lintambiguousblockassociation
298
85
  Lint/AmbiguousBlockAssociation:
299
86
  Enabled: false
300
87
 
301
- Lint/InheritException:
302
- # The default base class in favour of `Exception`.
303
- EnforcedStyle: standard_error
304
- SupportedStyles:
305
- - runtime_error
306
- - standard_error
307
-
308
- ##################### Rails ##################################
309
-
310
- # NOT IMPLEMENTED YET
311
- # Rails/EnumUniqueness:
312
- # Include:
313
- # - app/models/**/*.rb
314
-
315
- ##################### RSpec ##################################
88
+ Lint/StructNewOverride:
89
+ Exclude:
90
+ - "lib/sidekiq/prometheus/exporter/standard.rb"
316
91
 
317
- # Disabled because we want to adjust it and allow to use it
318
92
  RSpec/AnyInstance:
319
93
  Enabled: false
320
94
 
321
- # Allow only `when` prefix
322
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L51
323
95
  RSpec/ContextWording:
324
96
  Prefixes:
325
97
  - when
326
98
 
327
- Layout/DefEndAlignment:
328
- # The value `def` means that `end` should be aligned with the def keyword.
329
- # The value `start_of_line` means that `end` should be aligned with method
330
- # calls like `private`, `public`, etc, if present in front of the `def`
331
- # keyword on the same line.
332
- EnforcedStyleAlignWith: start_of_line
333
- AutoCorrect: false
334
-
335
- # Disabled because we want to adjust it and allow to use it
336
- # and allow just to write a normal description
337
99
  RSpec/DescribeMethod:
338
100
  Enabled: false
339
101
 
340
- # Allow only for inline test cases
341
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L122
342
102
  RSpec/ExampleWithoutDescription:
343
103
  EnforcedStyle: single_line_only
344
104
 
345
- # Disabled because we want to adjust it and allow to use it with
346
- # better names, not everything is squashed
347
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L169
348
105
  RSpec/FilePath:
349
106
  Enabled: false
350
107
 
351
- # Don't run check because no implicit expectations are allowed
352
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L193
353
108
  RSpec/ImplicitExpect:
354
109
  Enabled: false
355
110
 
356
- # Disabled because we want to adjust it and allow to use it with the
357
- # option to check that it's the latest item in the context `let`s
358
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L227
359
111
  RSpec/LeadingSubject:
360
112
  Enabled: false
361
113
 
362
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L247
363
114
  RSpec/MessageExpectation:
364
115
  Enabled: true
365
116
 
366
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L275
367
117
  RSpec/MultipleExpectations:
368
118
  Enabled: true
369
- # Default: 1
370
119
  Max: 5
371
120
 
372
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L292
121
+ RSpec/MultipleMemoizedHelpers:
122
+ Max: 7
123
+
373
124
  RSpec/NestedGroups:
374
- Description: Checks for nested example groups.
375
125
  Enabled: true
376
- # Default: 3
377
126
  Max: 4
378
127
 
379
- # https://github.com/rubocop-hq/rubocop-rspec/blob/c1fd129a59e650b8af518ae2e62848aa7eb8498e/config/default.yml#L366
380
128
  RSpec/ScatteredSetup:
381
129
  Enabled: true
382
130
 
383
- # Enable in future
384
- FactoryBot/AttributeDefinedStatically:
131
+ Rake/Desc:
385
132
  Enabled: false
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  ![CI status](https://github.com/Strech/sidekiq-prometheus-exporter/workflows/CI/badge.svg)
2
2
  [![Maintainability](https://api.codeclimate.com/v1/badges/bb1b30cd7aca8ecc9413/maintainability)](https://codeclimate.com/github/Strech/sidekiq-prometheus-exporter/maintainability)
3
- [![Test Coverage](https://api.codeclimate.com/v1/badges/bb1b30cd7aca8ecc9413/test_coverage)](https://codeclimate.com/github/Strech/sidekiq-prometheus-exporter/test_coverage)
4
3
 
5
4
  # Sidekiq Prometheus Exporter
6
5
 
@@ -12,6 +11,13 @@
12
11
 
13
12
  Open [dashboard example file](/examples/sidekiq-dashboard.grafana-7.json) (grafana 7), then open `https://<your grafana-url>/dashboard/import` and paste the content of the file.
14
13
 
14
+ ---
15
+
16
+ #### If you like the project and want to support me on my sleepless nights, you can
17
+
18
+ [![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.com/paypalme/onistrech/eur5.0)
19
+ [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W8367XJ)
20
+
15
21
  # Available metrics
16
22
 
17
23
  _(starting Sidekiq `v3.3.1`)_
@@ -32,6 +38,9 @@ _(starting Sidekiq `v3.3.1`)_
32
38
  | sidekiq_queue_latency_seconds | gauge | The number of seconds between oldest job being pushed to the queue and current time (labels: `name`) |
33
39
  | sidekiq_queue_max_processing_time_seconds | gauge | The number of seconds between oldest job of the queue being executed and current time (labels: `name`) |
34
40
  | sidekiq_queue_enqueued_jobs | gauge | The number of enqueued jobs in the queue (labels: `name`) |
41
+ | sidekiq_queue_workers | gauge | The number of workers serving the queue (labels: `name`) |
42
+ | sidekiq_queue_processes | gauge | The number of processes serving the queue (labels: `name`) |
43
+ | sidekiq_queue_busy_workers | gauge | The number of workers performing the job for the queue (labels: `name`) |
35
44
 
36
45
  <details>
37
46
  <summary>Click to expand for all available contribs</summary>
@@ -52,13 +61,6 @@ _(starting Sidekiq `v3.3.1`)_
52
61
 
53
62
  </details>
54
63
 
55
- ## Sponsorship
56
-
57
- If you like the project and want to support me on my sleepless nights, you can
58
-
59
- [![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.com/paypalme/onistrech/eur5.0)
60
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W8367XJ)
61
-
62
64
  # Installation
63
65
 
64
66
  Add this line to your application's Gemfile:
@@ -146,7 +148,7 @@ and then `curl https://<your-sidekiq-web-uri>/metrics`
146
148
 
147
149
  If we are talking about isolation you can run already prepared official
148
150
  rack application in the Docker container by using the [public image](https://hub.docker.com/r/strech/sidekiq-prometheus-exporter)
149
- (check out this [README](/blob/master/docker/README.md) for more)
151
+ (check out this [README](/docker/README.md) for more)
150
152
 
151
153
  ```bash
152
154
  $ docker run -it --rm \
data/Rakefile CHANGED
@@ -26,43 +26,48 @@ end
26
26
 
27
27
  namespace :docker do
28
28
  desc "Release new Docker image strech/sidekiq-prometheus-exporter:#{VERSION} (latest)"
29
- task :release do
30
- Rake::Task['docker:build'].invoke
31
- Rake::Task['docker:push'].invoke
29
+ task :release, %i(patch) do |_, args|
30
+ version = [VERSION, args.patch].compact.join('-')
31
+
32
+ Rake::Task['docker:build'].invoke(version)
33
+ Rake::Task['docker:push'].invoke(version)
32
34
  end
33
35
 
34
- task :build do
36
+ task :build, %i(version) do |_, args|
37
+ args.with_defaults(version: VERSION)
35
38
  image = 'strech/sidekiq-prometheus-exporter'
36
39
 
37
40
  Dir.chdir(File.expand_path('./docker')) do
38
- execute("docker build -t #{image}:#{VERSION} -t #{image}:latest .")
41
+ execute("docker build -t #{image}:#{args.version} -t #{image}:latest .")
39
42
  end
40
43
 
41
- puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{VERSION} (latest)"
44
+ puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{args.version} (latest)"
42
45
  end
43
46
 
44
- task :push do
47
+ task :push, %i(version) do |_, args|
48
+ args.with_defaults(version: VERSION)
45
49
  image = 'strech/sidekiq-prometheus-exporter'
46
50
 
47
- execute("docker push #{image}:#{VERSION}")
51
+ execute("docker push #{image}:#{args.version}")
48
52
  execute("docker push #{image}:latest")
49
53
 
50
- puts "Successfully pushed strech/sidekiq-prometheus-exporter:#{VERSION} (latest)"
54
+ puts "Successfully pushed strech/sidekiq-prometheus-exporter:#{args.version} (latest)"
51
55
  end
52
56
  end
53
57
 
54
58
  namespace :helm do
55
59
  desc 'Generate new Helm repo index'
56
- task :generate do
60
+ task :generate, %i(patch) do |_, args|
61
+ version = [VERSION, args.patch].compact.join('-')
57
62
  archive_dir = File.expand_path("./tmp/archive-#{Time.now.to_i}")
58
63
 
59
64
  Rake::Task['helm:package'].invoke(archive_dir)
60
- Rake::Task['helm:index'].invoke(archive_dir)
65
+ Rake::Task['helm:index'].invoke(archive_dir, version)
61
66
 
62
67
  puts "New index generated: #{File.join(archive_dir, 'index.yaml')}"
63
68
  end
64
69
 
65
- task :package, [:directory] do |_, args|
70
+ task :package, %i(directory) do |_, args|
66
71
  chart_dir = File.expand_path('./helm/sidekiq-prometheus-exporter')
67
72
  archive_dir = args.fetch(:directory) { File.expand_path("./tmp/archive-#{Time.now.to_i}") }
68
73
 
@@ -71,9 +76,11 @@ namespace :helm do
71
76
  execute("helm package #{chart_dir} -d #{archive_dir}")
72
77
  end
73
78
 
74
- task :index, [:directory] do |_, args|
79
+ task :index, %i(directory version) do |_, args|
80
+ args.with_defaults(version: VERSION)
81
+
75
82
  Dir.chdir(args.fetch(:directory)) do
76
- url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{VERSION}"
83
+ url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{args.version}"
77
84
 
78
85
  execute('git show gh-pages:index.yaml > existing-index.yaml')
79
86
  execute("helm repo index . --url #{url} --merge existing-index.yaml")
data/docker/Dockerfile CHANGED
@@ -1,12 +1,12 @@
1
- FROM ruby:2.7.1-alpine
1
+ FROM ruby:2.7.3-alpine
2
2
 
3
3
  LABEL maintainer="Sergey Fedorov <oni.strech@gmail.com>"
4
4
  LABEL repository="strech/sidekiq-prometheus-exporter"
5
5
 
6
6
  ENV RACK_VERSION 2.0.9
7
- ENV SIDEKIQ_VERSION 5.2.8
8
- ENV REDIS_NAMESPACE_VERSION 1.7.0
9
- ENV SIDEKIQ_PROMETHEUS_EXPORTER_VERSION 0.1.15
7
+ ENV SIDEKIQ_VERSION 6.2.1
8
+ ENV REDIS_NAMESPACE_VERSION 1.8.1
9
+ ENV SIDEKIQ_PROMETHEUS_EXPORTER_VERSION 0.1.16
10
10
 
11
11
  RUN addgroup -S exporter \
12
12
  && adduser -s /bin/false -SDHg exporter exporter \
data/docker/README.md CHANGED
@@ -24,6 +24,7 @@ Required
24
24
 
25
25
  Optional
26
26
 
27
+ - `REDIS_SSL` - a flag to enable Redis SSL URL scheme (default: `false`)
27
28
  - `REDIS_PORT` - a Redis port (default: `6379`)
28
29
  - `REDIS_PASSWORD` - a Redis password (if you need one)
29
30
  - `REDIS_DB_NUMBER` - a Redis database number (default: `0`)