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 +4 -4
- data/bin/prometheus-config-builder +13 -11
- 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: 340fb2c178ee3bf0c32782ba335a46500dbdafd4
|
4
|
+
data.tar.gz: 327af98c341fdcdfecadfe29ac00716f12fda348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|