github.com/netdata/go.d.plugin@v0.58.1/modules/proxysql/integrations/proxysql.md (about)

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/proxysql/README.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/proxysql/metadata.yaml"
     4  sidebar_label: "ProxySQL"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Databases"
     7  most_popular: False
     8  message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
     9  endmeta-->
    10  
    11  # ProxySQL
    12  
    13  
    14  <img src="https://netdata.cloud/img/proxysql.png" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: proxysql
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
    21  
    22  ## Overview
    23  
    24  This collector monitors ProxySQL servers.
    25  
    26  
    27  
    28  
    29  This collector is supported on all platforms.
    30  
    31  This collector supports collecting metrics from multiple instances of this integration, including remote instances.
    32  
    33  
    34  ### Default Behavior
    35  
    36  #### Auto-Detection
    37  
    38  This integration doesn't support auto-detection.
    39  
    40  #### Limits
    41  
    42  The default configuration for this integration does not impose any limits on data collection.
    43  
    44  #### Performance Impact
    45  
    46  The default configuration for this integration is not expected to impose a significant performance impact on the system.
    47  
    48  
    49  ## Metrics
    50  
    51  Metrics grouped by *scope*.
    52  
    53  The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
    54  
    55  
    56  
    57  ### Per ProxySQL instance
    58  
    59  These metrics refer to the entire monitored application.
    60  
    61  This scope has no labels.
    62  
    63  Metrics:
    64  
    65  | Metric | Dimensions | Unit |
    66  |:------|:----------|:----|
    67  | proxysql.client_connections_count | connected, non_idle, hostgroup_locked | connections |
    68  | proxysql.client_connections_rate | created, aborted | connections/s |
    69  | proxysql.server_connections_count | connected | connections |
    70  | proxysql.server_connections_rate | created, aborted, delayed | connections/s |
    71  | proxysql.backends_traffic | recv, sent | B/s |
    72  | proxysql.clients_traffic | recv, sent | B/s |
    73  | proxysql.active_transactions_count | client | connections |
    74  | proxysql.questions_rate | questions | questions/s |
    75  | proxysql.slow_queries_rate | slow | queries/s |
    76  | proxysql.queries_rate | autocommit, autocommit_filtered, commit_filtered, rollback, rollback_filtered, backend_change_user, backend_init_db, backend_set_names, frontend_init_db, frontend_set_names, frontend_use_db | queries/s |
    77  | proxysql.backend_statements_count | total, unique | statements |
    78  | proxysql.backend_statements_rate | prepare, execute, close | statements/s |
    79  | proxysql.client_statements_count | total, unique | statements |
    80  | proxysql.client_statements_rate | prepare, execute, close | statements/s |
    81  | proxysql.cached_statements_count | cached | statements |
    82  | proxysql.query_cache_entries_count | entries | entries |
    83  | proxysql.query_cache_memory_used | used | B |
    84  | proxysql.query_cache_io | in, out | B/s |
    85  | proxysql.query_cache_requests_rate | read, write, read_success | requests/s |
    86  | proxysql.mysql_monitor_workers_count | workers, auxiliary | threads |
    87  | proxysql.mysql_monitor_workers_rate | started | workers/s |
    88  | proxysql.mysql_monitor_connect_checks_rate | succeed, failed | checks/s |
    89  | proxysql.mysql_monitor_ping_checks_rate | succeed, failed | checks/s |
    90  | proxysql.mysql_monitor_read_only_checks_rate | succeed, failed | checks/s |
    91  | proxysql.mysql_monitor_replication_lag_checks_rate | succeed, failed | checks/s |
    92  | proxysql.jemalloc_memory_used | active, allocated, mapped, metadata, resident, retained | B |
    93  | proxysql.memory_used | auth, sqlite3, query_digest, query_rules, firewall_users_table, firewall_users_config, firewall_rules_table, firewall_rules_config, mysql_threads, admin_threads, cluster_threads | B |
    94  | proxysql.uptime | uptime | seconds |
    95  
    96  ### Per command
    97  
    98  These metrics refer to the SQL command.
    99  
   100  Labels:
   101  
   102  | Label      | Description     |
   103  |:-----------|:----------------|
   104  | command | SQL command. |
   105  
   106  Metrics:
   107  
   108  | Metric | Dimensions | Unit |
   109  |:------|:----------|:----|
   110  | proxysql.mysql_command_execution_rate | uptime | seconds |
   111  | proxysql.mysql_command_execution_time | time | microseconds |
   112  | proxysql.mysql_command_execution_duration | 100us, 500us, 1ms, 5ms, 10ms, 50ms, 100ms, 500ms, 1s, 5s, 10s, +Inf | microseconds |
   113  
   114  ### Per user
   115  
   116  These metrics refer to the user.
   117  
   118  Labels:
   119  
   120  | Label      | Description     |
   121  |:-----------|:----------------|
   122  | user | username from the mysql_users table |
   123  
   124  Metrics:
   125  
   126  | Metric | Dimensions | Unit |
   127  |:------|:----------|:----|
   128  | proxysql.mysql_user_connections_utilization | used | percentage |
   129  | proxysql.mysql_user_connections_count | used | connections |
   130  
   131  ### Per backend
   132  
   133  These metrics refer to the backend server.
   134  
   135  Labels:
   136  
   137  | Label      | Description     |
   138  |:-----------|:----------------|
   139  | host | backend server host |
   140  | port | backend server port |
   141  
   142  Metrics:
   143  
   144  | Metric | Dimensions | Unit |
   145  |:------|:----------|:----|
   146  | proxysql.backend_status | online, shunned, offline_soft, offline_hard | status |
   147  | proxysql.backend_connections_usage | free, used | connections |
   148  | proxysql.backend_connections_rate | succeed, failed | connections/s |
   149  | proxysql.backend_queries_rate | queries | queries/s |
   150  | proxysql.backend_traffic | recv, send | B/s |
   151  | proxysql.backend_latency | latency | microseconds |
   152  
   153  
   154  
   155  ## Alerts
   156  
   157  There are no alerts configured by default for this integration.
   158  
   159  
   160  ## Setup
   161  
   162  ### Prerequisites
   163  
   164  No action required.
   165  
   166  ### Configuration
   167  
   168  #### File
   169  
   170  The configuration file name for this integration is `go.d/proxysql.conf`.
   171  
   172  
   173  You can edit the configuration file using the `edit-config` script from the
   174  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
   175  
   176  ```bash
   177  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   178  sudo ./edit-config go.d/proxysql.conf
   179  ```
   180  #### Options
   181  
   182  The following options can be defined globally: update_every, autodetection_retry.
   183  
   184  
   185  <details><summary>Config options</summary>
   186  
   187  | Name | Description | Default | Required |
   188  |:----|:-----------|:-------|:--------:|
   189  | update_every | Data collection frequency. | 5 | no |
   190  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   191  | dsn | Data Source Name. See [DSN syntax](https://github.com/go-sql-driver/mysql#dsn-data-source-name). | stats:stats@tcp(127.0.0.1:6032)/ | yes |
   192  | my.cnf | Specifies my.cnf file to read connection parameters from under the [client] section. |  | no |
   193  | timeout | Query timeout in seconds. | 1 | no |
   194  
   195  </details>
   196  
   197  #### Examples
   198  
   199  ##### TCP socket
   200  
   201  An example configuration.
   202  
   203  <details><summary>Config</summary>
   204  
   205  ```yaml
   206  jobs:
   207    - name: local
   208      dsn: stats:stats@tcp(127.0.0.1:6032)/
   209  
   210  ```
   211  </details>
   212  
   213  ##### my.cnf
   214  
   215  An example configuration.
   216  
   217  <details><summary>Config</summary>
   218  
   219  ```yaml
   220  jobs:
   221    - name: local
   222      my.cnf: '/etc/my.cnf'
   223  
   224  ```
   225  </details>
   226  
   227  ##### Multi-instance
   228  
   229  > **Note**: When you define multiple jobs, their names must be unique.
   230  
   231  Local and remote instances.
   232  
   233  
   234  <details><summary>Config</summary>
   235  
   236  ```yaml
   237  jobs:
   238    - name: local
   239      dsn: stats:stats@tcp(127.0.0.1:6032)/
   240  
   241    - name: remote
   242      dsn: stats:stats@tcp(203.0.113.0:6032)/
   243  
   244  ```
   245  </details>
   246  
   247  
   248  
   249  ## Troubleshooting
   250  
   251  ### Debug Mode
   252  
   253  To troubleshoot issues with the `proxysql` collector, run the `go.d.plugin` with the debug option enabled. The output
   254  should give you clues as to why the collector isn't working.
   255  
   256  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   257    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   258  
   259    ```bash
   260    cd /usr/libexec/netdata/plugins.d/
   261    ```
   262  
   263  - Switch to the `netdata` user.
   264  
   265    ```bash
   266    sudo -u netdata -s
   267    ```
   268  
   269  - Run the `go.d.plugin` to debug the collector:
   270  
   271    ```bash
   272    ./go.d.plugin -d -m proxysql
   273    ```
   274  
   275