forked from netdata/go.d.plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add proxysql service monitoring plugin (netdata#703)
- Loading branch information
Showing
20 changed files
with
2,561 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# netdata go.d.plugin configuration for proxysql | ||
# | ||
# This file is in YAML format. Generally the format is: | ||
# | ||
# name: value | ||
# | ||
# There are 2 sections: | ||
# - GLOBAL | ||
# - JOBS | ||
# | ||
# | ||
# [ GLOBAL ] | ||
# These variables set the defaults for all JOBs, however each JOB may define its own, overriding the defaults. | ||
# | ||
# The GLOBAL section format: | ||
# param1: value1 | ||
# param2: value2 | ||
# | ||
# Currently supported global parameters: | ||
# - update_every | ||
# Data collection frequency in seconds. Default: 1. | ||
# | ||
# - autodetection_retry | ||
# Re-check interval in seconds. Attempts to start the job are made once every interval. | ||
# Zero means not to schedule re-check. Default: 0. | ||
# | ||
# - priority | ||
# Priority is the relative priority of the charts as rendered on the web page, | ||
# lower numbers make the charts appear before the ones with higher numbers. Default: 70000. | ||
# | ||
# | ||
# [ JOBS ] | ||
# JOBS allow you to collect values from multiple sources. | ||
# Each source will have its own set of charts. | ||
# | ||
# IMPORTANT: | ||
# - Parameter 'name' is mandatory. | ||
# - Jobs with the same name are mutually exclusive. Only one of them will be allowed running at any time. | ||
# | ||
# This allows autodetection to try several alternatives and pick the one that works. | ||
# Any number of jobs is supported. | ||
# | ||
# The JOBS section format: | ||
# | ||
# jobs: | ||
# - name: job1 | ||
# param1: value1 | ||
# param2: value2 | ||
# | ||
# - name: job2 | ||
# param1: value1 | ||
# param2: value2 | ||
# | ||
# - name: job2 | ||
# param1: value1 | ||
# | ||
# | ||
# [ List of JOB specific parameters ]: | ||
# - dsn | ||
# Data Source Name. | ||
# Format: [username[:password]@][protocol[(address)]]/ | ||
# Full description: https://github.com/go-sql-driver/mysql#dsn-data-source-name | ||
# Syntax: | ||
# dsn: stats:stats@tcp(127.0.0.1:6032)/ | ||
# | ||
# - my.cnf | ||
# Specifies my.cnf file to read connection parameters from under the [client] section | ||
# Syntax: | ||
# my.cnf: '/etc/my.cnf' | ||
# | ||
# - timeout | ||
# Query timeout in seconds. Default 1 second. | ||
# Syntax: | ||
# timeout: 1 | ||
# | ||
# | ||
# [ JOB defaults ]: | ||
# No parameters | ||
# | ||
# | ||
# [ JOB mandatory parameters ]: | ||
# - name | ||
# - dsn | ||
# ------------------------------------------------MODULE-CONFIGURATION-------------------------------------------------- | ||
|
||
# update_every: 1 | ||
# autodetection_retry: 0 | ||
# priority: 70000 | ||
# timeout: 1 | ||
|
||
jobs: | ||
# my.cnf | ||
- name: local | ||
my.cnf: '/etc/my.cnf' | ||
|
||
# stats | ||
- name: local | ||
dsn: stats:stats@tcp(127.0.0.1:6032)/ | ||
|
||
- name: local | ||
dsn: stats:stats@tcp([::1]:6032)/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!-- | ||
title: "ProxySQL monitoring with Netdata" | ||
description: "Monitor connections, slow queries, lagging, backends status and more with zero configuration and per-second metric granularity." | ||
custom_edit_url: https://github.com/netdata/go.d.plugin/edit/master/modules/proxysql/README.md | ||
sidebar_label: "ProxySQL" | ||
--> | ||
|
||
# ProxySQL monitoring with Netdata | ||
|
||
[`ProxySQL`](https://www.proxysql.com/) is an open-source proxy for mySQL. | ||
|
||
This module monitors one or more `ProxySQL` servers, depending on your configuration. | ||
|
||
## Requirements | ||
|
||
Executed queries: | ||
|
||
- `SELECT Variable_Name, Variable_Value FROM global_variables;` | ||
- `SELECT Variable_Name, Variable_Value FROM stats_memory_metrics;` | ||
- `SELECT * FROM stats_mysql_commands_counters;` | ||
- `SELECT Variable_Name, Variable_Value FROM stats_mysql_global;` | ||
- `SELECT * FROM stats_mysql_users;` | ||
|
||
|
||
Netdata uses `stats` username and password which is enabled by default | ||
|
||
## Charts | ||
|
||
It produces the following charts: | ||
|
||
- Uptime in `seconds` | ||
- Questions in `questions` | ||
- Active transactions in `transanctions` | ||
- Slow queries in `queries` | ||
- Backend lagging during query in `backends` | ||
- Backend offline during query in `backends` | ||
- Generated error packets in `packets/s` | ||
- Max connection timeouts in `connections` | ||
- Client connections in `connections` | ||
- Server connections in `connections` | ||
- Query time in `nanoseconds` | ||
- ProxySQL commands in `commands` | ||
- Connection pool requests in `connections` | ||
- Connection pool connections in `connections` | ||
- Mysql monitor threads in `threads` | ||
- Mysql thread workers in `workers` | ||
- Network in `bytes/s` | ||
- Query cache in `number of entries` | ||
- Prepared statements in `prepared statements` | ||
- MySQL max allowed packet in `bytes` | ||
- Memory in `bytes` | ||
- Jemalloc memory in `bytes` | ||
- MySQL command counts in `commands` | ||
- MySQL user connections in `connections` | ||
|
||
|
||
## Configuration | ||
|
||
Edit the `go.d/proxysql.conf` configuration file using `edit-config` from the | ||
Netdata [config directory](https://learn.netdata.cloud/docs/configure/nodes), which is typically at `/etc/netdata`. | ||
|
||
```bash | ||
cd /etc/netdata # Replace this path with your Netdata config directory | ||
sudo ./edit-config go.d/proxysql.conf | ||
``` | ||
|
||
[DSN syntax in details](https://github.com/go-sql-driver/mysql#dsn-data-source-name). | ||
|
||
```yaml | ||
jobs: | ||
- name: local | ||
dsn: '[username[:password]@][protocol[(address)]]/' | ||
# username:password@protocol(address)/ | ||
# Examples: | ||
# - name: remote | ||
# dsn: stats:stats@localhost/ | ||
``` | ||
|
||
For all available options see | ||
module [configuration file](https://github.com/netdata/go.d.plugin/blob/master/config/go.d/proxysql.conf). | ||
|
||
## Troubleshooting | ||
|
||
To troubleshoot issues with the `proxysql` collector, run the `go.d.plugin` with the debug option enabled. The output | ||
should give you clues as to why the collector isn't working. | ||
|
||
- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on | ||
your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. | ||
|
||
```bash | ||
cd /usr/libexec/netdata/plugins.d/ | ||
``` | ||
|
||
- Switch to the `netdata` user. | ||
|
||
```bash | ||
sudo -u netdata -s | ||
``` | ||
|
||
- Run the `go.d.plugin` to debug the collector: | ||
|
||
```bash | ||
./go.d.plugin -d -m proxysql | ||
``` | ||
|
Oops, something went wrong.