prometheus-config-builder 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prometheus-config-builder/scrape_ecs.rb +19 -8
- data/prometheus-config-builder.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcca66bbcbc82d4c6d61d56724b0ef4937c3a0f3b0f57bb7d7c9a13b40cd5c0d
|
4
|
+
data.tar.gz: cd7d477ebb21a75db8153bd83f10975e59ba4cd990d6b49d569d8e701b53549b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3ad2925c183ccab287baf1708ae98729550fb255326c1a593bb0a79bfc525cd278ff319017cb15fb0ed176182731aeb861718ce22cd09b4163fe6d7d754848
|
7
|
+
data.tar.gz: 6506ad9f4d88b3da6f924bb36377f686db1d7abe34391bcd3263d14d6a82cda5938e25b3ef4daf3ebd561c5eb2cd8c003ef273bca5326d1ff4ead8f96cccac8d
|
@@ -64,21 +64,32 @@ module PrometheusConfigBuilder
|
|
64
64
|
region = (config["region"] or "us-east-1")
|
65
65
|
assume_role = config["assume_role"]
|
66
66
|
|
67
|
+
retries = 3
|
67
68
|
begin
|
68
69
|
client = get_client(region, assume_role)
|
70
|
+
|
71
|
+
$VERBOSE = x
|
72
|
+
tasks = get_tasks(client, config["cluster"], config["service"])
|
73
|
+
endpoints = get_task_endpoints(client, config["cluster"], tasks, config["labels"], config["metrics_port"])
|
74
|
+
|
75
|
+
if !config["job_name"]
|
76
|
+
logger.warn("File #{basename}: the scrape_configs of type:ecs-tasks doesn't have \"job_name\" field set. Ignoring!")
|
77
|
+
return nil
|
78
|
+
end
|
79
|
+
|
80
|
+
rescue Aws::Errors::MissingCredentialsError => e
|
81
|
+
logger.warn("Got a Aws::Errors::MissingCredentialsError: #{e}")
|
82
|
+
if retries > 0
|
83
|
+
retries = retries - 1
|
84
|
+
logger.warn("Will try to retry")
|
85
|
+
retry
|
86
|
+
end
|
87
|
+
raise e
|
69
88
|
rescue ArgumentError => e
|
70
89
|
logger.warn("File #{basename}: the scrape_configs of type:ecs-tasks had invalid arguments: #{e}")
|
71
90
|
return nil
|
72
91
|
end
|
73
92
|
|
74
|
-
$VERBOSE = x
|
75
|
-
tasks = get_tasks(client, config["cluster"], config["service"])
|
76
|
-
endpoints = get_task_endpoints(client, config["cluster"], tasks, config["labels"], config["metrics_port"])
|
77
|
-
|
78
|
-
if !config["job_name"]
|
79
|
-
logger.warn("File #{basename}: the scrape_configs of type:ecs-tasks doesn't have \"job_name\" field set. Ignoring!")
|
80
|
-
return nil
|
81
|
-
end
|
82
93
|
|
83
94
|
# Prometheus might notice that the scrape file is changed in the middle of the write. That's why we'll
|
84
95
|
# first write the new contents into a temp file and atomically replace the file with the temp file.
|
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.
|
4
|
+
version: 0.0.32
|
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: 2020-
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|