prometheus-config-builder 0.0.17 → 0.0.19

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: 118617063dde0e331c4daa50346cd14d6d4b2a9e
4
- data.tar.gz: 3117b906a6c14141acb26b9bc1d1a5d2e57852e9
3
+ metadata.gz: bfa7f8b751a05fb855f1b09da6903620025d56cb
4
+ data.tar.gz: 6500d5cc5e0afa9ba17d9fafc629efa095214db4
5
5
  SHA512:
6
- metadata.gz: eb9cd3a884df86eb1ff0946f3b7761653a1ebb523fc2704d4594096a2661b9f2417e96366e20c581b045deaf24daeee7a7c8bc5c2383dc402d889c9662f833c4
7
- data.tar.gz: ac0d13daee07147c78cf29119097632dcb6461acb385b5fc12b3add3a7a86eed3df7897c48429c1a530fbb1bfb822612cfd77b7e392f54208cebaf7697846d88
6
+ metadata.gz: 88f680b791fe6aa290e11fd23512ef5e2808728d26989cadb4c6de8131fbffe4e5f552e78ecc1cdb6b2476a44c43762c5e517fb8b4e112c9bb0622bcd1a1d0a1
7
+ data.tar.gz: 753b906d6d578f68020a4d83deb8e7c9d21c6f05e5f2766eedf185b8739a8480744e7be35f1bbaf364f4caf3e2b133b0382915b1626414565166fb6ff3a9632f
@@ -75,6 +75,7 @@ something_changed_count = PrometheusExporter::Client.default.register(:counter,
75
75
  error_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_errors_count", "Number of exceptions during evaluation.")
76
76
  iteration_count = PrometheusExporter::Client.default.register(:counter, "prometheusconfigbuilder_iteration_count", "Number of times configuration has changed.")
77
77
  iteration_duration = PrometheusExporter::Client.default.register(:gauge, "prometheusconfigbuilder_last_iteration_duration", "Duration (in seconds) of the last full config iteration")
78
+ config_has_errors = PrometheusExporter::Client.default.register(:gauge, "prometheusconfigbuilder_config_has_errors", "This value is 0 if the config has no errors.")
78
79
 
79
80
  error_count.observe(0)
80
81
 
@@ -90,7 +91,9 @@ loop do
90
91
  starting = Time.now
91
92
  begin
92
93
  something_changed = builder.write_out()
94
+ config_has_errors.set(0)
93
95
  rescue Exception => e
96
+ config_has_errors.set(1)
94
97
  log.warn("Error while building config: #{e}")
95
98
  puts e.backtrace
96
99
  error_count.increment
@@ -107,7 +110,7 @@ loop do
107
110
  matches = `pgrep -a -f "#{config[:pgrep]}"`.split("\n")
108
111
  match = matches.select {|e| !e.include?("prometheus-config-builder")}
109
112
  if !match
110
- log.warn("Unable to find Prometheus instance to send SIGHUP for. Matches object: #{matches}"
113
+ log.warn("Unable to find Prometheus instance to send SIGHUP for. Matches object: #{matches}")
111
114
  else
112
115
  pid = match.first.split(" ").first.to_i
113
116
  if pid
@@ -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.17'
6
+ s.version = '0.0.19'
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.17
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juho Mäkinen juho.makinen@gmail.com