config_skeleton 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config_skeleton.gemspec +1 -1
- data/lib/config_skeleton.rb +10 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f85f27d60f4dcaf253af5ecff4d6fcc6d851e5b54ad85d3f8cdf2bae4ac4a541
|
4
|
+
data.tar.gz: fa4ca080415307e4d44e19f12fc5799fc3b8b8f750eda72c7d543491cd37e7fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc6ad4e7c89e473d0902c44b160040da924943d3437310a2edb202a3bab246259f238691bbb81696cc7cf0f0bbe635444dab8add65d0d56790907014aa973293
|
7
|
+
data.tar.gz: 9659f0fd04bf6d2e89bc2d58ecc82dd741dd6b1f266d7ff36e621fcb0e5c3774e524c7b02187d90c699d7d2163412505bf55501e35c679d25f1f1f2dd590e755
|
data/config_skeleton.gemspec
CHANGED
data/lib/config_skeleton.rb
CHANGED
@@ -164,11 +164,12 @@ class ConfigSkeleton
|
|
164
164
|
end
|
165
165
|
|
166
166
|
def self.inherited(klass)
|
167
|
+
klass.gauge :"#{klass.service_name}_config_ok", docstring: "Whether the last config change was accepted by the server"
|
168
|
+
klass.gauge :"#{klass.service_name}_generation_ok", docstring: "Whether the last config generation completed without error"
|
167
169
|
klass.gauge :"#{klass.service_name}_last_generation_timestamp", docstring: "When the last config generation run was made"
|
168
170
|
klass.gauge :"#{klass.service_name}_last_change_timestamp", docstring: "When the config file was last written to"
|
169
171
|
klass.counter :"#{klass.service_name}_reload_total", docstring: "How many times we've asked the server to reload", labels: [:status]
|
170
172
|
klass.counter :"#{klass.service_name}_signals_total", docstring: "How many signals have been received (and handled)"
|
171
|
-
klass.gauge :"#{klass.service_name}_config_ok", docstring: "Whether the last config change was accepted by the server"
|
172
173
|
|
173
174
|
klass.hook_signal("HUP") do
|
174
175
|
logger.info("SIGHUP") { "received SIGHUP, triggering config regeneration" }
|
@@ -329,6 +330,7 @@ class ConfigSkeleton
|
|
329
330
|
metrics.last_generation_timestamp.set(0)
|
330
331
|
metrics.last_change_timestamp.set(0)
|
331
332
|
metrics.config_ok.set(0)
|
333
|
+
metrics.generation_ok.set(0)
|
332
334
|
end
|
333
335
|
|
334
336
|
# Write out a config file if one doesn't exist, or do an initial regen run
|
@@ -431,9 +433,15 @@ class ConfigSkeleton
|
|
431
433
|
#
|
432
434
|
def instrumented_config_data
|
433
435
|
begin
|
434
|
-
@config_generation.measure
|
436
|
+
@config_generation.measure do
|
437
|
+
config_data.tap do
|
438
|
+
metrics.last_generation_timestamp.set(Time.now.to_f)
|
439
|
+
metrics.generation_ok.set(1)
|
440
|
+
end
|
441
|
+
end
|
435
442
|
rescue => ex
|
436
443
|
log_exception(ex, logloc) { "Call to config_data raised exception" }
|
444
|
+
metrics.generation_ok.set(0)
|
437
445
|
nil
|
438
446
|
end
|
439
447
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_skeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diffy
|
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
216
|
- !ruby/object:Gem::Version
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
|
-
rubygems_version: 3.1.
|
219
|
+
rubygems_version: 3.1.6
|
220
220
|
signing_key:
|
221
221
|
specification_version: 4
|
222
222
|
summary: Dynamically generate configs and reload servers
|