prometheus-config-builder 0.0.12 → 0.0.13

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: 37a41a4e9ee37b38bd8bc7c7025c60732aa7b5f9
4
- data.tar.gz: 98ccfbd194f736ff97ead53a8fc5ccf12b20f9f1
3
+ metadata.gz: 340fb2c178ee3bf0c32782ba335a46500dbdafd4
4
+ data.tar.gz: 327af98c341fdcdfecadfe29ac00716f12fda348
5
5
  SHA512:
6
- metadata.gz: 11c610a52b55816774141a432b0c4e527d3b076b8e6cdef200dcb3b4d0084699dbab2dcf422d497826f9f0f57b24f3e3d141168de5c9dbcf84f86982dd11e5e5
7
- data.tar.gz: 7c958b3d7fce912530951fd10c6ce16cee716528666d01a6a925b2deda8179abe7055e07d1522c82c54958f65bc112e4f71131bd69060a7f132e555cdb69b0db
6
+ metadata.gz: d32eb0c5cf9a5c657dab7305490f1f73d2101151670da96822c1581c4de6362fca2109018d1af1cb5dbea081a41145f7aec40d62866f4b4a834201e133d7ce0d
7
+ data.tar.gz: bd94a8ea5f20bd18305b1e7a075484fb0287805f425df8df04f469923de74b69db6dab3778918b3aa6c599df1f5b0220780c3f0d1ec86bdb96766d0981b48afb
@@ -18,17 +18,6 @@ config[:root] ||= 'test/data'
18
18
  config[:every] = 60
19
19
  config[:pgrep] = nil
20
20
 
21
- server = PrometheusExporter::Server::WebServer.new port: 12345
22
- PrometheusExporter::Client.default = PrometheusExporter::LocalClient.new(collector: server.collector)
23
- server.start
24
-
25
- something_changed_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_changes_count", "Number of times configuration has changed.")
26
- error_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_errors_count", "Number of exceptions during evaluation.")
27
- iteration_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_iteration_count", "Number of times configuration has changed.")
28
- iteration_duration = PrometheusExporter::Client.default.register(:gauge, "prometheusconfigbuilder_last_iteration_duration", "Duration (in seconds) of the last full config iteration")
29
-
30
- error_count.observe(0)
31
-
32
21
  # Defaults
33
22
  op = OptionParser.new do |o|
34
23
  o.banner = "Usage: #{$PROGRAM_NAME} [OPTIONS]"
@@ -78,6 +67,17 @@ if !File.exist?(config[:dst_dir])
78
67
  exit!(1)
79
68
  end
80
69
 
70
+ server = PrometheusExporter::Server::WebServer.new port: 12345
71
+ PrometheusExporter::Client.default = PrometheusExporter::LocalClient.new(collector: server.collector)
72
+ server.start
73
+
74
+ something_changed_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_changes_count", "Number of times configuration has changed.")
75
+ error_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_errors_count", "Number of exceptions during evaluation.")
76
+ iteration_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_iteration_count", "Number of times configuration has changed.")
77
+ iteration_duration = PrometheusExporter::Client.default.register(:gauge, "prometheusconfigbuilder_last_iteration_duration", "Duration (in seconds) of the last full config iteration")
78
+
79
+ error_count.observe(0)
80
+
81
81
  builder = PrometheusConfigBuilder::Builder.new(config[:prometheus_src], config[:dst_dir])
82
82
 
83
83
  config[:paths].each do |path|
@@ -91,7 +91,9 @@ loop do
91
91
  something_changed = builder.write_out()
92
92
  rescue Exception => e
93
93
  log.warn("Error while building config: #{e}")
94
+ puts e.backtrace
94
95
  error_count.increment
96
+ sleep(config[:every])
95
97
  next
96
98
  end
97
99
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'prometheus-config-builder'
6
- s.version = '0.0.12'
6
+ s.version = '0.0.13'
7
7
  s.date = Time.now
8
8
 
9
9
  s.summary = %q{Template based config generation}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-config-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juho Mäkinen juho.makinen@gmail.com