checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA1:
3
- metadata.gz: 3100ffcfdb9f2ff406342809d5a836b8440c0b7c
4
- data.tar.gz: 8290a3c9fe7dd20d1f5780617965c04931a624cc
3
+ metadata.gz: 28ec94a10f052a70bf318fa278d0db94f1b61bd7
4
+ data.tar.gz: 8bf37321c60625e248baf3ae1ad87f43a6bfa490
5
5
SHA512:
6
- metadata.gz: 38e24852f811bb6d7688bf7b8aff118bcd944f7af15be5391232ec91955e8203d13f168fd074944210e51b69400f82b36838e450470f9f309ad917905e3c5145
7
- data.tar.gz: 80f648e26368dfa50a712e98a8307764f665afa59640e63643512cae372f812e2e5029bc805afcb0d6ea25e31172bbb66d87d0979e6494c9a5b0100564051f29
6
+ metadata.gz: 8a45f2851cc4a39b0eda17440bf8150d267f0e386e315a220297a5e1fd7340867dfeee6c90fca4208275ea4d61d9ff169eaed0053729e78f5626f2e8bd6e21be
7
+ data.tar.gz: 41c1a3a58953002e3ab8b7894b111b0da6a3f6053292da17c33c4e5e1bc080087d1bc6bce00ebde5a8c47da3d809bf9e69d13cbdc07d98912ff48da889c9e491
data/lib/prometheus-config-builder/prometheus-config-builder.rb CHANGED
@@ -164,6 +164,8 @@ module PrometheusConfigBuilder
164
164
data["scrape_configs"] = []
165
165
end
166
166
167
+ FileUtils.mkdir_p(scrape_files_dir) if !File.exist?(scrape_files_dir)
168
+
167
169
@files.each do |file|
168
170
configs = file.get_scrape_configs(scrape_files_dir + "/" + File.basename(file.basename, ".*"))
169
171
data["scrape_configs"].push(*configs)
data/lib/prometheus-config-builder/scrape_ecs.rb CHANGED
@@ -18,7 +18,9 @@ module PrometheusConfigBuilder
18
18
19
19
end
20
20
21
- @@ecs = Aws::ECS::Client.new(region=config["region"])
21
+ @@ecs = Aws::ECS::Client.new({
22
+ region:config["region"]
23
+ })
22
24
$VERBOSE = x
23
25
tasks = get_tasks(config["cluster"], config["service"])
24
26
ips = get_task_ips(config["cluster"], tasks)
@@ -35,15 +37,16 @@ module PrometheusConfigBuilder
35
37
return nil
36
38
end
37
39
38
- File.open(dst_prefix + "_" + config["name"] + ".json", "w") do |file|
40
+ file = File.expand_path(dst_prefix + "_" + config["name"] + ".json")
41
+ File.open(file, "w") do |file|
39
42
file.write(data.to_json)
40
43
end
41
44
42
45
return {
43
- "job_name" => config["job_name"],
46
+ "job_name" => config["name"],
44
47
"metrics_path" => config["metrics_path"],
45
48
"files" => [
46
- config["file"]
49
+ file
47
50
]
48
51
}
49
52
end
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.4'
6
+ s.version = '0.0.5'
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.4
4
+ version: 0.0.5
5
5
platform: ruby
6
6
authors:
7
7
- Juho Mäkinen juho.makinen@gmail.com