health-monitor-rails 9.4.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -3
- data/lib/health_monitor/providers/database.rb +9 -2
- data/lib/health_monitor/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0502db2e6a54cf73defc3f9333fe3a157c79d8b5b2a4122fd65b6f54c48c76c5
|
4
|
+
data.tar.gz: 1b1a0591c7660abf3d38f8b0dd5c21761125f5a9da46bfc3283b2a46f49d40a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7cd0673bf3c88b9ba7e146c171aee8a98630205b65b1603e1ed39b161bb288cd76a0875ea977725a30bf8914adb4a60232d71be6882e7c865239c364931af2
|
7
|
+
data.tar.gz: bb1e311ee5dabda3fa4c1bd141467caf1c7469ba1c1873189e5f3c165ad8c7387c930ccdb94122fcce6d54359a7ae84dea58d3f200b1ce14a51616030589fb9f
|
data/README.md
CHANGED
@@ -214,7 +214,7 @@ HealthMonitor.configure do |config|
|
|
214
214
|
end
|
215
215
|
end
|
216
216
|
|
217
|
-
#
|
217
|
+
# Sidekiq with specific queues
|
218
218
|
HealthMonitor.configure do |config|
|
219
219
|
config.sidekiq.configure do |sidekiq_config|
|
220
220
|
sidekiq_config.add_queue_configuration('critical', latency: 10.seconds, queue_size: 20)
|
@@ -224,7 +224,7 @@ end
|
|
224
224
|
```
|
225
225
|
|
226
226
|
```ruby
|
227
|
-
# Redis
|
227
|
+
# Redis with existing connection
|
228
228
|
HealthMonitor.configure do |config|
|
229
229
|
config.redis.configure do |redis_config|
|
230
230
|
redis_config.connection = Redis.current # Use your custom redis connection
|
@@ -236,7 +236,7 @@ end
|
|
236
236
|
Additionally, you can configure an explicit URL:
|
237
237
|
|
238
238
|
```ruby
|
239
|
-
# Redis
|
239
|
+
# Redis with a URL configuration
|
240
240
|
HealthMonitor.configure do |config|
|
241
241
|
config.redis.configure do |redis_config|
|
242
242
|
redis_config.url = 'redis://user:pass@example.redis.com:90210/'
|
@@ -245,12 +245,25 @@ HealthMonitor.configure do |config|
|
|
245
245
|
end
|
246
246
|
```
|
247
247
|
|
248
|
+
Or via a connection pool:
|
249
|
+
|
250
|
+
```ruby
|
251
|
+
# Redis using Connection Pools
|
252
|
+
HealthMonitor.configure do |config|
|
253
|
+
config.redis.configure do |redis_config|
|
254
|
+
redis_config.connection = ConnectionPool.new(size: 5) { Redis.new } # Use your custom connection pool
|
255
|
+
end
|
256
|
+
end
|
257
|
+
```
|
258
|
+
|
248
259
|
The currently supported settings are:
|
249
260
|
|
250
261
|
#### Sidekiq
|
251
262
|
|
252
263
|
* `latency`: the latency (in seconds) of a queue (now - when the oldest job was enqueued) which is considered unhealthy (the default is 30 seconds, but larger processing queue should have a larger latency value).
|
253
264
|
* `queue_size`: the size (maximum) of a queue which is considered unhealthy (the default is 100).
|
265
|
+
* `default_queue`: the default queue to check.
|
266
|
+
* `add_queue_configuration`: add specific configuration per queue.
|
254
267
|
|
255
268
|
#### Redis
|
256
269
|
|
@@ -8,8 +8,15 @@ module HealthMonitor
|
|
8
8
|
|
9
9
|
class Database < Base
|
10
10
|
def check!
|
11
|
-
|
12
|
-
|
11
|
+
failed_databases = []
|
12
|
+
|
13
|
+
ActiveRecord::Base.connection_handler.all_connection_pools.each do |cp|
|
14
|
+
cp.connection.check_version
|
15
|
+
rescue Exception
|
16
|
+
failed_databases << cp.db_config.name
|
17
|
+
end
|
18
|
+
|
19
|
+
raise "unable to connect to: #{failed_databases.uniq.join(',')}" unless failed_databases.empty?
|
13
20
|
rescue Exception => e
|
14
21
|
raise DatabaseException.new(e.message)
|
15
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health-monitor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonid Beder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: appraisal
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|