health-monitor-rails 4.0.0 → 4.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e07e9ec009cc55289847199895a4e5903f22aab
|
4
|
+
data.tar.gz: bac79d5289d3a3b3face3e099cf86aff8eb27939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e525a97881e6425295849b551073ec675114a09af0bb78bf0b14cbd1b8cf130b36a067826e81cba53b90965a8982092ecba5fecaf5a09688030fa41abe762d5e
|
7
|
+
data.tar.gz: 008ba5f5af98f6faf02db9535a7d4d0e028b3cc71615d9c2a77492c3fd0ddd3d2e8a5a0d1f1b5d880d76156be340533dc26720589cd739f7fcbc4d7508a0fad0
|
data/README.md
CHANGED
@@ -122,6 +122,18 @@ HealthMonitor.configure do |config|
|
|
122
122
|
end
|
123
123
|
```
|
124
124
|
|
125
|
+
### Adding environmet variables
|
126
|
+
By default, environmet variables is nil, you need to provide a Hash with your custom environmet variables:
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
HealthMonitor.configure do |config|
|
130
|
+
config.environmet_variables = {
|
131
|
+
build_number: 'BUILD_NUMBER',
|
132
|
+
git_sha: 'GIT_SHA'
|
133
|
+
}
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
125
137
|
## License
|
126
138
|
|
127
139
|
The MIT License (MIT)
|
@@ -10,6 +10,11 @@ module HealthMonitor
|
|
10
10
|
def check
|
11
11
|
res = HealthMonitor.check(request: request)
|
12
12
|
|
13
|
+
unless HealthMonitor.configuration.environmet_variables.nil?
|
14
|
+
env_vars = [environmet_variables: HealthMonitor.configuration.environmet_variables]
|
15
|
+
res[:results] = env_vars + res[:results]
|
16
|
+
end
|
17
|
+
|
13
18
|
self.content_type = Mime::JSON
|
14
19
|
self.status = res[:status]
|
15
20
|
self.response_body = ActiveSupport::JSON.encode(res[:results])
|
@@ -2,7 +2,7 @@ module HealthMonitor
|
|
2
2
|
class Configuration
|
3
3
|
PROVIDERS = [:cache, :database, :redis, :resque, :sidekiq].freeze
|
4
4
|
|
5
|
-
attr_accessor :error_callback, :basic_auth_credentials
|
5
|
+
attr_accessor :error_callback, :basic_auth_credentials, :environmet_variables
|
6
6
|
attr_reader :providers
|
7
7
|
|
8
8
|
def initialize
|
@@ -7,7 +7,7 @@ module HealthMonitor
|
|
7
7
|
|
8
8
|
class Sidekiq < Base
|
9
9
|
class Configuration
|
10
|
-
DEFAULT_LATENCY_TIMEOUT = 30
|
10
|
+
DEFAULT_LATENCY_TIMEOUT = 30
|
11
11
|
|
12
12
|
attr_accessor :latency
|
13
13
|
|
@@ -26,8 +26,12 @@ module HealthMonitor
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
class << self
|
30
|
+
private
|
31
|
+
|
32
|
+
def configuration_class
|
33
|
+
Configuration
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
def check_workers!
|
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.
|
4
|
+
version: 4.1.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: 2016-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -235,10 +235,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.4.
|
238
|
+
rubygems_version: 2.4.6
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Health monitoring Rails plug-in, which checks various services (db, cache,
|
242
242
|
sidekiq, redis, etc.)
|
243
243
|
test_files: []
|
244
|
-
has_rdoc:
|