sidekiq_status_monitor 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -25
- data/lib/sidekiq_status_monitor/config.rb +10 -10
- data/lib/sidekiq_status_monitor/redis/redis_client_gem.rb +2 -2
- data/lib/sidekiq_status_monitor/redis/redis_gem.rb +2 -2
- data/lib/sidekiq_status_monitor/server.rb +1 -1
- data/lib/sidekiq_status_monitor/version.rb +1 -1
- data/lib/sidekiq_status_monitor.rb +3 -3
- metadata +30 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c41f2c9bc2ce7b5a377d49921da85454fe34f550caef7ee37c7d9c3a739fde3c
|
4
|
+
data.tar.gz: c319d55e81e666d2f3acfd6a36dda321a8803e729b8cfd83d957dfbf0f8d5292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f2758a49ba295e005dd5dd40ceba28ca7ac9c359d97edf3868ded252c6fe8326d81c5cc440f42a341c6e8cc25e0b2f09539937a0de64a607aff8cabd74f820
|
7
|
+
data.tar.gz: 6203778281a478136f3eb73835e5736ff43e7d6b9f1d03139d804a5aa5fc6e850df386f64c0d7358733d8f24e0a94ec5afef1ba09d059ab3e51c7c81e036a881
|
data/README.md
CHANGED
@@ -10,32 +10,9 @@ This library can be used to check sidekiq health outside kubernetes.
|
|
10
10
|
|
11
11
|
**How?**
|
12
12
|
|
13
|
-
|
13
|
+
An additional HTTP server is started during Sidekiq worker initialisation and on each request validates that the Sidekiq worker metrics look healthy.
|
14
14
|
|
15
|
-
|
16
|
-
this key gets expired by Redis an consequently the http server will return a 500 error.
|
17
|
-
|
18
|
-
This worker is responsible to requeue itself for the next liveness probe.
|
19
|
-
|
20
|
-
Each instance in kubernetes will be checked based on `ENV` variable `HOSTNAME` (kubernetes sets this for each replica/pod).
|
21
|
-
|
22
|
-
On initialization SidekiqStatusMonitor will asign to Sidekiq::Worker a queue with the current host and add this queue to the current instance queues to process.
|
23
|
-
|
24
|
-
example:
|
25
|
-
|
26
|
-
```
|
27
|
-
hostname: foo
|
28
|
-
Worker queue: sidekiq_status_monitor-foo
|
29
|
-
instance queues:
|
30
|
-
- sidekiq_status_monitor-foo
|
31
|
-
*- your queues
|
32
|
-
|
33
|
-
hostname: bar
|
34
|
-
Worker queue: sidekiq_status_monitor-bar
|
35
|
-
instance queues:
|
36
|
-
- sidekiq_status_monitor-bar
|
37
|
-
*- your queues
|
38
|
-
```
|
15
|
+
It reports either 200 or 500 HTTP code with additional JSON payload which includes metrics values.
|
39
16
|
|
40
17
|
## Installation
|
41
18
|
|
@@ -5,16 +5,16 @@ module SidekiqStatusMonitor
|
|
5
5
|
include Singleton
|
6
6
|
|
7
7
|
attr_accessor :host,
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
:port,
|
9
|
+
:path,
|
10
|
+
:server,
|
11
|
+
:logger,
|
12
|
+
:shutdown_callback,
|
13
|
+
:workers_size_threshold,
|
14
|
+
:process_set_size_threshold,
|
15
|
+
:queues_size_threshold,
|
16
|
+
:queue_latency_threshold,
|
17
|
+
:queue_size_threshold
|
18
18
|
|
19
19
|
def initialize
|
20
20
|
set_defaults
|
@@ -43,9 +43,9 @@ module SidekiqStatusMonitor
|
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
|
-
def redis(&
|
46
|
+
def redis(&)
|
47
47
|
# Default to Sidekiq.redis if capsule is not configured yet but redis adapter is accessed
|
48
|
-
(@capsule || Sidekiq).redis(&
|
48
|
+
(@capsule || Sidekiq).redis(&)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -101,8 +101,8 @@ module SidekiqStatusMonitor
|
|
101
101
|
queues.map(&:name).uniq.sort
|
102
102
|
end
|
103
103
|
|
104
|
-
def self.new_probe(name, &
|
105
|
-
define_method("#{PROBE_METHOD_PREFIX}#{name}", &
|
104
|
+
def self.new_probe(name, &)
|
105
|
+
define_method(:"#{PROBE_METHOD_PREFIX}#{name}", &)
|
106
106
|
end
|
107
107
|
|
108
108
|
new_probe :workers_size do
|
@@ -126,7 +126,7 @@ module SidekiqStatusMonitor
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def probes
|
129
|
-
methods.grep(/^#{PROBE_METHOD_PREFIX}/).map { |m| [m, send(m)] }.to_h
|
129
|
+
methods.grep(/^#{PROBE_METHOD_PREFIX}/o).map { |m| [m, send(m)] }.to_h
|
130
130
|
end
|
131
131
|
|
132
132
|
def alive?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq_status_monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrei Makarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,47 +95,61 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '4.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: solargraph
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.49.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.49.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: standard
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: '1'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: '1'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: standard-performance
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
132
|
-
type: :
|
131
|
+
version: '1'
|
132
|
+
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: standard-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.2'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '0.2'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: sidekiq
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,7 +220,7 @@ metadata:
|
|
206
220
|
homepage_uri: https://github.com/amkisko/sidekiq_status_monitor
|
207
221
|
source_code_uri: https://github.com/amkisko/sidekiq_status_monitor
|
208
222
|
changelog_uri: https://github.com/amkisko/sidekiq_status_monitor/releases
|
209
|
-
documentation_uri: https://github.com/amkisko/sidekiq_status_monitor/blob/v1.0
|
223
|
+
documentation_uri: https://github.com/amkisko/sidekiq_status_monitor/blob/v1.2.0/README.md
|
210
224
|
bug_tracker_uri: https://github.com/amkisko/sidekiq_status_monitor/issues
|
211
225
|
post_install_message:
|
212
226
|
rdoc_options: []
|
@@ -223,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
237
|
- !ruby/object:Gem::Version
|
224
238
|
version: '0'
|
225
239
|
requirements: []
|
226
|
-
rubygems_version: 3.
|
240
|
+
rubygems_version: 3.5.9
|
227
241
|
signing_key:
|
228
242
|
specification_version: 4
|
229
243
|
summary: Rack server that outputs HTTP JSON status of sidekiq instance for alive/liveness
|