heartcheck 1.3.0 → 1.4.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
  SHA1:
3
- metadata.gz: e666364972b1ce6c0870fb04f3776741fa6ef036
4
- data.tar.gz: 25593711517ef4ab307911bdd632989a603c1f71
3
+ metadata.gz: 45a358d7f3a8864deb797ecb5639d0e4df274c66
4
+ data.tar.gz: 530d7ecd987f302e38b41395abe67bc9a4ffced3
5
5
  SHA512:
6
- metadata.gz: 46409b36ce917552188ff52ee01a318c20f574f5009d76bdbea2becfd0bf9a474e7be3b92c5f001a87ad66000e248d0e7c667ec643d4facd8855b7efd620ce34
7
- data.tar.gz: 0c92c86fb761879239595a79c75962bc93c7a1c6178b8c43224ef1d16b6ee8a9e3d85229226ad8cd8d7ee542e039b4146a61d4155740feffab880a5dee9a4c2d
6
+ metadata.gz: 55db326b56112e68f33b488d27bab4dd1d0442aae29f88a2c8f3dfe28e96fdfaadd0dd9e4b01dbaf9f915495cf7fcbe6b7133af1d73c4b662344d9507f1e1c71
7
+ data.tar.gz: 2d54d671c2944e925d935e7cc3bd6f7db53c0c1d3f2d10b4bc013dd03fbcc100ad60de6b8789a136449ebc4b1a032ca36e5af5718cce2bfd84b49d67f1dd7a46
@@ -0,0 +1,3 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  = Heart Check - Changelog
2
2
 
3
+ == Version 1.4.0 :: 2017-12-27
4
+
5
+ * Adds property `doc_url` to Checks::Base to provide more details about the
6
+ failure
7
+
3
8
  == Version 1.3.0 :: 2017-09-21
4
9
 
5
10
  * Adds the `/environment` endpoint
data/README.md CHANGED
@@ -7,6 +7,7 @@ service, an API, etc.
7
7
 
8
8
  [![Build Status](https://travis-ci.org/locaweb/heartcheck.svg)](https://travis-ci.org/locaweb/heartcheck)
9
9
  [![Code Climate](https://codeclimate.com/github/locaweb/heartcheck/badges/gpa.svg)](https://codeclimate.com/github/locaweb/heartcheck)
10
+ [![Ebert](https://ebertapp.io/github/locaweb/heartcheck.svg)](https://ebertapp.io/github/locaweb/heartcheck)
10
11
 
11
12
  ## Installation
12
13
 
@@ -30,6 +30,13 @@ module Heartcheck
30
30
  # @return [Integer] (default: 0)
31
31
  attr_accessor :timeout
32
32
 
33
+ # An url to provide more info about the check.
34
+ # It is important to provide details about the failure, for example:
35
+ # - what is the impact
36
+ # - how to fix it
37
+ # - how to reproduce the failure
38
+ # @return [String] (default: nil)
39
+ attr_accessor :doc_url
33
40
 
34
41
  # Create a new instance and set the default values.
35
42
  #
@@ -188,7 +195,11 @@ module Heartcheck
188
195
  # @return [Hash]
189
196
  def format_error
190
197
  lambda do |error|
191
- error.is_a?(Hash) ? error : { type: 'error', message: error }
198
+ if error.is_a?(Hash)
199
+ error
200
+ else
201
+ { type: 'error', message: error, doc_url: doc_url }
202
+ end
192
203
  end
193
204
  end
194
205
  end
@@ -14,6 +14,8 @@ Heartcheck.setup do |monitor|
14
14
  # For each check you can set the folling options
15
15
  # name: String => root name to show in report page (default: class.name)
16
16
  # functional: Boolean => When is false your check is essential to your application (default: false)
17
+ # doc_url: String => To provide more details about the failure (optional)
18
+ # (default: nil)
17
19
  # on_error: Block => to customize the errors (default: nil)
18
20
  # to_validate: Block => to validate the sevices (default: nil)
19
21
  #
@@ -23,6 +25,7 @@ Heartcheck.setup do |monitor|
23
25
  # c.name = "filesystem"
24
26
  # c.functional = true
25
27
  # c.add_service(name: "my_file", path: "/var/www/my_project/my_file")
28
+ # c.doc_url = 'http://docs.com/monitoring#check-filesystem'
26
29
  #
27
30
  # c.on_error do |sevices|
28
31
  # errors << "Custom error message for #{service[:name]}"
@@ -1,3 +1,3 @@
1
1
  module Heartcheck
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heartcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Locaweb
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -212,6 +212,7 @@ executables:
212
212
  extensions: []
213
213
  extra_rdoc_files: []
214
214
  files:
215
+ - ".ebert.yml"
215
216
  - ".gitignore"
216
217
  - ".rspec"
217
218
  - ".rubocop.yml"
@@ -275,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
276
  version: '0'
276
277
  requirements: []
277
278
  rubyforge_project:
278
- rubygems_version: 2.5.2
279
+ rubygems_version: 2.6.13
279
280
  signing_key:
280
281
  specification_version: 4
281
282
  summary: A simple way to check if your app is runnig like as expected.