sidekiq_prometheus 1.0.1 → 1.1.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: b08d553beac07f3ba8f1646a28d2c8b37cb3311a2b49bf271223c0ac65adffb9
4
- data.tar.gz: 9c96177a48705863a43fad3a06299980510d1ccb5c67e8ee6f11f8e1548c80dc
3
+ metadata.gz: 533328fbd15652e9ffdc91457329eff4680f0a897b312343f9a3bea92c22795f
4
+ data.tar.gz: 3fa2b8614e19dd00baebd3387ddebfd52492901016a9a3ec6edb70a19d013716
5
5
  SHA512:
6
- metadata.gz: b25faa7040460950ad4bd595e31a10f426e013e7b8682e7aa32430d2b991b3f792c3bbdbd2775c8095111aa1031920606f53dde35df3aad8d2c012dcda2c890e
7
- data.tar.gz: d5dd5b43d083da3db316a67541342348c682491e48e5a94112964b28641fd2509cf25b5903bbc9e31d1d2ac1bbad0aa0811ba0f95fadc64b40aea7dafe012f92
6
+ metadata.gz: e0e51ed626201c49c023e914bbb5676d158f5e6cad2369a0b9b2b1fd8506d2190b6b905de1e34d7d39a4d2ce211feeb4ae005c42bdc63fda94e942bbe5dc4540
7
+ data.tar.gz: 67c7663c062de7105d921818b499c5bf0e8e6b2c4109b5d08ea513f94c526967dea885185782a3f2895ca22b569798b2fc1e993041f2fc8ff6f8c53dc142168e
data/README.md CHANGED
@@ -81,6 +81,8 @@ 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_host`: Host on which the rack server will listen. Defaults to
85
+ `localhost`
84
86
  * `metrics_port`: Port on which the rack server will listen. Defaults to `9359`
85
87
  * `registry`: An instance of `Prometheus::Client::Registry`. If you have a registry with defined metrics you can use this option to pass in your registry.
86
88
 
@@ -267,3 +269,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
267
269
  ## Code of Conduct
268
270
 
269
271
  Everyone interacting in the SidekiqPrometheus project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fastly/sidekiq-prometheus/blob/master/CODE_OF_CONDUCT.md).
272
+
273
+ # Metadata
274
+
275
+ - Ignore
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPrometheus
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -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 [String] Host on which the metrics server will listen. Default: localhost
51
+ attr_accessor :metrics_host
52
+
50
53
  # @return [Integer] Port on which the metrics server will listen. Default: 9357
51
54
  attr_accessor :metrics_port
52
55
 
@@ -66,6 +69,7 @@ module SidekiqPrometheus
66
69
  self.periodic_metrics_enabled = true
67
70
  self.global_metrics_enabled = true
68
71
  self.periodic_reporting_interval = 30
72
+ self.metrics_host = 'localhost'
69
73
  self.metrics_port = 9359
70
74
  self.custom_labels = {}
71
75
  self.custom_metrics = []
@@ -179,7 +183,8 @@ module SidekiqPrometheus
179
183
 
180
184
  ##
181
185
  # Start a new Prometheus exporter in a new thread.
182
- # Will listen on SidekiqPrometheus.metrics_port
186
+ # Will listen on SidekiqPrometheus.metrics_host and
187
+ # SidekiqPrometheus.metrics_port
183
188
  def metrics_server
184
189
  @_metrics_server ||= Thread.new do
185
190
  Rack::Handler::WEBrick.run(
@@ -188,7 +193,7 @@ module SidekiqPrometheus
188
193
  run ->(_) { [301, { 'Location' => '/metrics' }, []] }
189
194
  },
190
195
  Port: SidekiqPrometheus.metrics_port,
191
- BindAddress: '127.0.0.1',
196
+ Host: SidekiqPrometheus.metrics_host,
192
197
  )
193
198
  end
194
199
  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', '~> 0.10.0'
30
+ spec.add_runtime_dependency 'prometheus-client', '~> 1.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.0.1
4
+ version: 1.1.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: 2019-10-30 00:00:00.000000000 Z
12
+ date: 2020-02-12 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: 0.10.0
90
+ version: '1.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: 0.10.0
97
+ version: '1.0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rack
100
100
  requirement: !ruby/object:Gem::Requirement