sidekiq-prometheus-exporter 0.1.14 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +68 -0
  3. data/.rubocop.yml +33 -286
  4. data/Appraisals +1 -1
  5. data/README.md +12 -10
  6. data/Rakefile +24 -14
  7. data/docker/Dockerfile +4 -4
  8. data/docker/README.md +14 -8
  9. data/docker/config.ru +4 -1
  10. data/examples/metrics/config.ru +2 -0
  11. data/examples/sidekiq/sidekiq.rb +2 -0
  12. data/gemfiles/{sidekiq_3.3.1.gemfile → sidekiq_3.3.1.Gemfile} +0 -0
  13. data/gemfiles/sidekiq_3.3.1.Gemfile.lock +126 -0
  14. data/gemfiles/{sidekiq_3.x.gemfile → sidekiq_3.x.Gemfile} +0 -0
  15. data/gemfiles/sidekiq_3.x.Gemfile.lock +141 -0
  16. data/gemfiles/{sidekiq_4.x.gemfile → sidekiq_4.x.Gemfile} +0 -0
  17. data/gemfiles/sidekiq_4.x.Gemfile.lock +102 -0
  18. data/gemfiles/{sidekiq_5.x.gemfile → sidekiq_5.x.Gemfile} +0 -0
  19. data/gemfiles/sidekiq_5.x.Gemfile.lock +101 -0
  20. data/gemfiles/{sidekiq_6.x.gemfile → sidekiq_6.x.Gemfile} +0 -0
  21. data/gemfiles/sidekiq_6.x.Gemfile.lock +98 -0
  22. data/gemfiles/{sidekiq_head.gemfile → sidekiq_latest.Gemfile} +0 -0
  23. data/gemfiles/sidekiq_latest.Gemfile.lock +116 -0
  24. data/helm/sidekiq-prometheus-exporter/Chart.yaml +2 -2
  25. data/helm/sidekiq-prometheus-exporter/README.md +1 -1
  26. data/helm/sidekiq-prometheus-exporter/values.yaml +3 -1
  27. data/lib/sidekiq/prometheus/exporter/standard.rb +19 -5
  28. data/lib/sidekiq/prometheus/exporter/templates/standard.erb +13 -1
  29. data/lib/sidekiq/prometheus/exporter/version.rb +1 -1
  30. data/lib/sidekiq/prometheus/exporter.rb +1 -1
  31. data/sidekiq-prometheus-exporter.gemspec +9 -5
  32. metadata +66 -38
  33. data/.codeclimate.yml +0 -16
  34. data/.travis.yml +0 -85
  35. data/gemfiles/sidekiq_3.3.1.gemfile.lock +0 -139
  36. data/gemfiles/sidekiq_3.x.gemfile.lock +0 -139
  37. data/gemfiles/sidekiq_4.x.gemfile.lock +0 -101
  38. data/gemfiles/sidekiq_5.x.gemfile.lock +0 -100
  39. data/gemfiles/sidekiq_6.x.gemfile.lock +0 -100
  40. data/gemfiles/sidekiq_head.gemfile.lock +0 -116
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b765e7d2573199042fcb0bc816c07797ddc7cd629a8491df3eee217f09282883
4
- data.tar.gz: 7db77dd139a068968b55a79c1cdf57f9bbb7684f739ad95044cfd6fd4cf22389
3
+ metadata.gz: 5d49eee804952e326619e0c38a486343c277249db897b8c2ef214d5f449efbbc
4
+ data.tar.gz: 529fadfaf195e9415d2344397acf8e73fd171022df02fbdbd13886e8d6c5230e
5
5
  SHA512:
6
- metadata.gz: 6c83d7afd3fcf1a0dfe16bc9bc35f05ad84bad8a46656d4af313c309427682f6e4347f912c3f0daeb7594d12fc9914f9e2e4f5452a4925643eebe81224e2e736
7
- data.tar.gz: 3be26fb67085e9dbebcd9eb9a377feb24acfbb075e1a67eebdf550ffa8e5c54716398e254fbf6cee9b4c92cf2b814bd1951dc13f9c13ded4c27c054020cc3828
6
+ metadata.gz: dd43a43f2d0f8dea5b58a64c42387cb2b9973021eb912d54ad24375af64f33f2252a3b27b029ef3008216d8c5908c7ea2259c0cbd06e7aac0c7120f4e2423695
7
+ data.tar.gz: 815ca578012da37e72d4293fef12adb228ad602e9ad33664588c1269f0cd6a8602c31e4456287eac180fead1a7cadf135f805a823a3ff2f0cad1e9971c75fa24
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: CI
3
+ on:
4
+ push:
5
+ branches: ["master"]
6
+ pull_request:
7
+ branches: ["master"]
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
+
26
+ test:
27
+ needs: rubocop
28
+ runs-on: ubuntu-latest
29
+ name: Ruby ${{ matrix.ruby }} / Sidekiq ${{ matrix.sidekiq }}
30
+ strategy:
31
+ matrix:
32
+ # Always keep a window of "5 most recent" including (or on top with) HEAD
33
+ ruby: ["2.6.8", "2.7.4", "3.0.2", "3.1.1", "latest"]
34
+ sidekiq: ["3.3.1", "3.x", "4.x", "5.x", "6.x", "latest"]
35
+ # Allow failures ... kind-a
36
+ exclude:
37
+ - ruby: "2.6.8"
38
+ sidekiq: "latest"
39
+ - ruby: "2.7.4"
40
+ sidekiq: "latest"
41
+ - ruby: "3.0.2"
42
+ sidekiq: "latest"
43
+ - ruby: "3.1.1"
44
+ sidekiq: "latest"
45
+
46
+ container:
47
+ image: ruby:${{ matrix.ruby }}
48
+
49
+ steps:
50
+ - uses: actions/checkout@v2
51
+
52
+ - uses: actions/cache@v2
53
+ id: vendor-cache
54
+ with:
55
+ path: vendor
56
+ key: bundle-${{ matrix.ruby }}-sidekiq-${{ matrix.sidekiq }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/.*Gemfile.lock') }}
57
+
58
+ - name: Upgrade Bundler to 2.x (for older Ruby versions)
59
+ run: gem install bundler -v '~> 2.1'
60
+
61
+ - name: Bundle install
62
+ run: |
63
+ bundle config path vendor/bundle
64
+ bundle config gemfile gemfiles/sidekiq_${{ matrix.sidekiq }}.Gemfile
65
+ bundle install
66
+
67
+ - name: Run RSpec
68
+ run: bundle exec rake spec
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/Appraisals CHANGED
@@ -31,7 +31,7 @@ appraise 'sidekiq-6.x' do
31
31
  gem 'sidekiq', '~> 6.0'
32
32
  end
33
33
 
34
- appraise 'sidekiq-head' do
34
+ appraise 'sidekiq-latest' do
35
35
  gem 'rack', '>= 2', github: 'rack/rack'
36
36
  gem 'redis', '>= 4', github: 'redis/redis-rb'
37
37
  gem 'sidekiq', '>= 6', github: 'mperham/sidekiq'
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
- [![Build Status](https://travis-ci.org/Strech/sidekiq-prometheus-exporter.svg?branch=master)](https://travis-ci.org/Strech/sidekiq-prometheus-exporter)
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
@@ -11,6 +11,8 @@ require 'English'
11
11
  require 'fileutils'
12
12
  require_relative 'lib/sidekiq/prometheus/exporter/version'
13
13
 
14
+ VERSION = Sidekiq::Prometheus::Exporter::VERSION
15
+
14
16
  def execute(command)
15
17
  output = `#{command}`
16
18
 
@@ -23,43 +25,49 @@ def execute(command)
23
25
  end
24
26
 
25
27
  namespace :docker do
26
- task :release do
27
- Rake::Task['docker:build'].invoke
28
- Rake::Task['docker:push'].invoke
28
+ desc "Release new Docker image strech/sidekiq-prometheus-exporter:#{VERSION} (latest)"
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)
29
34
  end
30
35
 
31
- task :build do
36
+ task :build, %i(version) do |_, args|
37
+ args.with_defaults(version: VERSION)
32
38
  image = 'strech/sidekiq-prometheus-exporter'
33
39
 
34
40
  Dir.chdir(File.expand_path('./docker')) do
35
- execute("docker build -t #{image}:#{Sidekiq::Prometheus::Exporter::VERSION} -t #{image}:latest .")
41
+ execute("docker build -t #{image}:#{args.version} -t #{image}:latest .")
36
42
  end
37
43
 
38
- puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{Sidekiq::Prometheus::Exporter::VERSION}, latest"
44
+ puts "Successfully built strech/sidekiq-prometheus-exporter and tagged #{args.version} (latest)"
39
45
  end
40
46
 
41
- task :push do
47
+ task :push, %i(version) do |_, args|
48
+ args.with_defaults(version: VERSION)
42
49
  image = 'strech/sidekiq-prometheus-exporter'
43
50
 
44
- execute("docker push #{image}:#{Sidekiq::Prometheus::Exporter::VERSION}")
51
+ execute("docker push #{image}:#{args.version}")
45
52
  execute("docker push #{image}:latest")
46
53
 
47
- puts "Successfully pushed strech/sidekiq-prometheus-exporter #{Sidekiq::Prometheus::Exporter::VERSION}, latest"
54
+ puts "Successfully pushed strech/sidekiq-prometheus-exporter:#{args.version} (latest)"
48
55
  end
49
56
  end
50
57
 
51
58
  namespace :helm do
52
59
  desc 'Generate new Helm repo index'
53
- task :generate do
60
+ task :generate, %i(patch) do |_, args|
61
+ version = [VERSION, args.patch].compact.join('-')
54
62
  archive_dir = File.expand_path("./tmp/archive-#{Time.now.to_i}")
55
63
 
56
64
  Rake::Task['helm:package'].invoke(archive_dir)
57
- Rake::Task['helm:index'].invoke(archive_dir)
65
+ Rake::Task['helm:index'].invoke(archive_dir, version)
58
66
 
59
67
  puts "New index generated: #{File.join(archive_dir, 'index.yaml')}"
60
68
  end
61
69
 
62
- task :package, [:directory] do |_, args|
70
+ task :package, %i(directory) do |_, args|
63
71
  chart_dir = File.expand_path('./helm/sidekiq-prometheus-exporter')
64
72
  archive_dir = args.fetch(:directory) { File.expand_path("./tmp/archive-#{Time.now.to_i}") }
65
73
 
@@ -68,9 +76,11 @@ namespace :helm do
68
76
  execute("helm package #{chart_dir} -d #{archive_dir}")
69
77
  end
70
78
 
71
- task :index, [:directory] do |_, args|
79
+ task :index, %i(directory version) do |_, args|
80
+ args.with_defaults(version: VERSION)
81
+
72
82
  Dir.chdir(args.fetch(:directory)) do
73
- url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{Sidekiq::Prometheus::Exporter::VERSION}"
83
+ url = "https://github.com/Strech/sidekiq-prometheus-exporter/releases/download/v#{args.version}"
74
84
 
75
85
  execute('git show gh-pages:index.yaml > existing-index.yaml')
76
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.5-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.13
7
+ ENV SIDEKIQ_VERSION 6.2.1
8
+ ENV REDIS_NAMESPACE_VERSION 1.8.1
9
+ ENV SIDEKIQ_PROMETHEUS_EXPORTER_VERSION 0.1.17
10
10
 
11
11
  RUN addgroup -S exporter \
12
12
  && adduser -s /bin/false -SDHg exporter exporter \