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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dadb672b628b814c3962711ce001733dacda07fa75c1b9b418f389719af745b1
4
- data.tar.gz: 32f6f9d54602208c9a8c7402b1e6a12d8f9e2045307b929537d69f09c56adda7
3
+ metadata.gz: f85f27d60f4dcaf253af5ecff4d6fcc6d851e5b54ad85d3f8cdf2bae4ac4a541
4
+ data.tar.gz: fa4ca080415307e4d44e19f12fc5799fc3b8b8f750eda72c7d543491cd37e7fb
5
5
  SHA512:
6
- metadata.gz: 0cc9b1b46bbdeaa6c07850cad5dbe60b05d7bfadaf8cfa9d963a794e1320051463c74c94cef78822b7bd115567fed8622b1370068fdba079e3926cebd70b3dba
7
- data.tar.gz: 64fc6ba379d78027b99f575eaa256b305e5dac656e9504d35b697d07c0d3fb5ac89793668d62046f1e500f8c59e3f4cdf47052a4ac62717f856206dd06a9f183
6
+ metadata.gz: bc6ad4e7c89e473d0902c44b160040da924943d3437310a2edb202a3bab246259f238691bbb81696cc7cf0f0bbe635444dab8add65d0d56790907014aa973293
7
+ data.tar.gz: 9659f0fd04bf6d2e89bc2d58ecc82dd741dd6b1f266d7ff36e621fcb0e5c3774e524c7b02187d90c699d7d2163412505bf55501e35c679d25f1f1f2dd590e755
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "config_skeleton"
5
- s.version = "2.1.0"
5
+ s.version = "2.2.0"
6
6
 
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = "Dynamically generate configs and reload servers"
@@ -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 { config_data.tap { metrics.last_generation_timestamp.set(Time.now.to_f) } }
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.1.0
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: 2021-03-11 00:00:00.000000000 Z
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.4
219
+ rubygems_version: 3.1.6
220
220
  signing_key:
221
221
  specification_version: 4
222
222
  summary: Dynamically generate configs and reload servers