Skip to content

Commit fb4975c

Browse files
committed
generate postgres metrics in addition to mysql metrics
1 parent 2b44aaa commit fb4975c

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

:wq

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
datadir = "/var/lib/proxysql"
2+
errorlog = "/var/lib/proxysql/proxysql.log"
3+
admin_variables=
4+
{
5+
admin_credentials = "admin:wo0hQ4c9iUUNSf8kt1VZVOmSJMvde72XuZwPe4mSIDeyB7vl4MVSOUd2"
6+
mysql_ifaces = "0.0.0.0:6032"
7+
restapi_enabled = true
8+
restapi_port = 6070
9+
}
10+
11+
pgsql_variables=
12+
{
13+
commands_stats = true
14+
connect_retries_on_failure = 10
15+
connect_timeout_server = 100000
16+
connect_timeout_server_max = 1000000
17+
default_query_delay = 0
18+
default_query_timeout = "86400000"
19+
default_schema = "information_schema"
20+
eventslog_default_log = 1
21+
eventslog_filename = "/var/lib/proxysql/queries.log"
22+
eventslog_format = 2
23+
have_compress = true
24+
interfaces = "0.0.0.0:6133"
25+
max_connections = 130000
26+
monitor_connect_interval = 2000
27+
monitor_history = 600000
28+
monitor_password = "iYYjxj4687kBdAkl"
29+
monitor_ping_interval = 2000
30+
monitor_read_only_interval = 1000
31+
monitor_read_only_timeout = 800
32+
monitor_username = "pt_read"
33+
ping_interval_server_msec = 10000
34+
ping_timeout_server = 200
35+
poll_timeout = 2000
36+
query_cache_size_MB = 100000
37+
server_version = "16.1"
38+
sessions_sort = true
39+
stacksize = "1048576"
40+
threads = 8
41+
threshold_resultset_size = "1000000000"
42+
verbose_query_error = true
43+
}
44+
45+
pgsql_servers=
46+
(
47+
{
48+
address = "rd1pgposttradearch05.hudson-trading.com"
49+
comment = "rd1pgposttradearch05"
50+
hostgroup_id = 1
51+
max_connections = 100
52+
max_replication_lag = 0
53+
port = 5433
54+
weight = 1
55+
},
56+
{
57+
address = "rd1pgposttradearch06.hudson-trading.com"
58+
comment = "rd1pgposttradearch06"
59+
hostgroup_id = 1
60+
max_connections = 100
61+
max_replication_lag = 0
62+
port = 5433
63+
weight = 1
64+
},
65+
{
66+
address = "shapgposttradearch01.hudson-trading.com"
67+
comment = "shapgposttradearch01"
68+
hostgroup_id = 1
69+
max_connections = 100
70+
max_replication_lag = 0
71+
port = 5433
72+
weight = 1
73+
}
74+
)
75+
76+
pgsql_users=
77+
(
78+
{
79+
active = 1
80+
default_hostgroup = 1
81+
max_connections = 130000
82+
password = "iYYjxj4687kBdAkl"
83+
username = "pt_read"
84+
},
85+
{
86+
active = 1
87+
default_hostgroup = 1
88+
max_connections = 130000
89+
password = "G5HdUmN5EV3sOuUMmFX1"
90+
username = "readonly"
91+
}
92+
)
93+
94+
pgsql_query_rules=
95+
(
96+
{
97+
active = 1
98+
apply = 0
99+
cache_ttl = 36000000
100+
destination_hostgroup = 1
101+
match_pattern = "^(DECLARE|FETCH)"
102+
negate_match_pattern = 1
103+
rule_id = 101
104+
}
105+
)

lib/ProxySQL_Admin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,6 +2512,10 @@ void update_modules_metrics() {
25122512
if (MyHGM) {
25132513
MyHGM->p_update_metrics();
25142514
}
2515+
// Update pgsql_hostgroups_manager metrics
2516+
if (PgHGM) {
2517+
PgHGM->p_update_metrics();
2518+
}
25152519
// Update monitor metrics
25162520
if (GloMyMon) {
25172521
GloMyMon->p_update_metrics();

0 commit comments

Comments
 (0)