terrafying-components 1.12.5 → 1.12.6
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/lib/terrafying/components/prometheus.rb +14 -9
- data/lib/terrafying/components/version.rb +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: 207909717ddd31f5740ef36393a7e9350c69d8815682279a1024672de1b60775
|
|
4
|
+
data.tar.gz: a741a9a535b43229db3381b3bd08ce4bead27fb4c8fd5eb691082ebcd76b23ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b7cb8553f9ee931d603c0aeea91b9e8832a5337a399bf87e6729ef050501609b3889c50ba57355f415e7523558dc9c838f8dd59c83efcb5d7c6f5a8b4d76601
|
|
7
|
+
data.tar.gz: d89ae30401610cc32b2386c4066fa26a502d05916d09664a53a05921f1d628164b19acecb52ff82948450d6c6a9f7b1dd5a97f4f8a126283c8f50cedcf91d1f1
|
|
@@ -24,7 +24,9 @@ module Terrafying
|
|
|
24
24
|
prom_name: 'prometheus',
|
|
25
25
|
prom_version: 'v2.10.0',
|
|
26
26
|
instances: 2,
|
|
27
|
-
instance_type: 't3a.small'
|
|
27
|
+
instance_type: 't3a.small',
|
|
28
|
+
thanos_instance_type: 't3a.small',
|
|
29
|
+
prometheus_tsdb_retention: '1d'
|
|
28
30
|
)
|
|
29
31
|
super()
|
|
30
32
|
@vpc = vpc
|
|
@@ -33,7 +35,9 @@ module Terrafying
|
|
|
33
35
|
@prom_name = prom_name
|
|
34
36
|
@prom_version = prom_version
|
|
35
37
|
@instances = instances
|
|
36
|
-
@
|
|
38
|
+
@prometheus_instance_type = instance_type
|
|
39
|
+
@thanos_instance_type = thanos_instance_type
|
|
40
|
+
@prometheus_tsdb_retention = prometheus_tsdb_retention
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
def find
|
|
@@ -46,7 +50,8 @@ module Terrafying
|
|
|
46
50
|
def create
|
|
47
51
|
prometheus_thanos_sidecar_hostname = tf_safe(@prom_name)
|
|
48
52
|
prometheus_thanos_sidecar_srv_fqdn = "_grpc._tcp.#{@vpc.zone.qualify prometheus_thanos_sidecar_hostname}"
|
|
49
|
-
@
|
|
53
|
+
@prometheus_instance_vcpu_count = aws.instance_type_vcpu_count(@prometheus_instance_type)
|
|
54
|
+
@thanos_instance_vcpu_count = aws.instance_type_vcpu_count(@thanos_instance_type)
|
|
50
55
|
@thanos = create_thanos(prometheus_thanos_sidecar_srv_fqdn)
|
|
51
56
|
create_thanos_cloudwatch_alert(@thanos)
|
|
52
57
|
|
|
@@ -82,7 +87,7 @@ module Terrafying
|
|
|
82
87
|
number: 10_901
|
|
83
88
|
}
|
|
84
89
|
],
|
|
85
|
-
instance_type: @
|
|
90
|
+
instance_type: @prometheus_instance_type,
|
|
86
91
|
iam_policy_statements: thanos_store_access,
|
|
87
92
|
instances: [{}] * @instances,
|
|
88
93
|
units: [prometheus_unit, thanos_sidecar_unit],
|
|
@@ -116,7 +121,7 @@ module Terrafying
|
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
123
|
],
|
|
119
|
-
instance_type: @
|
|
124
|
+
instance_type: @thanos_instance_type,
|
|
120
125
|
units: [thanos_unit(prometheus_thanos_sidecar_srv_fqdn)],
|
|
121
126
|
instances: [{}] * @instances,
|
|
122
127
|
loadbalancer: true,
|
|
@@ -150,12 +155,12 @@ module Terrafying
|
|
|
150
155
|
-v /opt/prometheus:/opt/prometheus \
|
|
151
156
|
quay.io/prometheus/prometheus:#{@prom_version} \
|
|
152
157
|
--storage.tsdb.path=/opt/prometheus/data \
|
|
153
|
-
--storage.tsdb.retention.time
|
|
158
|
+
--storage.tsdb.retention.time=#{@prometheus_tsdb_retention} \
|
|
154
159
|
--storage.tsdb.min-block-duration=2h \
|
|
155
160
|
--storage.tsdb.max-block-duration=2h \
|
|
156
161
|
--storage.tsdb.no-lockfile \
|
|
157
|
-
--storage.remote.read-concurrent-limit=#{@
|
|
158
|
-
--query.max-concurrency=#{@
|
|
162
|
+
--storage.remote.read-concurrent-limit=#{@prometheus_instance_vcpu_count} \
|
|
163
|
+
--query.max-concurrency=#{@prometheus_instance_vcpu_count} \
|
|
159
164
|
--config.file=/opt/prometheus/prometheus.yml \
|
|
160
165
|
--web.console.templates=/etc/prometheus/consoles \
|
|
161
166
|
--web.console.libraries=/etc/prometheus/console_libraries \
|
|
@@ -271,7 +276,7 @@ module Terrafying
|
|
|
271
276
|
improbable/thanos:#{@thanos_version} \
|
|
272
277
|
query \
|
|
273
278
|
--query.replica-label=replica \
|
|
274
|
-
--query.max-concurrent=#{@
|
|
279
|
+
--query.max-concurrent=#{@thanos_instance_vcpu_count} \
|
|
275
280
|
--store=dnssrv+#{prometheus_thanos_sidecar_srv_fqdn} \
|
|
276
281
|
--log.level=warn
|
|
277
282
|
Restart=always
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: terrafying-components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.12.
|
|
4
|
+
version: 1.12.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- uSwitch Limited
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-05-
|
|
11
|
+
date: 2019-05-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|