Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/netdata proxysql #8502

Merged
merged 5 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/monitoring/go.d.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mysql: yes
# powerdns: yes
# powerdns_recursor: yes
# prometheus: yes
# proxysql: yes
proxysql: yes
# pulsar: yes
# rabbitmq: yes
redis: yes
Expand Down
7 changes: 7 additions & 0 deletions conf/monitoring/go.d/proxysql.conf.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## All available configuration options, their descriptions and default values:
## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/proxysql#readme

jobs:
- name: local
dsn: administrator:admin@tcp(100.64.0.1:6032)/
autodetection_retry: 300
34 changes: 17 additions & 17 deletions conf/proxysql.conf.example
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#file proxysql.cfg

########################################################################################
# This config file is parsed using libconfig , and its grammar is described in:
# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-File-Grammar
# Grammar is also copied at the end of this file
# This config file is parsed using libconfig , and its grammar is described in:
# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-File-Grammar
# Grammar is also copied at the end of this file
########################################################################################

########################################################################################
# IMPORTANT INFORMATION REGARDING THIS CONFIGURATION FILE:
# IMPORTANT INFORMATION REGARDING THIS CONFIGURATION FILE:
########################################################################################
# On startup, ProxySQL reads its config file (if present) to determine its datadir.
# On startup, ProxySQL reads its config file (if present) to determine its datadir.
# What happens next depends on if the database file (disk) is present in the defined
# datadir (i.e. "/var/lib/proxysql/proxysql.db").
#
# If the database file is found, ProxySQL initializes its in-memory configuration from
# the persisted on-disk database. So, disk configuration gets loaded into memory and
# then propagated towards the runtime configuration.
# If the database file is found, ProxySQL initializes its in-memory configuration from
# the persisted on-disk database. So, disk configuration gets loaded into memory and
# then propagated towards the runtime configuration.
#
# If the database file is not found and a config file exists, the config file is parsed
# and its content is loaded into the in-memory database, to then be both saved on-disk
# If the database file is not found and a config file exists, the config file is parsed
# and its content is loaded into the in-memory database, to then be both saved on-disk
# database and loaded at runtime.
#
# IMPORTANT: If a database file is found, the config file is NOT parsed. In this case
# ProxySQL initializes its in-memory configuration from the persisted on-disk
# database ONLY. In other words, the configuration found in the proxysql.cnf
# file is only used to initial the on-disk database read on the first startup.
#
# In order to FORCE a re-initialise of the on-disk database from the configuration file
# In order to FORCE a re-initialise of the on-disk database from the configuration file
# the ProxySQL service should be started with "systemctl start proxysql-initial".
#
########################################################################################
Expand All @@ -36,14 +36,14 @@ errorlog="/usr/local/pf/logs/proxysql.log"

admin_variables=
{
admin_credentials="admin:admin"
mysql_ifaces="127.0.0.1:6032"
admin_credentials="administrator:admin"
mysql_ifaces="0.0.0.0:6032"
refresh_interval=2000
web_enabled=false
web_port=6080
stats_credentials="stats:admin"
}

mysql_variables=
{
threads=4
Expand Down Expand Up @@ -108,12 +108,12 @@ mysql_galera_hostgroups =
[% END %]
[% END %]
[% END %]

mysql_servers =
(
[% mysql_servers %]
)

[% UNLESS single_server %]
mysql_query_rules =
(
Expand Down Expand Up @@ -154,7 +154,7 @@ mysql_query_rules =
}
)
[% END %]

mysql_users =
(
[% mysql_users %]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,48 @@ export default [
cols: 12
}
]
}
},
{
name: 'ProxySQL', // i18n defer
items: [
{
title: 'Client Connections', // i18n defer
metric: 'proxysql.client_connections_count',
library: libraries.DYGRAPH,
cols: 6
},
{
title: 'Client Statements', // i18n defer
metric: ' proxysql.client_statements_rate',
library: libraries.DYGRAPH,
cols: 6
},
{
title: 'Traffic Backend', // i18n defer
metric: 'proxysql.backends_traffic',
library: libraries.DYGRAPH,
cols: 6
},
{
title: 'Traffic Clients', // i18n defer
metric: 'proxysql.clients_traffic',
library: libraries.DYGRAPH,
cols: 6
},
{
title: 'Memory', // i18n defer
metric: 'proxysql.memory_used',
library: libraries.DYGRAPH,
cols: 6
},
{
title: 'Latency', // i18n defer
metric: 'proxysql.backend_latency',
library: libraries.DYGRAPH,
cols: 6
}
]
},
]
}
]
1 change: 1 addition & 0 deletions lib/pf/services/manager/netdata.pm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ EOT
parse_template( \%tags, "$conf_dir/monitoring/go.d/haproxy.conf", "$generated_conf_dir/monitoring/go.d/haproxy.conf" );
parse_template( \%tags, "$conf_dir/monitoring/go.d/mysql.conf", "$generated_conf_dir/monitoring/go.d/mysql.conf" );
parse_template( \%tags, "$conf_dir/monitoring/go.d/ping.conf", "$generated_conf_dir/monitoring/go.d/ping.conf" );
parse_template( \%tags, "$conf_dir/monitoring/go.d/proxysql.conf", "$generated_conf_dir/monitoring/go.d/proxysql.conf" );
parse_template( \%tags, "$conf_dir/monitoring/go.d/redis.conf", "$generated_conf_dir/monitoring/go.d/redis.conf" );
parse_template( \%tags, "$conf_dir/monitoring/go.d/web_log.conf", "$generated_conf_dir/monitoring/go.d/web_log.conf" );
return 1;
Expand Down
2 changes: 1 addition & 1 deletion sbin/proxysql-docker-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ args="$args -v/usr/local/pf/conf/:/usr/local/pf/conf/"
args="$args -v/usr/local/pf/var/conf/:/usr/local/pf/var/conf/"
args="$args -v /usr/local/pf/var/proxysql/:/usr/local/pf/var/proxysql/"
args="$args -v /usr/local/pf/logs/:/usr/local/pf/logs/"
args+=" -p 127.0.0.1:6032:6032 -p 6033:6033 -p 6080:6080"
args+=" -p 100.64.0.1:6032:6032 -p 6033:6033 -p 6080:6080"

run $name "$args"