sidekiq_prometheus 1.1.0 → 1.2.0

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: 533328fbd15652e9ffdc91457329eff4680f0a897b312343f9a3bea92c22795f
4
- data.tar.gz: 3fa2b8614e19dd00baebd3387ddebfd52492901016a9a3ec6edb70a19d013716
3
+ metadata.gz: 6cef078a53e6742cd0cea7140dbe65ab96849acc8886880f530cbe208ee8fefc
4
+ data.tar.gz: 63dc0623415214f85a2bcb0b37cfaef012a016bb75d430763d9bfa3ed097460a
5
5
  SHA512:
6
- metadata.gz: e0e51ed626201c49c023e914bbb5676d158f5e6cad2369a0b9b2b1fd8506d2190b6b905de1e34d7d39a4d2ce211feeb4ae005c42bdc63fda94e942bbe5dc4540
7
- data.tar.gz: 67c7663c062de7105d921818b499c5bf0e8e6b2c4109b5d08ea513f94c526967dea885185782a3f2895ca22b569798b2fc1e993041f2fc8ff6f8c53dc142168e
6
+ metadata.gz: 3721b3aaf34de0717d2d23639aeb2413fe5f9b9580ae1f07bcf333bcfae1d7c110425b1e0c850d06ba29459ca7506d06130322dd3ea1461e164c3264228628c0
7
+ data.tar.gz: cf08ac6f8f3779c3a8789063de3073e4838945cd4d6190b7284184c19bbd2ec2f156143502a160f9b9a91fb11bb644ca2f43e20aa11533313f4ada60d80a2a21
@@ -1,5 +1,32 @@
1
1
  CHANGELOG
2
2
 
3
+ <a name="v1.2.0"></a>
4
+ ## [v1.2.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.1.0...v1.2.0) (2020-10-01)
5
+
6
+ ### Feature
7
+
8
+ * allow the metrics host to be disabled with a configuration option
9
+ * use prometheus-client ~> 2.0
10
+
11
+ ### Pull Requests
12
+
13
+ * Merge pull request [#17](https://github.com/fastly/sidekiq-prometheus/issues/17) from jetpks/add-option-to-disable-metrics-server
14
+ * Merge pull request [#15](https://github.com/fastly/sidekiq-prometheus/issues/15) from silicakes/master
15
+
16
+ <a name="v1.1.0"></a>
17
+ ## [v1.1.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.0.1...v1.1.0) (2020-02-12)
18
+
19
+ ### Feature
20
+
21
+ * allow for configuration of the metrics host (instead of always binding to 127.0.0.1)
22
+ * Use prometheus-client ~> 1.0.0
23
+
24
+ ### Pull Requests
25
+
26
+ * Merge pull request [#13](https://github.com/fastly/sidekiq-prometheus/issues/13) from postmodern/metrics_host
27
+ * Merge pull request [#11](https://github.com/fastly/sidekiq-prometheus/issues/11) from rossjones/patch-1
28
+ * Merge pull request [#12](https://github.com/fastly/sidekiq-prometheus/issues/12) from fastly/hr
29
+
3
30
  <a name="v1.0.0"></a>
4
31
  ## [v1.0.0](https://github.com/fastly/sidekiq-prometheus/compare/v0.9.1...v1.0.0) (2019-10-24)
5
32
 
data/README.md CHANGED
@@ -81,6 +81,7 @@ end
81
81
  * `global_metrics_enabled`: Boolean that determines whether to report global metrics from the PeriodicMetrics reporter. When `true` this will report on a number of stats from the Sidekiq API for the cluster. This requires Sidekiq::Enterprise as the reporter uses the leader election functionality to ensure that only one worker per cluster is reporting metrics.
82
82
  * `periodic_metrics_enabled`: Boolean that determines whether to run the periodic metrics reporter. `PeriodicMetrics` runs a separate thread that reports on global metrics (if enabled) as well worker GC stats (if enabled). It reports metrics on the interval defined by `periodic_reporting_interval`. Defaults to `true`.
83
83
  * `periodic_reporting_interval`: interval in seconds for reporting periodic metrics. Default: `30`
84
+ * `metrics_server_enabled`: Boolean that determines whether to run the rack server. Defaults to `true`
84
85
  * `metrics_host`: Host on which the rack server will listen. Defaults to
85
86
  `localhost`
86
87
  * `metrics_port`: Port on which the rack server will listen. Defaults to `9359`
@@ -94,6 +95,7 @@ SidekiqPrometheus.configure do |config|
94
95
  config.global_metrics_enabled = true
95
96
  config.periodic_metrics_enabled = true
96
97
  config.periodic_reporting_interval = 20
98
+ config.metrics_server_enabled = true
97
99
  config.metrics_port = 8675
98
100
  end
99
101
  ```
@@ -245,7 +247,7 @@ See the [documentation of the Prometheus::Client library](https://github.com/pro
245
247
 
246
248
  ## Development
247
249
 
248
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
250
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
249
251
 
250
252
  To install this gem onto your local machine, run `bundle exec rake install`.
251
253
 
@@ -253,6 +255,8 @@ To install this gem onto your local machine, run `bundle exec rake install`.
253
255
 
254
256
  * Lukas Eklund ([@leklund](https://github.com/leklund))
255
257
  * NHM Tanveer Hossain Khan ([@we4tech](https://github.com/we4tech))
258
+ * [@Postmodern](https://github.com/postmodern)
259
+ * Ross Jones ([@rossjones](https://github.com/rossjones))
256
260
 
257
261
  ## Contributing
258
262
 
@@ -47,6 +47,9 @@ module SidekiqPrometheus
47
47
  # @return [Integer] Interval in seconds to record metrics. Default: 30
48
48
  attr_accessor :periodic_reporting_interval
49
49
 
50
+ # @return [Boolean] Setting to control enabling/disabling the metrics server. Default: true
51
+ attr_accessor :metrics_server_enabled
52
+
50
53
  # @return [String] Host on which the metrics server will listen. Default: localhost
51
54
  attr_accessor :metrics_host
52
55
 
@@ -69,6 +72,7 @@ module SidekiqPrometheus
69
72
  self.periodic_metrics_enabled = true
70
73
  self.global_metrics_enabled = true
71
74
  self.periodic_reporting_interval = 30
75
+ self.metrics_server_enabled = true
72
76
  self.metrics_host = 'localhost'
73
77
  self.metrics_port = 9359
74
78
  self.custom_labels = {}
@@ -117,6 +121,13 @@ module SidekiqPrometheus
117
121
  periodic_metrics_enabled
118
122
  end
119
123
 
124
+ ##
125
+ # Helper method for +metrics_server_enabled+ configuration setting
126
+ # @return [Boolean] defaults to true
127
+ def metrics_server_enabled?
128
+ metrics_server_enabled
129
+ end
130
+
120
131
  ##
121
132
  # Get a metric from the registry
122
133
  # @param metric [Symbol] name of metric to fetch
@@ -176,8 +187,10 @@ module SidekiqPrometheus
176
187
  config.on(:shutdown) { SidekiqPrometheus::PeriodicMetrics.reporter.stop }
177
188
  end
178
189
 
179
- config.on(:startup) { SidekiqPrometheus.metrics_server }
180
- config.on(:shutdown) { SidekiqPrometheus.metrics_server.kill }
190
+ if metrics_server_enabled?
191
+ config.on(:startup) { SidekiqPrometheus.metrics_server }
192
+ config.on(:shutdown) { SidekiqPrometheus.metrics_server.kill }
193
+ end
181
194
  end
182
195
  end
183
196
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPrometheus
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'rubocop', '~> 0.58.0'
29
29
 
30
- spec.add_runtime_dependency 'prometheus-client', '~> 1.0'
30
+ spec.add_runtime_dependency 'prometheus-client', '~> 2.0'
31
31
  spec.add_runtime_dependency 'rack'
32
32
  spec.add_runtime_dependency 'sidekiq', '> 5.1'
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Eklund
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-02-12 00:00:00.000000000 Z
12
+ date: 2020-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '1.0'
90
+ version: '2.0'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '1.0'
97
+ version: '2.0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rack
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -168,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.7.8
171
+ rubygems_version: 3.0.6
173
172
  signing_key:
174
173
  specification_version: 4
175
174
  summary: Prometheus Instrumentation for Sidekiq