checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA1:
3
- metadata.gz: 79736d31f0e67d9f52e5984c2f887d38325d1af2
4
- data.tar.gz: 541b8ee3704b00ff4c6a2a4762ac92002947b2dd
3
+ metadata.gz: 118617063dde0e331c4daa50346cd14d6d4b2a9e
4
+ data.tar.gz: 3117b906a6c14141acb26b9bc1d1a5d2e57852e9
5
5
SHA512:
6
- metadata.gz: 48b24013a8f292a47502785712d1eedba4fbde8dc0b14cf6815a22b9bafea04a31e05237a6495362a3c75b6e46c96368e9c140e90a0ff323ea0e351a63896b2b
7
- data.tar.gz: 1d89de2b684488ec8aebe7e585998a72f3a6664417f4c0e1d534dd9d1e8c27edc219736f5f570dfacb2e153c1a8b203530e571a341c13dcb669e45fbf1239e11
6
+ metadata.gz: eb9cd3a884df86eb1ff0946f3b7761653a1ebb523fc2704d4594096a2661b9f2417e96366e20c581b045deaf24daeee7a7c8bc5c2383dc402d889c9662f833c4
7
+ data.tar.gz: ac0d13daee07147c78cf29119097632dcb6461acb385b5fc12b3add3a7a86eed3df7897c48429c1a530fbb1bfb822612cfd77b7e392f54208cebaf7697846d88
data/bin/prometheus-config-builder CHANGED
@@ -39,7 +39,7 @@ op = OptionParser.new do |o|
39
39
config[:verbose] = true
40
40
end
41
41
o.on('--every=[seconds]', 'Rerun every n seconds') do |seconds|
42
- config[:every] = seconds
42
+ config[:every] = seconds.to_i
43
43
end
44
44
o.on('--pgrep=[string]', 'pgrep -f [string] for finding Prometheus process for SIGHUP') do |str|
45
45
config[:pgrep] = str
@@ -106,10 +106,14 @@ loop do
106
106
if something_changed && config[:pgrep] != nil
107
107
matches = `pgrep -a -f "#{config[:pgrep]}"`.split("\n")
108
108
match = matches.select {|e| !e.include?("prometheus-config-builder")}
109
- pid = match.first.split(" ").first.to_i
110
- if pid
111
- log.info("Sending SIGHUP signal to Prometheus at pid #{pid}.")
112
- Process.kill "HUP", pid
109
+ if !match
110
+ log.warn("Unable to find Prometheus instance to send SIGHUP for. Matches object: #{matches}"
111
+ else
112
+ pid = match.first.split(" ").first.to_i
113
+ if pid
114
+ log.info("Sending SIGHUP signal to Prometheus at pid #{pid}.")
115
+ Process.kill "HUP", pid
116
+ end
113
117
end
114
118
end
115
119
rescue Exception => e
data/prometheus-config-builder.gemspec CHANGED
@@ -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.16'
6
+ s.version = '0.0.17'
7
7
s.date = Time.now
8
8
9
9
s.summary = %q{Template based config generation}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
--- !ruby/object:Gem::Specification
2
2
name: prometheus-config-builder
3
3
version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
platform: ruby
6
6
authors:
7
7
- Juho Mäkinen juho.makinen@gmail.com
8
8
autorequire:
9
9
bindir: bin
10
10
cert_chain: []
11
- date: 2019-10-04 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
14
name: aws-sdk