sidekiq-prometheus-exporter 0.1.9 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +12 -0
  3. data/.gitignore +3 -1
  4. data/.rubocop.yml +28 -28
  5. data/.travis.yml +76 -14
  6. data/Appraisals +17 -4
  7. data/README.md +121 -28
  8. data/Rakefile +73 -0
  9. data/docker/Dockerfile +24 -0
  10. data/docker/README.md +55 -0
  11. data/docker/config.ru +38 -0
  12. data/examples/docker-compose.yml +2 -2
  13. data/examples/screenshot.png +0 -0
  14. data/examples/{sidekiq.json → sidekiq-dashboard.grafana-6.json} +10 -52
  15. data/examples/sidekiq-dashboard.grafana-7.json +845 -0
  16. data/gemfiles/sidekiq_3.3.1.gemfile +2 -1
  17. data/gemfiles/sidekiq_3.3.1.gemfile.lock +49 -48
  18. data/gemfiles/sidekiq_3.x.gemfile +2 -1
  19. data/gemfiles/sidekiq_3.x.gemfile.lock +47 -46
  20. data/gemfiles/sidekiq_4.x.gemfile +1 -1
  21. data/gemfiles/sidekiq_4.x.gemfile.lock +38 -38
  22. data/gemfiles/sidekiq_5.x.gemfile +1 -1
  23. data/gemfiles/sidekiq_5.x.gemfile.lock +40 -39
  24. data/gemfiles/sidekiq_6.x.gemfile +8 -0
  25. data/gemfiles/sidekiq_6.x.gemfile.lock +100 -0
  26. data/gemfiles/sidekiq_head.gemfile +9 -0
  27. data/gemfiles/sidekiq_head.gemfile.lock +116 -0
  28. data/helm/sidekiq-prometheus-exporter/.helmignore +22 -0
  29. data/helm/sidekiq-prometheus-exporter/Chart.yaml +6 -0
  30. data/helm/sidekiq-prometheus-exporter/README.md +87 -0
  31. data/helm/sidekiq-prometheus-exporter/templates/NOTES.txt +15 -0
  32. data/helm/sidekiq-prometheus-exporter/templates/_helpers.tpl +109 -0
  33. data/helm/sidekiq-prometheus-exporter/templates/clusterrole.yaml +20 -0
  34. data/helm/sidekiq-prometheus-exporter/templates/clusterrolebinding.yaml +17 -0
  35. data/helm/sidekiq-prometheus-exporter/templates/deployment.yaml +62 -0
  36. data/helm/sidekiq-prometheus-exporter/templates/service.yaml +17 -0
  37. data/helm/sidekiq-prometheus-exporter/templates/serviceaccount.yaml +9 -0
  38. data/helm/sidekiq-prometheus-exporter/templates/servicemonitor.yaml +26 -0
  39. data/helm/sidekiq-prometheus-exporter/values.yaml +133 -0
  40. data/lib/sidekiq/prometheus/exporter.rb +12 -1
  41. data/lib/sidekiq/prometheus/exporter/exporters.rb +5 -1
  42. data/lib/sidekiq/prometheus/exporter/scheduler.rb +48 -0
  43. data/lib/sidekiq/prometheus/exporter/standard.rb +1 -1
  44. data/lib/sidekiq/prometheus/exporter/templates/scheduler.erb +12 -0
  45. data/lib/sidekiq/prometheus/exporter/templates/standard.erb +5 -5
  46. data/lib/sidekiq/prometheus/exporter/version.rb +1 -1
  47. data/sidekiq-prometheus-exporter.gemspec +4 -4
  48. metadata +38 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e8500379e8abe15f6eb9680233e4a5c29367814f
4
- data.tar.gz: 024d07a212ce61766c3d9753d5e30d23eefea448
2
+ SHA256:
3
+ metadata.gz: b765e7d2573199042fcb0bc816c07797ddc7cd629a8491df3eee217f09282883
4
+ data.tar.gz: 7db77dd139a068968b55a79c1cdf57f9bbb7684f739ad95044cfd6fd4cf22389
5
5
  SHA512:
6
- metadata.gz: e38cf453e888f26bd19e8eef17d1f2dd1187ad4dd790425c1dcbfe309a4c4efb0b207341bd23b364dba5dd6fced3967e00d73ade5f0cc88ceaceaf211438ee73
7
- data.tar.gz: 19d8fd0bcafc80ff5c032391bd80eb4a92b8427911153fef16a05f03b7d68959b801182e4a2c1841174e356c1c13aefe46987fe12d901e1d0c8528a3196a347a
6
+ metadata.gz: 6c83d7afd3fcf1a0dfe16bc9bc35f05ad84bad8a46656d4af313c309427682f6e4347f912c3f0daeb7594d12fc9914f9e2e4f5452a4925643eebe81224e2e736
7
+ data.tar.gz: 3be26fb67085e9dbebcd9eb9a377feb24acfbb075e1a67eebdf550ffa8e5c54716398e254fbf6cee9b4c92cf2b814bd1951dc13f9c13ded4c27c054020cc3828
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [Strech]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: strech
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: ['https://paypal.me/onistrech/eur5.0']
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- /.bundle/
2
1
  /.yardoc
3
2
  /_yardoc/
4
3
  /coverage/
@@ -9,6 +8,9 @@
9
8
  /Gemfile.lock
10
9
  /.ruby-version
11
10
 
11
+ # Global ignore of bundler config
12
+ .bundle/
13
+
12
14
  # rspec failure tracking
13
15
  .rspec_status
14
16
 
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  require: rubocop-rspec
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.2
5
+ TargetRubyVersion: ~
6
6
 
7
7
  Style/Alias:
8
8
  EnforcedStyle: prefer_alias_method
@@ -30,7 +30,7 @@ Style/Documentation:
30
30
  Enabled: false
31
31
 
32
32
  Style/FrozenStringLiteralComment:
33
- EnforcedStyle: when_needed
33
+ EnforcedStyle: always
34
34
  SupportedStyles:
35
35
  # `when_needed` will add the frozen string literal comment to files
36
36
  # only when the `TargetRubyVersion` is set to 2.3+.
@@ -89,25 +89,25 @@ Style/NumericPredicate:
89
89
  # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
90
90
  # false positives.
91
91
  Exclude:
92
- - 'spec/**/*'
92
+ - "spec/**/*"
93
93
 
94
94
  Style/MethodCalledOnDoEndBlock:
95
- Description: 'Avoid chaining a method call on a do...end block.'
96
- StyleGuide: '#single-line-blocks'
95
+ Description: "Avoid chaining a method call on a do...end block."
96
+ StyleGuide: "#single-line-blocks"
97
97
  Enabled: true
98
98
 
99
99
  Style/PercentLiteralDelimiters:
100
100
  PreferredDelimiters:
101
- '%': ()
102
- '%i': ()
103
- '%I': ()
104
- '%q': ()
105
- '%Q': ()
106
- '%r': '{}'
107
- '%s': ()
108
- '%w': ()
109
- '%W': ()
110
- '%x': '{}'
101
+ "%": ()
102
+ "%i": ()
103
+ "%I": ()
104
+ "%q": ()
105
+ "%Q": ()
106
+ "%r": "{}"
107
+ "%s": ()
108
+ "%w": ()
109
+ "%W": ()
110
+ "%x": "{}"
111
111
 
112
112
  Style/SpecialGlobalVars:
113
113
  EnforcedStyle: use_english_names
@@ -158,10 +158,10 @@ Style/TernaryParentheses:
158
158
 
159
159
  Naming/AccessorMethodName:
160
160
  Description: Check the naming of accessor methods for get_/set_.
161
- StyleGuide: '#accessor_mutator_method_names'
161
+ StyleGuide: "#accessor_mutator_method_names"
162
162
 
163
163
  # https://rubocop.readthedocs.io/en/latest/cops_naming/#naminguncommunicativemethodparamname
164
- Naming/UncommunicativeMethodParamName:
164
+ Naming/MethodParameterName:
165
165
  AllowedNames:
166
166
  - _
167
167
  - io
@@ -174,7 +174,11 @@ Naming/UncommunicativeMethodParamName:
174
174
 
175
175
  #################### Layout ####################################
176
176
 
177
- Layout/AlignParameters:
177
+ Layout/LineLength:
178
+ # Default: 80
179
+ Max: 120
180
+
181
+ Layout/ParameterAlignment:
178
182
  # Alignment of parameters in multi-line method calls.
179
183
  #
180
184
  # The `with_first_parameter` style aligns the following lines along the same
@@ -194,7 +198,7 @@ Layout/AlignParameters:
194
198
  - with_fixed_indentation
195
199
 
196
200
  # Checks the indentation of the first element in an array literal.
197
- Layout/IndentArray:
201
+ Layout/FirstArrayElementIndentation:
198
202
  # The value `special_inside_parentheses` means that array literals with
199
203
  # brackets that have their opening bracket on the same line as a surrounding
200
204
  # opening round parenthesis, shall have their first element indented relative
@@ -216,7 +220,7 @@ Layout/IndentArray:
216
220
  IndentationWidth: ~
217
221
 
218
222
  # Checks the indentation of the first key in a hash literal.
219
- Layout/IndentHash:
223
+ Layout/FirstHashElementIndentation:
220
224
  # The value `special_inside_parentheses` means that hash literals with braces
221
225
  # that have their opening brace on the same line as a surrounding opening
222
226
  # round parenthesis, shall have their first key indented relative to the
@@ -277,20 +281,16 @@ Layout/MultilineOperationIndentation:
277
281
 
278
282
  ##################### Metrics ##################################
279
283
 
280
- Metrics/LineLength:
281
- # Default: 80
282
- Max: 120
283
-
284
284
  Metrics/MethodLength:
285
285
  # Default: 10
286
286
  Max: 15
287
287
 
288
288
  Metrics/BlockLength:
289
289
  Exclude:
290
- - 'Rakefile'
291
- - '**/*.gemspec'
292
- - '**/*.rake'
293
- - 'spec/**/*.rb'
290
+ - "Rakefile"
291
+ - "**/*.gemspec"
292
+ - "**/*.rake"
293
+ - "spec/**/*.rb"
294
294
 
295
295
  ##################### Lint ##################################
296
296
 
data/.travis.yml CHANGED
@@ -1,23 +1,85 @@
1
- sudo: false
1
+ os: linux
2
+ dist: xenial
2
3
  language: ruby
3
4
  rvm:
4
- - 2.2.10
5
5
  - 2.3.8
6
- - 2.4.6
7
- - 2.5.5
8
- - 2.6.2
6
+ - 2.4.10
7
+ - 2.5.8
8
+ - 2.6.6
9
+ - 2.7.1
10
+ - ruby-head
11
+ notifications:
12
+ email: false
13
+
9
14
  gemfile:
10
15
  - gemfiles/sidekiq_3.3.1.gemfile
11
16
  - gemfiles/sidekiq_3.x.gemfile
12
17
  - gemfiles/sidekiq_4.x.gemfile
13
18
  - gemfiles/sidekiq_5.x.gemfile
14
- addons:
15
- code_climate:
16
- repo_token: $CODECLIMATE_REPO_TOKEN
17
- notifications:
18
- email: false
19
+ - gemfiles/sidekiq_6.x.gemfile
20
+ - gemfiles/sidekiq_head.gemfile
21
+
22
+ jobs:
23
+ include:
24
+ - rvm: "2.6.6"
25
+ gemfile: "gemfiles/sidekiq_5.x.gemfile"
26
+ env:
27
+ - CODECLIMATE_REPORT=true
28
+ exclude:
29
+ - rvm: "2.3.8"
30
+ gemfile: "gemfiles/sidekiq_6.x.gemfile"
31
+ - rvm: "2.4.10"
32
+ gemfile: "gemfiles/sidekiq_6.x.gemfile"
33
+ - rvm: "2.3.8"
34
+ gemfile: "gemfiles/sidekiq_head.gemfile"
35
+ - rvm: "2.4.10"
36
+ gemfile: "gemfiles/sidekiq_head.gemfile"
37
+ - rvm: "2.5.8"
38
+ gemfile: "gemfiles/sidekiq_head.gemfile"
39
+ - rvm: "2.6.6"
40
+ gemfile: "gemfiles/sidekiq_head.gemfile"
41
+ - rvm: "2.7.1"
42
+ gemfile: "gemfiles/sidekiq_head.gemfile"
43
+ allow_failures:
44
+ - rvm: "ruby-head"
45
+ gemfile: "gemfiles/sidekiq_3.3.1.gemfile"
46
+ - rvm: "ruby-head"
47
+ gemfile: "gemfiles/sidekiq_3.x.gemfile"
48
+ - rvm: "ruby-head"
49
+ gemfile: "gemfiles/sidekiq_4.x.gemfile"
50
+ - rvm: "ruby-head"
51
+ gemfile: "gemfiles/sidekiq_5.x.gemfile"
52
+ - rvm: "ruby-head"
53
+ gemfile: "gemfiles/sidekiq_6.x.gemfile"
54
+ - rvm: "ruby-head"
55
+ gemfile: "gemfiles/sidekiq_head.gemfile"
56
+
57
+ cache:
58
+ directories:
59
+ - ./vendor
60
+
61
+ env:
62
+ global:
63
+ - CC_TEST_REPORTER_ID=$CODECLIMATE_REPO_TOKEN
64
+
65
+ before_install:
66
+ - gem install bundler -v '~> 2.1'
67
+
68
+ before_script:
69
+ - if [ ! -f ./vendor/cc-test-reporter ]; then
70
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./vendor/cc-test-reporter;
71
+ chmod +x ./vendor/cc-test-reporter;
72
+ fi
73
+ - if [ ! -z "$CODECLIMATE_REPORT" ]; then
74
+ echo "Start recording Codeclimate test coverage";
75
+ ./vendor/cc-test-reporter before-build;
76
+ fi
77
+
78
+ script:
79
+ - bundle exec rake spec
19
80
 
20
- cache: bundler
21
- before_install: gem install bundler -v 1.16.5
22
- after_success: bundle exec codeclimate-test-reporter
23
- script: bundle exec rake spec
81
+ after_success:
82
+ - if [ ! -z "$CODECLIMATE_REPORT" ]; then
83
+ echo "Finish recording Codeclimate test coverage";
84
+ ./vendor/cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
85
+ fi
data/Appraisals CHANGED
@@ -1,6 +1,7 @@
1
1
  appraise 'sidekiq-3.3.1' do
2
2
  gem 'slim'
3
- gem 'redis', '>= 3.3.5'
3
+ gem 'redis', '~> 3.3'
4
+ gem 'redis-namespace', '< 1.7.0'
4
5
  gem 'sinatra'
5
6
  gem 'concurrent-ruby'
6
7
  gem 'sidekiq', '= 3.3.1'
@@ -8,18 +9,30 @@ end
8
9
 
9
10
  appraise 'sidekiq-3.x' do
10
11
  gem 'slim'
11
- gem 'redis', '>= 3.3.5'
12
+ gem 'redis', '~> 3.3'
13
+ gem 'redis-namespace', '< 1.7.0'
12
14
  gem 'sinatra'
13
15
  gem 'concurrent-ruby'
14
16
  gem 'sidekiq', '~> 3.0'
15
17
  end
16
18
 
17
19
  appraise 'sidekiq-4.x' do
18
- gem 'redis', '>= 3.3.5'
20
+ gem 'redis', '~> 3.3'
19
21
  gem 'sidekiq', '~> 4.0'
20
22
  end
21
23
 
22
24
  appraise 'sidekiq-5.x' do
23
- gem 'redis', '>= 3.3.5'
25
+ gem 'redis', '~> 3.3'
24
26
  gem 'sidekiq', '~> 5.0'
25
27
  end
28
+
29
+ appraise 'sidekiq-6.x' do
30
+ gem 'redis', '~> 4.1'
31
+ gem 'sidekiq', '~> 6.0'
32
+ end
33
+
34
+ appraise 'sidekiq-head' do
35
+ gem 'rack', '>= 2', github: 'rack/rack'
36
+ gem 'redis', '>= 4', github: 'redis/redis-rb'
37
+ gem 'sidekiq', '>= 6', github: 'mperham/sidekiq'
38
+ end
data/README.md CHANGED
@@ -10,56 +10,78 @@
10
10
 
11
11
  ![Grafana dashboard example](/examples/screenshot.png)
12
12
 
13
- Open [dashboard example file](/examples/sidekiq.json), then open `https://<your grafana-url>/dashboard/import` and paste the content of the file.
13
+ 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
14
 
15
15
  # Available metrics
16
16
 
17
- *(starting Sidekiq `v3.3.1`)*
17
+ _(starting Sidekiq `v3.3.1`)_
18
18
 
19
- ### Standard
19
+ ## Standard
20
20
 
21
- | Name | Type | Description |
22
- |-------------------------------------------|---------|-------------------------|
23
- | sidekiq_processed_jobs_total | counter | The total number of processed jobs
24
- | sidekiq_failed_jobs_total | counter | The total number of failed jobs
25
- | sidekiq_busy_workers | gauge | The number of workers performing the job
26
- | sidekiq_enqueued_jobs | gauge | The number of enqueued jobs
27
- | sidekiq_scheduled_jobs | gauge | The number of jobs scheduled for a future execution
28
- | sidekiq_retry_jobs | gauge | The number of jobs scheduled for the next try
29
- | sidekiq_dead_jobs | gauge | The number of jobs being dead
30
- | sidekiq_queue_latency_seconds | gauge | The amount of seconds between oldest job being pushed to the queue and current time (labels: `name`)
31
- | sidekiq_queue_max_processing_time_seconds | gauge | The amount of seconds between oldest job of the queue being executed and current time (labels: `name`)
32
- | sidekiq_queue_enqueued_jobs | gauge | The number of enqueued jobs in the queue (labels: `name`)
21
+ | Name | Type | Description |
22
+ | ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
23
+ | sidekiq_processed_jobs_total | counter | The total number of processed jobs |
24
+ | sidekiq_failed_jobs_total | counter | The total number of failed jobs |
25
+ | sidekiq_workers | gauge | The number of workers across all the processes |
26
+ | sidekiq_processes | gauge | The number of processes |
27
+ | sidekiq_busy_workers | gauge | The number of workers performing the job |
28
+ | sidekiq_enqueued_jobs | gauge | The number of enqueued jobs |
29
+ | sidekiq_scheduled_jobs | gauge | The number of jobs scheduled for a future execution |
30
+ | sidekiq_retry_jobs | gauge | The number of jobs scheduled for the next try |
31
+ | sidekiq_dead_jobs | gauge | The number of jobs being dead |
32
+ | sidekiq_queue_latency_seconds | gauge | The number of seconds between oldest job being pushed to the queue and current time (labels: `name`) |
33
+ | 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
+ | sidekiq_queue_enqueued_jobs | gauge | The number of enqueued jobs in the queue (labels: `name`) |
33
35
 
34
- ### [Cron](https://github.com/ondrejbartas/sidekiq-cron)
36
+ <details>
37
+ <summary>Click to expand for all available contribs</summary>
35
38
 
36
- | Name | Type | Description |
37
- |-------------------------------------------|---------|-------------------------|
38
- | sidekiq_cron_jobs | gauge | The number of cron jobs
39
+ ## [Scheduler](https://github.com/moove-it/sidekiq-scheduler)
40
+
41
+ | Name | Type | Description |
42
+ | --------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------- |
43
+ | sidekiq_scheduler_jobs | gauge | The number of recurring jobs |
44
+ | sidekiq_scheduler_enabled_jobs | gauge | The number of enabled recurring jobs |
45
+ | sidekiq_scheduler_time_since_last_run_minutes | gauge | The number of minutes since the last recurring job was executed and current time (labels: `name`) |
46
+
47
+ ## [Cron](https://github.com/ondrejbartas/sidekiq-cron)
48
+
49
+ | Name | Type | Description |
50
+ | ----------------- | ----- | ----------------------- |
51
+ | sidekiq_cron_jobs | gauge | The number of cron jobs |
52
+
53
+ </details>
54
+
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)
39
61
 
40
62
  # Installation
41
63
 
42
64
  Add this line to your application's Gemfile:
43
65
 
44
66
  ```ruby
45
- gem 'sidekiq-prometheus-exporter'
67
+ gem 'sidekiq-prometheus-exporter', '~> 0.1'
46
68
  ```
47
69
 
48
70
  And then execute:
49
71
 
50
- ```bash
72
+ ```console
51
73
  $ bundle
52
74
  ```
53
75
 
54
76
  Or install it yourself as:
55
77
 
56
- ```bash
78
+ ```console
57
79
  $ gem install sidekiq-prometheus-exporter -v '~> 0.1'
58
80
  ```
59
81
 
60
- # Rack application
82
+ ## Rack application
61
83
 
62
- For a fresh new application to expose metrics create `config.ru` file with
84
+ For a fresh new application to expose metrics create `config.ru` file with
63
85
  next code inside
64
86
 
65
87
  ```ruby
@@ -75,13 +97,37 @@ run Sidekiq::Prometheus::Exporter.to_app
75
97
 
76
98
  Use your favorite server to start it up, like this
77
99
 
78
- ```bash
100
+ ```console
79
101
  $ bundle exec rackup -p9292 -o0.0.0.0
80
102
  ```
81
103
 
82
104
  and then `curl https://0.0.0.0:9292/metrics`
83
105
 
84
- # Sidekiq Web (extream)
106
+ ## Rails application
107
+
108
+ When you have rails application, it's possible to mount exporter
109
+ as a rack application in your `routes.rb`
110
+
111
+ ```ruby
112
+ Rails.application.routes.draw do
113
+ # ... omitted ...
114
+
115
+ # For more information please check here
116
+ # https://api.rubyonrails.org/v5.1/classes/ActionDispatch/Routing/Mapper/Base.html#method-i-mount
117
+ require 'sidekiq/prometheus/exporter'
118
+ mount Sidekiq::Prometheus::Exporter => '/metrics'
119
+ end
120
+ ```
121
+
122
+ Use rails server from `bin` folder to start it up, like this
123
+
124
+ ```console
125
+ $ ./bin/rails s -p 9292 -b 0.0.0.0
126
+ ```
127
+
128
+ and then `curl https://0.0.0.0:9292/metrics`
129
+
130
+ ## Sidekiq Web (extream)
85
131
 
86
132
  If you are ok with metrics being exposed via Sidekiq web dashboard because
87
133
  you have it inside your private network or only Prometheus scraper will have access
@@ -96,7 +142,52 @@ Sidekiq::Web.register(Sidekiq::Prometheus::Exporter)
96
142
 
97
143
  and then `curl https://<your-sidekiq-web-uri>/metrics`
98
144
 
99
- # Sidekiq Contribs
145
+ ## Docker
146
+
147
+ If we are talking about isolation you can run already prepared official
148
+ 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)
150
+
151
+ ```bash
152
+ $ docker run -it --rm \
153
+ -p 9292:9292 \
154
+ -e REDIS_URL=redis://<your-redis-host>:6379/0 \
155
+ strech/sidekiq-prometheus-exporter
156
+ ```
157
+
158
+ and then `curl https://0.0.0.0:9292/metrics`
159
+
160
+ ## Helm
161
+
162
+ And finally the cloud solution _(who don't these days)_. Easy to install, easy
163
+ to use. A fully-functioning Helm-package based on official [Docker
164
+ image](https://hub.docker.com/r/strech/sidekiq-prometheus-exporter), comes with lots of [configuration
165
+ options](https://github.com/Strech/sidekiq-prometheus-exporter/blob/master/helm/sidekiq-prometheus-exporter/README.md)
166
+
167
+ ```console
168
+ $ helm repo add strech https://strech.github.io/sidekiq-prometheus-exporter
169
+ "strech" has been added to your repositories
170
+
171
+ $ helm install strech/sidekiq-prometheus-exporter --name sidekiq-metrics
172
+ ```
173
+
174
+ to `curl` your metrics, please follow the post-installation guide
175
+
176
+ # Tips&Tricks
177
+
178
+ If you want to see at the exporter startup time a banner about which exporters
179
+ are enabled add this call to your `config.ru` (but after exporter `configure` statement)
180
+
181
+ ```ruby
182
+ require 'sidekiq/prometheus/exporter'
183
+
184
+ puts Sidekiq::Prometheus::Exporter.banner
185
+ ```
186
+
187
+ :anger: if you don't see your banner try to output into `STDERR` instead of
188
+ `STDOUT`
189
+
190
+ ## Sidekiq Contribs
100
191
 
101
192
  By default we try to detect as many as possible [sidekiq contribs](https://github.com/mperham/sidekiq/wiki/Related-Projects)
102
193
  and add their metrics to the output.
@@ -116,7 +207,9 @@ Sidekiq::Prometheus::Exporter.configure do |config|
116
207
  end
117
208
  ```
118
209
 
119
- ## Contributing
210
+ :bulb: if you did't find the contrib you would like to see, don't hesitate to [open an issue](https://github.com/Strech/sidekiq-prometheus-exporter/issues/new) and describe what do you think we should export.
211
+
212
+ # Contributing
120
213
 
121
214
  Bug reports and pull requests to support earlier versions of Sidekiq are welcome on GitHub at https://github.com/Strech/sidekiq-prometheus-exporter/issues.
122
215