Skip to main content

MariaDB

Plugin: go.d.plugin Module: mysql

Overview

This collector monitors the health and performance of MySQL servers and collects general statistics, replication and user metrics.

It connects to the MySQL instance via a TCP or UNIX socket and executes the following commands:

Executed queries:

  • SELECT VERSION();
  • SHOW GLOBAL STATUS;
  • SHOW ENGINE INNODB STATUS;
  • SHOW GLOBAL VARIABLES;
  • SHOW SLAVE STATUS; or SHOW ALL SLAVES STATUS; (MariaDBv10.2+) or SHOW REPLICA STATUS; (MySQL 8.0.22+)
  • SHOW USER_STATISTICS; (MariaDBv10.1.1+)
  • SELECT TIME,USER FROM INFORMATION_SCHEMA.PROCESSLIST;

This collector is supported on all platforms.

This collector supports collecting metrics from multiple instances of this integration, including remote instances.

Default Behavior

Auto-Detection

By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP sockets:

  • 127.0.0.1:3306
  • "[::1]:3306"

Limits

The default configuration for this integration does not impose any limits on data collection.

Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

Metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Per MariaDB instance

These metrics refer to the entire monitored application.

This scope has no labels.

Metrics:

MetricDimensionsUnitMySQLMariaDBPercona
mysql.netin, outkilobits/s
mysql.queriesqueries, questions, slow_queriesqueries/s
mysql.queries_typeselect, delete, update, insert, replacequeries/s
mysql.handlerscommit, delete, prepare, read_first, read_key, read_next, read_prev, read_rnd, read_rnd_next, rollback, savepoint, savepointrollback, update, writehandlers/s
mysql.table_open_cache_overflowsopen_cacheoverflows/s
mysql.table_locksimmediate, waitedlocks/s
mysql.join_issuesfull_join, full_range_join, range, range_check, scanjoins/s
mysql.sort_issuesmerge_passes, range, scanissues/s
mysql.tmpdisk_tables, files, tablesevents/s
mysql.connectionsall, abortedconnections/s
mysql.connections_activeactive, limit, max_activeconnections
mysql.threadsconnected, cached, runningthreads
mysql.threads_createdcreatedthreads/s
mysql.thread_cache_missesmissesmisses
mysql.innodb_ioread, writeKiB/s
mysql.innodb_io_opsreads, writes, fsyncsoperations/s
mysql.innodb_io_pending_opsreads, writes, fsyncsoperations
mysql.innodb_logwaits, write_requests, writesoperations/s
mysql.innodb_redo_log_activityredo_written, checkpointedB/s
mysql.innodb_redo_log_occupancyoccupancypercentage
mysql.innodb_redo_log_checkpoint_ageageB
mysql.innodb_cur_row_lockcurrent waitsoperations
mysql.innodb_rowsinserted, read, updated, deletedoperations/s
mysql.innodb_buffer_pool_pagesdata, dirty, free, misc, totalpages
mysql.innodb_buffer_pool_pages_flushedflush_pagesrequests/s
mysql.innodb_buffer_pool_bytesdata, dirtyMiB
mysql.innodb_buffer_pool_read_aheadall, evictedpages/s
mysql.innodb_buffer_pool_read_ahead_rndread-aheadoperations/s
mysql.innodb_buffer_pool_opsdisk_reads, wait_freeoperations/s
mysql.innodb_os_logfsyncs, writesoperations
mysql.innodb_os_log_fsync_writesfsyncsoperations/s
mysql.innodb_os_log_iowriteKiB/s
mysql.innodb_deadlocksdeadlocksoperations/s
mysql.filesfilesfiles
mysql.files_ratefilesfiles/s
mysql.connection_errorsaccept, internal, max, peer_addr, select, tcpwraperrors/s
mysql.opened_tablestablestables/s
mysql.open_tablescache, tablestables
mysql.process_list_fetch_query_durationdurationmilliseconds
mysql.process_list_queries_countsystem, userqueries
mysql.process_list_longest_query_durationdurationseconds
mysql.qcache_opshits, lowmem_prunes, inserts, not_cachedqueries/s
mysql.qcachequeriesqueries
mysql.qcache_freememfreeMiB
mysql.qcache_memblocksfree, totalblocks
mysql.galera_writesetsrx, txwritesets/s
mysql.galera_bytesrx, txKiB/s
mysql.galera_queuerx, txwritesets
mysql.galera_conflictsbf_aborts, cert_failstransactions
mysql.galera_flow_controlpausedms
mysql.galera_cluster_statusprimary, non_primary, disconnectedstatus
mysql.galera_cluster_stateundefined, joining, donor, joined, synced, errorstate
mysql.galera_cluster_sizenodesnodes
mysql.galera_cluster_weightweightweight
mysql.galera_connectedconnectedboolean
mysql.galera_readyreadyboolean
mysql.galera_open_transactionsopentransactions
mysql.galera_thread_countthreadsthreads
mysql.key_blocksunused, used, not_flushedblocks
mysql.key_requestsreads, writesrequests/s
mysql.key_disk_opsreads, writesoperations/s
mysql.binlog_cachedisk, alltransactions/s
mysql.binlog_stmt_cachedisk, allstatements/s

Per connection

These metrics refer to the replication connection.

This scope has no labels.

Metrics:

MetricDimensionsUnitMySQLMariaDBPercona
mysql.slave_behindsecondsseconds
mysql.slave_statussql_running, io_runningboolean

Per user

These metrics refer to the MySQL user.

Labels:

LabelDescription
userusername

Metrics:

MetricDimensionsUnitMySQLMariaDBPercona
mysql.userstats_cpuusedpercentage
mysql.userstats_rowsread, sent, updated, inserted, deletedoperations/s
mysql.userstats_commandsselect, update, othercommands/s
mysql.userstats_denied_commandsdeniedcommands/s
mysql.userstats_created_transactionscommit, rollbacktransactions/s
mysql.userstats_binlog_writtenwrittenB/s
mysql.userstats_empty_queriesemptyqueries/s
mysql.userstats_connectionscreatedconnections/s
mysql.userstats_lost_connectionslostconnections/s
mysql.userstats_denied_connectionsdeniedconnections/s

Functions

This collector exposes real-time functions for interactive troubleshooting in the Top tab.

Top Queries

Retrieves aggregated SQL query performance metrics from MySQL performance_schema.events_statements_summary_by_digest table.

This function queries the events_statements_summary_by_digest table which contains aggregated statistics for SQL statements grouped by their digest (normalized query pattern). The function dynamically detects available columns based on your MySQL/MariaDB version.

Use cases:

  • Identify slow queries that consume the most execution time
  • Find frequently executed queries that may benefit from optimization
  • Detect queries with high lock time, errors, or table scans

Query text is truncated at 4096 characters for display purposes.

AspectDescription
NameMysql:top-queries
Require Cloudyes
PerformanceQueries the events_statements_summary_by_digest table:
• On busy servers with high query throughput, the digest table can grow large
• Default limit of 500 rows balances usefulness with performance
SecurityQuery text may contain unmasked literal values including potentially sensitive data:
• Personal information in WHERE clauses or INSERT values
• Business data and internal identifiers
• Access should be restricted to authorized personnel only
AvailabilityAvailable when:
• The collector has successfully connected to MySQL
• Performance Schema is enabled with statement digest collection
• Returns HTTP 503 if collector is still initializing
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out

Prerequisites

Enable performance_schema statement digest collection

Performance Schema must be enabled and statement instrumentation must be configured to collect digest statistics.

  1. Check if Performance Schema is enabled:

    SELECT @@performance_schema;
  2. Check statement instrumentation configuration:

    SELECT * FROM performance_schema.setup_consumers
    WHERE NAME LIKE '%statement%';
  3. The following consumer should be enabled:

    • events_statements_summary_by_digest
  4. Enable statement consumers if needed:

    UPDATE performance_schema.setup_consumers
    SET ENABLED = 'YES'
    WHERE NAME LIKE 'events_statements%';
    info
    • Changes to setup_consumers take effect immediately without requiring a server restart.
    • MariaDB also supports the events_statements_summary_by_digest table. Exact consumer names may vary by MariaDB version, so checking setup_consumers first as shown above is recommended.
  5. Verify digest table contains data:

    SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;

    Note: Statement digest data is accumulated since server startup or since the table was last truncated. To reset statistics:

    TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;

    Ensure that statement instruments are enabled in the Performance Schema so that statement digest statistics are collected. Refer to your MySQL or MariaDB version documentation for the appropriate configuration options.

Grant SELECT permission on Performance Schema tables

The netdata user must have SELECT permission on Performance Schema tables. The standard collector permissions (USAGE, REPLICATION CLIENT, PROCESS) do not automatically include Performance Schema access.

  1. Grant the required permission:

    GRANT SELECT ON performance_schema.* TO 'netdata'@'localhost';
    FLUSH PRIVILEGES;
    info

    The host part ('localhost') should match how the netdata user connects. If connecting via TCP/IP, you may need 'netdata'@'%' or a specific IP address instead.

  2. Verify access:

    -- As the netdata user:
    SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest;

Parameters

ParameterTypeDescriptionRequiredDefaultOptions
Filter ByselectSelect the primary sort column. The available options depend on your MySQL/MariaDB version and include metrics like total execution time, number of calls, lock time, errors, rows examined, and more. Defaults to total execution time.yestotalTime

Returns

Aggregated statement statistics from Performance Schema, grouped by query digest. Each row represents a unique query pattern with cumulative metrics across all executions.

ColumnTypeUnitVisibilityDescription
DigeststringhiddenUnique hash identifier for the normalized query pattern. Queries with the same structure (different literal values) share the same digest.
QuerystringNormalized SQL query text with literals replaced by placeholders (e.g., '?' for values). Truncated to 4096 characters.
SchemastringDatabase schema name where the query was executed. Empty string for queries without a schema context.
CallsintegerTotal number of times this query pattern has been executed since server startup or since the digest table was last truncated.
Total TimedurationmillisecondsCumulative execution time across all executions. High values indicate queries that consume significant server resources.
Min TimedurationmillisecondshiddenMinimum execution time observed for a single execution. Helps identify variability in query performance.
Avg TimedurationmillisecondsAverage execution time (total time divided by calls). Use this to compare performance across different query patterns.
Max TimedurationmillisecondshiddenMaximum execution time observed for a single execution. Large gaps between min and max may indicate performance instability.
Lock TimedurationmillisecondsTotal time spent waiting for table locks across all executions. High lock time may indicate contention from concurrent transactions.
ErrorsintegerTotal number of times this query pattern resulted in an error. Non-zero values require investigation into the underlying issue.
WarningsintegerTotal number of times this query pattern generated warnings. Warnings may indicate data type conversions, NULL handling issues, or other non-critical problems.
Error AttributionstringStatus of error detail attribution for this query. Values: enabled (error details available), no_data (no recent error for this digest), not_enabled (statement history consumers disabled), not_supported (required columns unavailable).
Error NumberintegerMost recent error number observed for this query digest (when error attribution is enabled).
SQL StatestringhiddenSQLSTATE code for the most recent error (when error attribution is enabled).
Error MessagestringMost recent error message for this query digest (when error attribution is enabled).
Rows AffectedintegerTotal number of rows modified by INSERT, UPDATE, DELETE, or REPLACE statements. Useful for tracking write workloads.
Rows SentintegerTotal number of rows returned to the client by SELECT statements. High values may indicate result sets that are too large.
Rows ExaminedintegerTotal number of rows read during query execution. A high ratio of rows examined to rows sent suggests missing or inefficient indexes.
Temp Disk TablesintegerTotal number of temporary tables created on disk across all executions. Disk-based temporary tables are significantly slower than in-memory tables and may indicate memory pressure or complex operations requiring sorting/grouping.
Temp TablesintegerTotal number of temporary tables created (both in-memory and on-disk). High values suggest frequent sorting, grouping, or DISTINCT operations.
Full JoinsintegerTotal number of joins that performed a full table scan without using an index. These are typically very expensive operations that should be optimized.
Full Range JoinsintegerhiddenTotal number of joins that used a range scan on the first table. Less efficient than indexed joins but better than full scans.
Select RangeintegerhiddenTotal number of joins that used a range on the first table for row selection.
Select Range CheckintegerhiddenTotal number of joins that checked each row after scanning for key ranges. Very inefficient operation.
Select ScanintegerTotal number of joins that performed a full scan of the first table. Indicates missing indexes or suboptimal join order.
Sort Merge PassesintegerhiddenTotal number of merge passes performed during sort operations. More passes indicate larger datasets that exceed sort buffer size.
Sort RangeintegerhiddenTotal number of sorts that used a range scan.
Sort RowsintegerTotal number of rows sorted across all executions. High values indicate frequent sorting operations on large datasets.
Sort ScanintegerhiddenTotal number of sorts that required a full table scan.
No Index UsedintegerTotal number of executions where no index was used for table access. These queries are prime candidates for index optimization.
No Good Index UsedintegerhiddenTotal number of executions where a non-optimal index was used. Indicates that while an index exists, a better one might improve performance.
First SeenstringhiddenTimestamp when this query pattern was first observed. Helps identify new queries that may have been introduced by application changes.
Last SeenstringhiddenTimestamp when this query pattern was last executed. Can help identify stale queries that are no longer in use.
P95 Timedurationmilliseconds95th percentile execution time. 95% of executions completed within this time. Available in MySQL 8.0+. Useful for understanding typical performance.
P99 Timedurationmilliseconds99th percentile execution time. 99% of executions completed within this time. Available in MySQL 8.0+. Helps identify outlier slow executions.
P99.9 Timedurationmillisecondshidden99.9th percentile execution time. Available in MySQL 8.0+. Identifies extreme outliers in query performance.
Sample QuerystringhiddenExample of an actual query execution with literal values preserved. Available in MySQL 8.0+. Helpful for understanding the exact queries being executed.
Sample SeenstringhiddenTimestamp when the sample query was captured. Available in MySQL 8.0+.
Sample TimedurationmillisecondshiddenExecution time of the captured sample query. Available in MySQL 8.0+.
CPU TimedurationmillisecondsTotal CPU time consumed across all executions. Available in MySQL 8.0.28+. Helps identify CPU-intensive queries.
Max Controlled MemoryintegerMaximum memory controlled by the query executor for this query pattern. Available in MySQL 8.0.31+. Helps identify memory-intensive operations.
Max Total MemoryintegerMaximum total memory used by this query pattern including both controlled and uncontrolled allocations. Available in MySQL 8.0.31+.

Deadlock Info

Retrieves the latest detected InnoDB deadlock from SHOW ENGINE INNODB STATUS.

The output is parsed to attribute the deadlock to the participating transactions and their query text, lock mode, lock status, and wait resource.

Use cases:

  • Identify which query was chosen as the deadlock victim
  • Inspect the waiting lock resource and lock mode
  • Correlate deadlocks with application changes or deployment events

Query text is truncated at 4096 characters for display purposes.

AspectDescription
NameMysql:deadlock-info
Require Cloudyes
PerformanceExecutes SHOW ENGINE INNODB STATUS on demand:
• Not part of regular collection
• Query cost depends on server load and the size of the InnoDB status output
SecurityQuery text and wait resource strings may include unmasked literal values including sensitive data (PII/secrets):
• SQL literals such as emails, IDs, or tokens
• Schema and table names that may be sensitive in some environments
• Restrict dashboard access to authorized personnel only
AvailabilityAvailable when:
• The collector has successfully connected to MySQL
deadlock_info_function_enabled is true
• The account can run SHOW ENGINE INNODB STATUS (PROCESS privilege)
• Returns HTTP 200 with empty data when no deadlock is found
• Returns HTTP 403 when PROCESS privilege is missing
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out
• Returns HTTP 561 when the deadlock section cannot be parsed
• Returns HTTP 503 if the collector is still initializing or the function is disabled

Prerequisites

Enable deadlock-info function in Netdata

Set deadlock_info_function_enabled: true in the go.d/mysql.conf job.

Grant PROCESS privilege

The monitoring user must have PROCESS privilege to run SHOW ENGINE INNODB STATUS.

Parameters

This function has no parameters.

Returns

Parsed deadlock participants from the latest detected deadlock. Each row represents one transaction involved in the deadlock.

ColumnTypeUnitVisibilityDescription
Row IDstringhiddenUnique row identifier composed of deadlock ID and process ID.
Deadlock IDstringIdentifier for the deadlock event, used to group participating transactions.
TimestamptimestampTimestamp of the deadlock event. Parsed from the deadlock section when available; otherwise the function execution time.
Process IDstringMySQL thread id of the transaction involved in the deadlock.
Connection IDintegerNumeric connection identifier when the process id is numeric.
ECIDintegerExecution context id (engine-specific). This is typically null for MySQL and reserved for cross-engine consistency.
Victimstring"true" when the transaction was chosen as the deadlock victim and rolled back; otherwise "false".
QuerystringSQL query text for the transaction involved in the deadlock. Truncated to 4096 characters.
Lock ModestringLock mode reported for the waiting lock (for example X or S).
Lock StatusstringLock status for the transaction. WAITING indicates the transaction was waiting on a lock.
Wait ResourcestringLock resource line from InnoDB status showing what the transaction was waiting on.
DatabasestringDatabase name when it can be inferred. This may be empty or null depending on the deadlock output.

Error Info

Retrieves recent SQL errors from Performance Schema statement history tables.

This function reads performance_schema.events_statements_history_long when enabled, otherwise falls back to performance_schema.events_statements_history. It reports the most recent error per query digest, including error number, SQLSTATE, and message.

Use cases:

  • Identify recent query errors and their messages
  • Correlate errors to query patterns (digest)
  • Validate error rates seen in top-queries

Error messages are truncated by Performance Schema (usually 128 characters).

AspectDescription
NameMysql:error-info
Require Cloudyes
PerformanceReads Performance Schema statement history tables on demand:
• Not part of regular collection
• Query cost depends on history table size and server load
SecurityError messages and query text may include unmasked literals (PII/secrets).
• Restrict dashboard access to authorized personnel only
AvailabilityAvailable when:
• The collector has successfully connected to MySQL
error_info_function_enabled is true
• Performance Schema statement history consumers are enabled (history and/or history_long)
• Returns HTTP 200 with empty data when no errors are found
• Returns HTTP 503 when required consumers are not enabled or function disabled
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out

Prerequisites

Enable error-info function in Netdata

Set error_info_function_enabled: true in the go.d/mysql.conf job.

Enable statement history consumers

Ensure events_statements_history and/or events_statements_history_long consumers are enabled.

Grant SELECT on Performance Schema

The monitoring user must have SELECT on performance_schema.* to read statement history tables.

Parameters

This function has no parameters.

Returns

Most recent error per query digest from Performance Schema history tables.

ColumnTypeUnitVisibilityDescription
DigeststringhiddenUnique hash identifier for the normalized query pattern.
QuerystringNormalized query text when available (digest text or SQL text).
SchemastringDatabase schema name when available.
Error NumberintegerMySQL error number for the most recent error of this digest.
SQL StatestringSQLSTATE code for the most recent error.
Error MessagestringError message for the most recent error.

Alerts

The following alerts are available:

Alert nameOn metricDescription
mysql_10s_slow_queries mysql.queriesnumber of slow queries in the last 10 seconds
mysql_10s_table_locks_immediate mysql.table_locksnumber of table immediate locks in the last 10 seconds
mysql_10s_table_locks_waited mysql.table_locksnumber of table waited locks in the last 10 seconds
mysql_10s_waited_locks_ratio mysql.table_locksratio of waited table locks over the last 10 seconds
mysql_connections mysql.connections_activeclient connections utilization
mysql_replication mysql.slave_statusreplication status (0: stopped, 1: working)
mysql_replication_lag mysql.slave_behinddifference between the timestamp of the latest transaction processed by the SQL thread and the timestamp of the same transaction when it was processed on the master
mysql_galera_cluster_size_max_2m mysql.galera_cluster_sizemaximum galera cluster size in the last 2 minutes starting one minute ago
mysql_galera_cluster_size mysql.galera_cluster_sizecurrent galera cluster size, compared to the maximum size in the last 2 minutes
mysql_galera_cluster_state_warn mysql.galera_cluster_stategalera node state is either Donor/Desynced or Joined
mysql_galera_cluster_state_crit mysql.galera_cluster_stategalera node state is either Undefined or Joining or Error
mysql_galera_cluster_status mysql.galera_cluster_statusgalera node is part of a nonoperational component. This occurs in cases of multiple membership changes that result in a loss of Quorum or in cases of split-brain situations.

Setup

You can configure the mysql collector in two ways:

MethodBest forHow to
UIFast setup without editing filesGo to Nodes → Configure this node → Collectors → Jobs, search for mysql, then click + to add a job.
FileIf you prefer configuring via file, or need to automate deployments (e.g., with Ansible)Edit go.d/mysql.conf and add a job.
important

UI configuration requires paid Netdata Cloud plan.

Prerequisites

Create netdata user

A user account should have the following permissions:

To create the netdata user with these permissions, execute the following in the MySQL shell:

  • MySQL and MariaDB < 10.5.9

    CREATE USER 'netdata'@'localhost';
    GRANT USAGE, REPLICATION CLIENT, PROCESS ON *.* TO 'netdata'@'localhost';
    FLUSH PRIVILEGES;
  • MariaDB >= 10.5.9

    For MariaDB 10.5.9 and later, use the SLAVE MONITOR privilege instead of REPLICATION CLIENT:

    CREATE USER 'netdata'@'localhost';
    GRANT USAGE, SLAVE MONITOR, PROCESS ON *.* TO 'netdata'@'localhost';
    FLUSH PRIVILEGES;

The netdata user will have the ability to connect to the MySQL server on localhost without a password. It will only be able to gather statistics without being able to alter or affect operations in any way.

Configuration

Options

The following options can be defined globally: update_every, autodetection_retry.

Config options
GroupOptionDescriptionDefaultRequired
Collectionupdate_everyData collection interval (seconds).5no
autodetection_retryAutodetection retry interval (seconds). Set 0 to disable.0no
TargetdsnMySQL server DSN (Data Source Name). See DSN syntax.root@tcp(localhost:3306)/yes
my.cnfPath to a my.cnf file to read connection settings from the [client] section.no
timeoutQuery timeout (seconds).1no
Virtual NodevnodeAssociates this data collection job with a Virtual Node.no

via UI

Configure the mysql collector from the Netdata web interface:

  1. Go to Nodes.
  2. Select the node where you want the mysql data-collection job to run and click the (Configure this node). That node will run the data collection.
  3. The Collectors → Jobs view opens by default.
  4. In the Search box, type mysql (or scroll the list) to locate the mysql collector.
  5. Click the + next to the mysql collector to add a new job.
  6. Fill in the job fields, then click Test to verify the configuration and Submit to save.
    • Test runs the job with the provided settings and shows whether data can be collected.
    • If it fails, an error message appears with details (for example, connection refused, timeout, or command execution errors), so you can adjust and retest.

via File

The configuration file name for this integration is go.d/mysql.conf.

The file format is YAML. Generally, the structure is:

update_every: 1
autodetection_retry: 0
jobs:
- name: some_name1
- name: some_name2

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/mysql.conf
Examples
TCP socket

An example configuration.

Config
jobs:
- name: local
dsn: netdata@tcp(127.0.0.1:3306)/

Unix socket

An example configuration.

Config
jobs:
- name: local
dsn: netdata@unix(/var/lib/mysql/mysql.sock)/

Connection with password

An example configuration.

Config
jobs:
- name: local
dsn: netconfig:password@tcp(127.0.0.1:3306)/

my.cnf

An example configuration.

Config
jobs:
- name: local
my.cnf: '/etc/my.cnf'

Multi-instance

Note: When you define multiple jobs, their names must be unique.

Local and remote instances.

Config
jobs:
- name: local
dsn: netdata@tcp(127.0.0.1:3306)/

- name: remote
dsn: netconfig:password@tcp(203.0.113.0:3306)/

Troubleshooting

Debug Mode

Important: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.

To troubleshoot issues with the mysql 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].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m mysql

    To debug a specific job:

    ./go.d.plugin -d -m mysql -j jobName

Getting Logs

If you're encountering problems with the mysql collector, follow these steps to retrieve logs and identify potential issues:

  • Run the command specific to your system (systemd, non-systemd, or Docker container).
  • Examine the output for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.

System with systemd

Use the following command to view logs generated since the last Netdata service restart:

journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep mysql

System without systemd

Locate the collector log file, typically at /var/log/netdata/collector.log, and use grep to filter for collector's name:

grep mysql /var/log/netdata/collector.log

Note: This method shows logs from all restarts. Focus on the latest entries for troubleshooting current issues.

Docker Container

If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:

docker logs netdata 2>&1 | grep mysql

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.