ProxySQL custom metrics plugin for mackerel.io agent.
You need:
$ sudo mkr plugin install livesense-inc/mackerel-plugin-proxysql
mackerel-plugin-proxysql [-connection-pool] [-monitor-stats] [-host=<host> [-port=<port>]|-socket=<sockfile>] [-username=<username>] [-password=<password>] [-tempfile=<tempfile>] [-metric-key-prefix=<prefix>]
Options:
-connection-pool
: Enable connection pool metrics (default: disable)-monitor-stats
: Enable monitor stats metrics (default: disable)-host
: ProxySQL admin intereface hostname or IP address (default:127.0.0.1
)-port
: ProxySQL admin interface port number (default:6032
)-socket
: Unix socket path. if defined, use Unix socket (default: undefined)-username
: ProxySQL admin interface user (default:stats
)-password
: ProxySQL admin interface password (default:stats
)-tempfile
: Override tempfile path (default: mackerel default)-metric-key-prefix
: Override metrics key prefix (default:proxysql
)
[plugin.metrics.proxysql]
command = "/path/to/mackerel-plugin-proxysql -connection-pool"
- Prefix word
ProxySQL
orproxysql
can be replaced with-metric-key-prefix
option - The desctiptions of each metrics are in ProxySQL Official wiki
- Active (proxysql.transactions.Active_Transactions)
- Client aborted (proxysql.connections.Client_Connections_aborted)
- Client connected (proxysql.connections.Client_Connections_connected)
- Client created (proxysql.connections.Client_Connections_created)
- Client non idle (proxysql.connections.Client_Connections_non_idle)
- Server aborted (proxysql.connections.Server_Connections_aborted)
- Server connected (proxysql.connections.Server_Connections_connected)
- Server created (proxysql.connections.Server_Connections_created)
- Server delayed (proxysql.connections.Server_Connections_delayed)
- Sent to Backend Bytes (proxysql.traffic.Queries_backends_bytes_sent)
- Received from Backend Bytes (proxysql.traffic.Queries_backends_bytes_recv)
- Sent to Frontend Bytes (proxysql.traffic.Queries_frontends_bytes_sent)
- Received from Frontend Bytes (proxysql.traffic.Queries_frontends_bytes_recv)
- Query Processor Time (proxysql.processor.Query_Processor_time_sec)
- Backend Query Time (proxysql.processor.Backend_query_time_sec)
- Query Cache Memory (proxysql.buffers.Query_Cache_Memory_bytes)
- Connection Pool (proxysql.buffers.ConnPool_memory_bytes)
- SQLite (proxysql.buffers.SQLite3_memory_bytes)
- Backend (proxysql.buffers.mysql_backend_buffers_bytes)
- Frontend (proxysql.buffers.mysql_frontend_buffers_bytes)
- Session Internal (proxysql.buffers.mysql_session_internal_bytes)
- Autocommit (proxysql.commands.Com_autocommit)
- Autocommit Filtered (proxysql.commands.Com_autocommit_filtered)
- Commit (proxysql.commands.Com_commit)
- Commit Filtered (proxysql.commands.Com_commit_filtered)
- Rollback (proxysql.commands.Com_rollback)
- Rollback Filtered (proxysql.commands.Com_rollback_filtered)
- Backend Change User (proxysql.commands.Com_backend_change_user)
- Backend Init DB (proxysql.commands.Com_backend_init_db)
- Backend Set Names (proxysql.commands.Com_backend_set_names)
- Frontend Init DB (proxysql.commands.Com_frontend_init_db)
- Frontend Set Names (proxysql.commands.Com_frontend_set_names)
- Frontend Use DB (proxysql.commands.Com_frontend_use_db)
- Backend STMT Prepare (proxysql.commands.Com_backend_stmt_prepare)
- Backend STMT Execute (proxysql.commands.Com_backend_stmt_execute)
- Backend STMT Close (proxysql.commands.Com_backend_stmt_close)
- Frontend STMT Prepare (proxysql.commands.Com_frontend_stmt_prepare)
- Frontend STMT Execute (proxysql.commands.Com_frontend_stmt_execute)
- Frontend STMT Close (proxysql.commands.Com_frontend_stmt_close)
- Questions (proxysql.commands.Questions)
- total (proxysql.slow_queries.Slow_queries)
- Consistent Queries (proxysql.gtids.GTID_consistent_queries)
- Session Collected (proxysql.gtids.GTID_session_collected)
- Access Denied Wrong Password (proxysql.access_errors.Access_Denied_Wrong_Password)
- Access Denied Max Connections (proxysql.access_errors.Access_Denied_Max_Connections)
- Access Denied Max User Connections (proxysql.access_errors.Access_Denied_Max_User_Connections)
- Thread (proxysql.threads.MySQL_Thread_Workers)
- Monitor (proxysql.threads.MySQL_Monitor_Workers)
- Get Immediate (proxysql.connpool_summary.ConnPool_get_conn_immediate)
- Get Success (proxysql.connpool_summary.ConnPool_get_conn_success)
- Get Failure (proxysql.connpool_summary.ConnPool_get_conn_failure)
- Client Active Total (proxysql.statement.Stmt_Client_Active_Total)
- Client Active Unique (proxysql.statement.Stmt_Client_Active_Unique)
- Server Active Total (proxysql.statement.Stmt_Server_Active_Total)
- Server Active Unique (proxysql.statement.Stmt_Server_Active_Unique)
- Cached (proxysql.statement.Stmt_Cached)
- Get (proxysql.querycache_count.Query_Cache_count_GET)
- Get OK (proxysql.querycache_count.Query_Cache_count_GET_OK)
- Set (proxysql.querycache_count.Query_Cache_count_SET)
- IN (proxysql.querycache_bytes.Query_Cache_bytes_IN)
- OUT (proxysql.querycache_bytes.Query_Cache_bytes_OUT)
- Entries (proxysql.querycache_bytes.Query_Cache_Entries)
- Purged (proxysql.querycache_bytes.Query_Cache_Purged)
- workers (proxysql.monitor.workers.MySQL_Monitor_Workers)
- Ping OK (proxysql.monitor.checks.MySQL_Monitor_ping_check_OK)
- Ping Error (proxysql.monitor.checks.MySQL_Monitor_ping_check_ERR)
- Readonly check OK (proxysql.monitor.checks.MySQL_Monitor_read_only_check_OK)
- Readonly check Error (proxysql.monitor.checks.MySQL_Monitor_read_only_check_ERR)
- Replication lag check OK (proxysql.monitor.checks.MySQL_Monitor_replication_lag_check_OK)
- Replication lag check Error (proxysql.monitor.checks.MySQL_Monitor_replication_lag_check_ERR)
- Used (proxysql.connpool.conns.#.ConnUsed)
- Free (proxysql.connpool.conns.#.ConnFree)
- OK (proxysql.connpool.stats.#.ConnOK)
- Error (proxysql.connpool.stats.#.ConnErr)
- Sent (proxysql.connpool.transfers.#.Bytes_data_sent)
- Received (proxysql.connpool.transfers.#.Bytes_data_recv)
- Queries (proxysql.connpool.queries.#.Queries)
- Latency sec (proxysql.connpool.perf.#.Latency_sec)
This repository is using Go 1.11 and Go modules function.