forked from CrunchyData/postgresql-prometheus-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·49 lines (42 loc) · 1.54 KB
/
start.sh
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
#!/bin/bash
if [[ "${DATABASE_URL}" == "" ]]; then
echo 'Missing DATABASE_URL'
echo 'example -e DATABASE_URL="user=<db user> password=<db user password> host=<db host> port=<db port> database=<db name>"'
exit 1
fi
trap shutdown INT
function shutdown() {
pkill -SIGINT postgresql-prometheus-adapter
}
adapter_send_timeout=${adapter_send_timeout:-'30s'}
web_listen_address="${web_listen_address:-':9201'}"
web_telemetry_path="${web_telemetry_path:-'/metrics'}"
log_level="${log_level:-'info'}"
log_format="${log_format:-'logfmt'}"
pg_partition="${pg_partition:-'hourly'}"
pg_commit_secs=${pg_commit_secs:-30}
pg_commit_rows=${pg_commit_rows:-20000}
pg_threads="${pg_threads:-1}"
parser_threads="${parser_threads:-5}"
echo /postgresql-prometheus-adapter \
--adapter-send-timeout=${adapter_send_timeout} \
--web-listen-address=${web_listen_address} \
--web-telemetry-path=${web_telemetry_path} \
--log.level=${log_level} \
--log.format=${log_format} \
--pg-partition=${pg_partition} \
--pg-commit-secs=${pg_commit_secs} \
--pg-commit-rows=${pg_commit_rows} \
--pg-threads=${pg_threads} \
--parser-threads=${parser_threads}
/postgresql-prometheus-adapter \
--adapter-send-timeout=${adapter_send_timeout} \
--web-listen-address=${web_listen_address} \
--web-telemetry-path=${web_telemetry_path} \
--log.level=${log_level} \
--log.format=${log_format} \
--pg-partition=${pg_partition} \
--pg-commit-secs=${pg_commit_secs} \
--pg-commit-rows=${pg_commit_rows} \
--pg-threads=${pg_threads} \
--parser-threads=${parser_threads}