http_health_check 0.3.0 → 0.4.1
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/.bumpversion.cfg +1 -1
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +3 -1
- data/README.md +3 -3
- data/http_health_check.gemspec +1 -0
- data/lib/http_health_check/probes/delayed_job.rb +1 -0
- data/lib/http_health_check/utils/karafka.rb +28 -0
- data/lib/http_health_check/utils.rb +7 -0
- data/lib/http_health_check/version.rb +1 -1
- data/lib/http_health_check.rb +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbcda1b1c0dfb9f27c203567ceb3e903904200cf08b6b52cc89af26e34be8ab9
|
4
|
+
data.tar.gz: 026fe60fa05456d2cc14551964a2ff4057b010712bfbec84b67c0d171972eb9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3565af25d600fa7185f2d57d03132f81bc3b80e84f652fcb5c431bdba41eab42df4c1b6912ecacacafcf9d83c8551a67a0f3ab3191ec916563d98ae18e6e88
|
7
|
+
data.tar.gz: 49eec7ce633f4f3ef235acc8a23fb71d7029df2212fb9ab6fb4fdf505fa4e9265438089f74d16f22d0dbb88ea70625c771f2bb0929326994c4d337fa25da58fc
|
data/.bumpversion.cfg
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGELOG.md
|
2
2
|
|
3
|
+
## 0.4.1 (2022-08-05)
|
4
|
+
|
5
|
+
Fix:
|
6
|
+
|
7
|
+
- Fix DelayedJob probe [PR#2](https://github.com/SberMarket-Tech/http_health_check/pull/2)
|
8
|
+
|
9
|
+
## 0.4.0 (2022-07-20)
|
10
|
+
|
11
|
+
Features:
|
12
|
+
|
13
|
+
- add karafka consumer groups utility function
|
14
|
+
|
3
15
|
## 0.3.0 (2022-07-19)
|
4
16
|
|
5
17
|
Features:
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
http_health_check (0.
|
4
|
+
http_health_check (0.4.1)
|
5
5
|
rack (~> 2.0)
|
6
6
|
webrick
|
7
7
|
|
@@ -66,6 +66,7 @@ GEM
|
|
66
66
|
simplecov (~> 0.19)
|
67
67
|
simplecov-html (0.12.3)
|
68
68
|
simplecov_json_formatter (0.1.4)
|
69
|
+
thor (1.1.0)
|
69
70
|
thread_safe (0.3.6)
|
70
71
|
tzinfo (1.2.9)
|
71
72
|
thread_safe (~> 0.1)
|
@@ -88,6 +89,7 @@ DEPENDENCIES
|
|
88
89
|
rubocop (~> 0.81)
|
89
90
|
simplecov
|
90
91
|
simplecov-cobertura
|
92
|
+
thor (>= 0.20)
|
91
93
|
|
92
94
|
BUNDLED WITH
|
93
95
|
2.3.15
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ HttpHealthCheck is built with kubernetes health probes in mind, but it can be us
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'http_health_check', '~> 0.
|
14
|
+
gem 'http_health_check', '~> 0.4.1'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -68,7 +68,7 @@ HttpHealthCheck.run_server_async(
|
|
68
68
|
port: 5555,
|
69
69
|
rack_app: HttpHealthCheck::RackApp.configure do |c|
|
70
70
|
c.probe '/readiness/karafka', HttpHealthCheck::Probes::RubyKafka.new(
|
71
|
-
consumer_groups:
|
71
|
+
consumer_groups: HttpHealthCheck::Utils::Karafka.consumer_groups(KarafkaApp),
|
72
72
|
# default heartbeat interval is 3 seconds, but we want to give it
|
73
73
|
# an ability to skip a few before failing the probe
|
74
74
|
heartbeat_interval_sec: 10,
|
@@ -96,7 +96,7 @@ class KarafkaApp < Karafka::App
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
|
99
|
+
HttpHealthCheck::Utils::Karafka.consumer_groups(KarafkaApp)
|
100
100
|
# => ['foo', 'foo']
|
101
101
|
```
|
102
102
|
|
data/http_health_check.gemspec
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
|
5
|
+
module HttpHealthCheck
|
6
|
+
module Utils
|
7
|
+
module Karafka
|
8
|
+
# returns a list of consumer groups configured for current process
|
9
|
+
#
|
10
|
+
# @param karafka_app descendant of Karafka::App
|
11
|
+
def self.consumer_groups(karafka_app, program_name: $PROGRAM_NAME, argv: ARGV) # rubocop:disable Metrics/AbcSize
|
12
|
+
all_groups = karafka_app.consumer_groups.map(&:id)
|
13
|
+
client_id_prefix = karafka_app.config.client_id.gsub('-', '_') + '_'
|
14
|
+
|
15
|
+
return all_groups if program_name.split('/').last != 'karafka'
|
16
|
+
return all_groups if argv[0] != 'server'
|
17
|
+
|
18
|
+
parsed_option = Thor::Options.new(
|
19
|
+
consumer_groups: Thor::Option.new(:consumer_groups, type: :array, default: nil, aliases: :g)
|
20
|
+
).parse(argv).fetch('consumer_groups', []).first.to_s
|
21
|
+
return all_groups if parsed_option == ''
|
22
|
+
|
23
|
+
groups_from_option = parsed_option.split(' ').map { |g| client_id_prefix + g } & all_groups
|
24
|
+
groups_from_option.empty? ? all_groups : groups_from_option
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/http_health_check.rb
CHANGED
@@ -7,6 +7,7 @@ require_relative 'http_health_check/config/dsl'
|
|
7
7
|
require_relative 'http_health_check/probe'
|
8
8
|
require_relative 'http_health_check/rack_app'
|
9
9
|
require_relative 'http_health_check/probes'
|
10
|
+
require_relative 'http_health_check/utils'
|
10
11
|
|
11
12
|
module HttpHealthCheck
|
12
13
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_health_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SberMarket team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.81'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: thor
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.20'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.20'
|
111
125
|
description: Simple and extensible HTTP health checks server.
|
112
126
|
email:
|
113
127
|
- pochi.73@gmail.com
|
@@ -141,6 +155,8 @@ files:
|
|
141
155
|
- lib/http_health_check/probes/ruby_kafka.rb
|
142
156
|
- lib/http_health_check/probes/sidekiq.rb
|
143
157
|
- lib/http_health_check/rack_app.rb
|
158
|
+
- lib/http_health_check/utils.rb
|
159
|
+
- lib/http_health_check/utils/karafka.rb
|
144
160
|
- lib/http_health_check/version.rb
|
145
161
|
homepage: https://github.com/SberMarket-Tech/http_health_check
|
146
162
|
licenses:
|