prometheus-config-builder 0.0.31 → 0.0.32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb627701b628cfdaa0568d31f981c40f203214a9bd3d0a55f4d40d0bca64f701
4
- data.tar.gz: f20ff9bcdc3c793e09a5db1ff975dc673c7f09b552ce47a592f3b5b1617f6f19
3
+ metadata.gz: bcca66bbcbc82d4c6d61d56724b0ef4937c3a0f3b0f57bb7d7c9a13b40cd5c0d
4
+ data.tar.gz: cd7d477ebb21a75db8153bd83f10975e59ba4cd990d6b49d569d8e701b53549b
5
5
  SHA512:
6
- metadata.gz: d19cb455d162073b00d7a9ddbf638cde36bfd2bd1c4a480bd86107ceb9b5ea891530a6d587747c66411a49dc298f89a76d49a87a0d84cb55f415228c776c6fa6
7
- data.tar.gz: 65e66d952a9f35f1fc993e4c131cccc603c8365f0a9ef758e5cb752049b93a36c69ba32c47d2c75db455fadca656e0414b8720383933ce3f701cb6abdccdc041
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.
@@ -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.31'
6
+ s.version = '0.0.32'
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.31
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-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk