-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsys.config
More file actions
322 lines (309 loc) Β· 11.1 KB
/
sys.config
File metadata and controls
322 lines (309 loc) Β· 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
[
% {kernel, [
% {logger_level, info},
% {logger, [
% {handler, console_logger, logger_std_h, #{
% level => debug,
% config => #{
% type => {file, "/var/log/hellgate/console.json"},
% sync_mode_qlen => 20
% },
% formatter => {logger_logstash_formatter, #{}}
% }}
% ]}
% ]},
{scoper, [
{storage, scoper_storage_logger}
]},
{opentelemetry, [
{processors, [{otel_batch_processor, #{scheduled_delay_ms => 1000}}]}
]},
{hg_proto, [
{services, #{
limiter => "http://limiter:8022/v1/limiter",
automaton => "http://machinegun:8022/v1/automaton",
eventsink => "http://machinegun:8022/v1/event_sink",
accounter => "http://shumway:8022/accounter",
party_management => "http://party-management:8022/v1/processing/partymgmt",
customer_management => "http://hellgate:8022/v1/processing/customer_management",
% TODO make more consistent
recurrent_paytool => "http://hellgate:8022/v1/processing/recpaytool",
fault_detector => "http://fault-detector:8022/v1/fault-detector"
}}
]},
{hellgate, [
{ip, "::"},
{port, 8022},
{default_woody_handling_timeout, 30000},
%% 1 sec above cowboy's request_timeout
{shutdown_timeout, 7000},
{protocol_opts, #{
% Bump keepalive timeout up to a minute
request_timeout => 6000,
% Should be greater than any other timeouts
idle_timeout => infinity
}},
%% OTEL log handler configuration
{otel_log_level, info},
{otel_log_max_queue_size, 2048},
{otel_log_scheduled_delay_ms, 1000},
{otel_log_exporting_timeout_ms, 300000},
{scoper_event_handler_options, #{
event_handler_opts => #{
formatter_opts => #{
max_length => 1000
},
events_severity => #{
%% Maybe disregard those events by lowering their severity level
['call service'] => info,
['service result'] => info,
['invoke service handler'] => info,
['service handler result'] => info,
['service handler result', error, business] => warning,
['client cache hit'] => info
}
}
}},
{proxy_opts, #{
transport_opts => #{}
}},
{health_check_liveness, #{
disk => {erl_health, disk, ["/", 99]},
memory => {erl_health, cg_memory, [70]},
service => {erl_health, service, [<<"hellgate">>]}
}},
{health_check_readiness, #{
dmt_client => {dmt_client, health_check, []},
progressor =>
{progressor, health_check, [
%% list of progressors namespaces for tests
[invoice_template]
]}
}},
{payment_retry_policy, #{
processed => {exponential, {max_total_timeout, 30}, 2, 1},
captured => no_retry,
refunded => no_retry
}},
{inspect_timeout, 3000},
{payment, #{
% Payment error codes that signals hellgate to attempt another route
% (default = [<<"preauthorization_failed">>])
default_transient_errors => [<<"preauthorization_failed">>]
}},
{fault_detector, #{
enabled => true,
% Woody RPC request timeout (ms).
timeout => 4000,
% How to measure technical availability of providers?
availability => #{
% We consider provider as _unavailable_ if their failrate is greater than this
% threshold (0.0 is no failures at all / 1.0 is every attempt to interact fails).
critical_fail_rate => 0.7,
% For how long to account operations in failrate computation (ms)?
sliding_window => 60000,
% If operation takes too long, when do we consider it as failure (ms)?
operation_time_limit => 10000,
% With which time resolution we should compute failrate (s)?
% Less means quicker reaction to failures at the cost of increased load on service.
pre_aggregation_size => 2
},
% How to measure providers' conversion (aka business availability)?
conversion => #{
% Which business level error codes aren't treated as failures?
benign_failures => [
insufficient_funds,
rejected_by_issuer,
processing_deadline_reached
],
% We consider provider as _unavailable_ if their failrate is greater than this
% threshold (0.0 is no failures at all / 1.0 is every attempt to interact fails).
critical_fail_rate => 0.7,
% For how long to account operations in failrate computation (ms)?
sliding_window => 60000,
% If operation takes too long, when do we consider it as failure (ms)?
operation_time_limit => 1200000,
% With which time resolution we should compute failrate (s)?
% Less means quicker reaction to failures at the cost of increased load on service.
pre_aggregation_size => 2
}
}},
{binding, #{
max_sync_interval => <<"5s">>,
outdated_sync_interval => <<"1440m">>,
outdate_timeout => <<"180m">>
}},
%% progressor | machinegun
{backend, progressor}
]},
{dmt_client, [
% milliseconds
{cache_update_interval, 5000},
{max_cache_size, #{
elements => 20,
% 50Mb
memory => 52428800
}},
{woody_event_handlers, [
{scoper_woody_event_handler, #{
event_handler_opts => #{
formatter_opts => #{
max_length => 1000
},
events_severity => #{
%% Was 'info'
['service handler result', error, business] => warning
}
}
}}
]},
{service_urls, #{
'AuthorManagement' => <<"http://dmt:8022/v1/domain/author">>,
'Repository' => <<"http://dmt:8022/v1/domain/repository">>,
'RepositoryClient' => <<"http://dmt:8022/v1/domain/repository_client">>
}}
]},
{party_client, [
{services, #{
party_management => "http://party-management:8022/v1/processing/partymgmt"
}},
{woody, #{
% disabled | safe | aggressive
cache_mode => safe,
options => #{
woody_client => #{
event_handler =>
{scoper_woody_event_handler, #{
event_handler_opts => #{
formatter_opts => #{
max_length => 1000
},
events_severity => #{
%% Was 'info'
['service handler result', error, business] => warning
}
}
}}
}
}
}}
]},
{snowflake, [
% 1 second
{max_backward_clock_moving, 1000},
{machine_id, hostname_hash}
]},
{prometheus, [
{collectors, [default]}
]},
{hackney, [
{mod_metrics, woody_hackney_prometheus}
]},
{progressor, [
{defaults, #{
storage => #{
client => prg_pg_backend,
options => #{
pool => default_pool
}
},
retry_policy => #{
initial_timeout => 5,
backoff_coefficient => 2,
max_timeout => 1800,
max_attempts => 10,
non_retryable_errors => []
},
task_scan_timeout => 15,
process_step_timeout => 60
}},
{namespaces, #{
invoice => #{
processor => #{
client => hg_progressor,
options => #{
party_client => #{},
ns => <<"invoice">>,
handler => hg_machine
}
},
storage => #{
client => prg_pg_backend,
options => #{
pool => invoice_base_pool,
front_pool => invoice_front_pool,
scan_pool => invoice_scan_pool
}
},
worker_pool_size => 200
},
invoice_template => #{
processor => #{
client => hg_progressor,
options => #{
party_client => #{},
ns => <<"invoice_template">>,
handler => hg_machine
}
},
worker_pool_size => 5
},
customer => #{
processor => #{
client => hg_progressor,
options => #{
party_client => #{},
ns => <<"customer">>,
handler => hg_machine
}
},
worker_pool_size => 5
},
recurrent_paytools => #{
processor => #{
client => hg_progressor,
options => #{
party_client => #{},
ns => <<"recurrent_paytools">>,
handler => hg_machine
}
},
worker_pool_size => 5
}
}}
]},
%%
{epg_connector, [
{databases, #{
hellgate_db => #{
host => "db",
port => 5432,
database => "hellgate",
username => "hellgate",
password => "postgres"
}
}},
{pools, #{
default_pool => #{
database => hellgate_db,
size => {6, 12}
},
invoice_base_pool => #{
database => hellgate_db,
size => 52
},
invoice_front_pool => #{
database => hellgate_db,
size => {12, 72}
},
invoice_scan_pool => #{
database => hellgate_db,
size => 2
}
}}
]},
{canal, [
{url, "http://vault"},
{engine, kvv2}
]}
].