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 +4 -4
- data/bin/prometheus-config-builder +4 -1
- data/prometheus-config-builder.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa7f8b751a05fb855f1b09da6903620025d56cb
|
4
|
+
data.tar.gz: 6500d5cc5e0afa9ba17d9fafc629efa095214db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|