Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Datadog Tutorials: Datadog Agent integration with mysql databases?

How to setup Datadog Agent integration with mysql to collect many metrics from MySQL databases?

The Datadog Agent can collect many metrics from MySQL databases, including (but not limited to):

  • Query throughput
  • Query performance (e.g. average query run time, slow queries, etc.)
  • Connections (e.g. currently open connections, aborted connections, errors, etc.)
  • InnoDB (e.g. buffer pool metrics, etc.)

You can also create your own metrics using custom SQL queries.

The following metrics will be tracked by this integration:

NameUnitsDescription
mysql.binlog.cache_disk_usetransactionsThe number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.
mysql.binlog.cache_usetransactionsThe number of transactions that used the binary log cache.
mysql.binlog.disk_usebytesTotal binary log file size.
mysql.galera.wsrep_cert_deps_distanceShows the average distance between the lowest and highest sequence number, or seqno, values that the node can possibly apply in parallel.
mysql.galera.wsrep_cluster_sizenodesThe current number of nodes in the Galera cluster.
mysql.galera.wsrep_flow_control_pausedfractionsShows the fraction of the time, since FLUSH STATUS was last called, that the node paused due to Flow Control.
mysql.galera.wsrep_flow_control_paused_nsnanosecondsShows the pause time due to Flow Control, in nanoseconds.
mysql.galera.wsrep_flow_control_recvShows the number of times the galera node has received a pausing Flow Control message from others
mysql.galera.wsrep_flow_control_sentShows the number of times the galera node has sent a pausing Flow Control message to others
mysql.galera.wsrep_local_recv_queue_avgShows the average size of the local received queue since the last status query.
mysql.galera.wsrep_local_send_queue_avgShow an average for the send queue length since the last FLUSH STATUS query.
mysql.info.schema.sizemebibytesSize of schemas in MiB
mysql.innodb.buffer_pool_databytesThe total number of bytes in the InnoDB buffer pool containing data. The number includes both dirty and clean pages.
mysql.innodb.buffer_pool_dirtybytesThe total current number of bytes held in dirty pages in the InnoDB buffer pool.
mysql.innodb.buffer_pool_freepagesThe number of free pages in the InnoDB Buffer Pool.
mysql.innodb.buffer_pool_pages_datapagesThe number of pages in the InnoDB buffer pool containing data. The number includes both dirty and clean pages.
mysql.innodb.buffer_pool_pages_dirtypagesThe current number of dirty pages in the InnoDB buffer pool.
mysql.innodb.buffer_pool_pages_flushedpages/secondThe number of requests to flush pages from the InnoDB buffer pool.
mysql.innodb.buffer_pool_pages_freepagesThe number of free pages in the InnoDB buffer pool.
mysql.innodb.buffer_pool_pages_totalpagesThe total size of the InnoDB buffer pool, in pages.
mysql.innodb.buffer_pool_read_aheadpages/secondThe number of pages read into the InnoDB buffer pool by the read-ahead background thread.
mysql.innodb.buffer_pool_read_ahead_evictedpages/secondThe number of pages read into the InnoDB buffer pool by the read-ahead background thread that were subsequently evicted without having been accessed by queries.
mysql.innodb.buffer_pool_read_ahead_rndoperationsThe number of random read-aheads initiated by InnoDB. This happens when a query scans a large portion of a table but in random order.
mysql.innodb.buffer_pool_read_requestsreads/secondThe number of logical read requests.
mysql.innodb.buffer_pool_readsreads/secondThe number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from disk.
mysql.innodb.buffer_pool_totalpagesThe total number of pages in the InnoDB Buffer Pool.
mysql.innodb.buffer_pool_usedpagesThe number of used pages in the InnoDB Buffer Pool.
mysql.innodb.buffer_pool_utilizationfractionsThe utilization of the InnoDB Buffer Pool.
mysql.innodb.buffer_pool_wait_freewaitsWhen InnoDB needs to read or create a page and no clean pages are available, InnoDB flushes some dirty pages first and waits for that operation to finish. This counter counts instances of these waits.
mysql.innodb.buffer_pool_write_requestswrites/secondThe number of writes done to the InnoDB buffer pool.
mysql.innodb.checkpoint_ageCheckpoint age as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.current_row_lockslocksThe number of current row locks.
mysql.innodb.current_transactionstransactionsCurrent InnoDB transactions
mysql.innodb.data_fsyncsoperations/secondThe number of fsync() operations per second.
mysql.innodb.data_pending_fsyncsoperationsThe current number of pending fsync() operations.
mysql.innodb.data_pending_readsreadsThe current number of pending reads.
mysql.innodb.data_pending_writeswritesThe current number of pending writes.
mysql.innodb.data_readbytes/secondThe amount of data read per second.
mysql.innodb.data_readsreads/secondThe rate of data reads.
mysql.innodb.data_writeswrites/secondThe rate of data writes.
mysql.innodb.data_writtenbytes/secondThe amount of data written per second.
mysql.innodb.dblwr_pages_writtenpages/secondThe number of pages written per second to the doublewrite buffer.
mysql.innodb.dblwr_writesbytes/secondThe number of doublewrite operations performed per second.
mysql.innodb.hash_index_cells_totalTotal number of cells of the adaptive hash index
mysql.innodb.hash_index_cells_usedNumber of used cells of the adaptive hash index
mysql.innodb.history_list_lengthHistory list length as shown in the TRANSACTIONS section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.ibuf_free_listInsert buffer free list, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.ibuf_segment_sizeInsert buffer segment size, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.ibuf_sizeInsert buffer size, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.log_waitswaits/secondThe number of times that the log buffer was too small and a wait was required for it to be flushed before continuing.
mysql.innodb.log_write_requestswrites/secondThe number of write requests for the InnoDB redo log.
mysql.innodb.log_writeswrites/secondThe number of physical writes to the InnoDB redo log file.
mysql.innodb.lsn_currentLog sequence number as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.lsn_flushedFlushed up to log sequence number as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.lsn_last_checkpointLog sequence number last checkpoint as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_adaptive_hashbytesAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_additional_poolbytesAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_dictionarybytesAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_file_systemAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_lock_systemAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_page_hashAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_recovery_systemAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mem_totalbytesAs shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.mutex_os_waitsevents/secondThe rate of mutex OS waits.
mysql.innodb.mutex_spin_roundsevents/secondThe rate of mutex spin rounds.
mysql.innodb.mutex_spin_waitsevents/secondThe rate of mutex spin waits.
mysql.innodb.os_log_fsyncswrites/secondThe rate of fsync writes to the log file.
mysql.innodb.os_log_pending_fsyncsoperationsNumber of pending InnoDB log fsync (sync-to-disk) requests.
mysql.innodb.os_log_pending_writeswritesNumber of pending InnoDB log writes.
mysql.innodb.os_log_writtenbytes/secondNumber of bytes written to the InnoDB log.
mysql.innodb.pages_createdpages/secondNumber of InnoDB pages created.
mysql.innodb.pages_readpages/secondNumber of InnoDB pages read.
mysql.innodb.pages_writtenpages/secondNumber of InnoDB pages written.
mysql.innodb.pending_aio_log_iosAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_aio_sync_iosAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_buffer_pool_flushesflushesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_checkpoint_writesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_ibuf_aio_readsAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_log_flushesflushesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_log_writeswritesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_normal_aio_readsreadsAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.pending_normal_aio_writeswritesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.queries_insidequeriesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.queries_queuedqueriesAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.read_viewsAs shown in the FILE I/O section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.row_lock_current_waitsThe number of row locks currently being waited for by operations on InnoDB tables.
mysql.innodb.row_lock_timefractionsFraction of time spent (ms/s) acquiring row locks.
mysql.innodb.row_lock_waitsevents/secondThe number of times per second a row lock had to be waited for.
mysql.innodb.rows_deletedrows/secondNumber of rows deleted from InnoDB tables.
mysql.innodb.rows_insertedrows/secondNumber of rows inserted into InnoDB tables.
mysql.innodb.rows_readrows/secondNumber of rows read from InnoDB tables.
mysql.innodb.rows_updatedrows/secondNumber of rows updated in InnoDB tables.
mysql.innodb.s_lock_os_waits/secondAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output
mysql.innodb.s_lock_spin_rounds/secondAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.s_lock_spin_waitswaits/secondAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.x_lock_os_waitswaits/secondAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.x_lock_spin_roundsAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.
mysql.innodb.x_lock_spin_waitswaitsAs shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.
mysql.myisam.key_buffer_bytes_unflushedbytesMyISAM key buffer bytes unflushed.
mysql.myisam.key_buffer_bytes_usedbytesMyISAM key buffer bytes used.
mysql.myisam.key_buffer_sizebytesSize of the buffer used for index blocks.
mysql.myisam.key_read_requestsreads/secondThe number of requests to read a key block from the MyISAM key cache.
mysql.myisam.key_readsreads/secondThe number of physical reads of a key block from disk into the MyISAM key cache. If Key_reads is large, then your key_buffer_size value is probably too small. The cache miss rate can be calculated as Key_reads/Key_read_requests.
mysql.myisam.key_write_requestswrites/secondThe number of requests to write a key block to the MyISAM key cache.
mysql.myisam.key_writeswrites/secondThe number of physical writes of a key block from the MyISAM key cache to disk.
mysql.net.aborted_clientsconnections/secondThe number of connections that were aborted because the client died without closing the connection properly.
mysql.net.aborted_connectsconnections/secondThe number of failed attempts to connect to the MySQL server.
mysql.net.connectionsconnections/secondThe rate of connections to the server.
mysql.net.max_connectionsconnectionsThe maximum number of connections that have been in use simultaneously since the server started.
mysql.net.max_connections_availableconnectionsThe maximum permitted number of simultaneous client connections.
mysql.performance.bytes_receivedbytes/secondThe number of bytes received from all clients.
mysql.performance.bytes_sentbytes/secondThe number of bytes sent to all clients.
mysql.performance.com_deletequeries/secondThe rate of delete statements.
mysql.performance.com_delete_multiqueries/secondThe rate of delete-multi statements.
mysql.performance.com_insertqueries/secondThe rate of insert statements.
mysql.performance.com_insert_selectqueries/secondThe rate of insert-select statements.
mysql.performance.com_loadqueries/secondThe rate of load statements.
mysql.performance.com_replacequeries/secondThe rate of replace statements.
mysql.performance.com_replace_selectqueries/secondThe rate of replace-select statements.
mysql.performance.com_selectqueries/secondThe rate of select statements.
mysql.performance.com_updatequeries/secondThe rate of update statements.
mysql.performance.com_update_multiqueries/secondThe rate of update-multi.
mysql.performance.created_tmp_disk_tablestables/secondThe rate of internal on-disk temporary tables created by second by the server while executing statements.
mysql.performance.created_tmp_filesfiles/secondThe rate of temporary files created by second.
mysql.performance.created_tmp_tablestables/secondThe rate of internal temporary tables created by second by the server while executing statements.
mysql.performance.digest_95th_percentile.avg_usmicrosecondsQuery response time 95th percentile per schema.
mysql.performance.handler_commitoperations/secondThe number of internal COMMIT statements.
mysql.performance.handler_deleteoperations/secondThe number of internal DELETE statements.
mysql.performance.handler_prepareoperations/secondThe number of internal PREPARE statements.
mysql.performance.handler_read_firstoperations/secondThe number of internal READ_FIRST statements.
mysql.performance.handler_read_keyoperations/secondThe number of internal READ_KEY statements.
mysql.performance.handler_read_nextoperations/secondThe number of internal READ_NEXT statements.
mysql.performance.handler_read_prevoperations/secondThe number of internal READ_PREV statements.
mysql.performance.handler_read_rndoperations/secondThe number of internal READ_RND statements.
mysql.performance.handler_read_rnd_nextoperations/secondThe number of internal READ_RND_NEXT statements.
mysql.performance.handler_rollbackoperations/secondThe number of internal ROLLBACK statements.
mysql.performance.handler_updateoperations/secondThe number of internal UPDATE statements.
mysql.performance.handler_writeoperations/secondThe number of internal WRITE statements.
mysql.performance.kernel_timepercentPercentage of CPU time spent in kernel space by MySQL.
mysql.performance.key_cache_utilizationfractionsThe key cache utilization ratio.
mysql.performance.open_filesfilesThe number of open files.
mysql.performance.open_tablestablesThe number of of tables that are open.
mysql.performance.opened_tablestables/secondThe number of tables that have been opened. If Opened_tables is big, your table_open_cache value is probably too small.
mysql.performance.qcache.utilizationfractionsFraction of the query cache memory currently being used.
mysql.performance.qcache_free_blocksblocksThe number of free memory blocks in the query cache.
mysql.performance.qcache_free_memorybytesThe amount of free memory for the query cache.
mysql.performance.qcache_hitshits/secondThe rate of query cache hits.
mysql.performance.qcache_insertsqueries/secondThe number of queries added to the query cache.
mysql.performance.qcache_lowmem_prunesqueries/secondThe number of queries that were deleted from the query cache because of low memory.
mysql.performance.qcache_not_cachedqueries/secondThe number of noncached queries (not cacheable, or not cached due to the query_cache_type setting).
mysql.performance.qcache_queries_in_cachequeriesThe number of queries registered in the query cache.
mysql.performance.qcache_sizebytesThe amount of memory allocated for caching query results.
mysql.performance.qcache_total_blocksblocksThe total number of blocks in the query cache.
mysql.performance.queriesqueries/secondThe rate of queries.
mysql.performance.query_run_time.avgmicrosecondsAvg query response time per schema.
mysql.performance.questionsqueries/secondThe rate of statements executed by the server.
mysql.performance.select_full_joinoperations/secondThe number of joins that perform table scans because they do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.
mysql.performance.select_full_range_joinoperations/secondThe number of joins that used a range search on a reference table.
mysql.performance.select_rangeoperations/secondThe number of joins that used ranges on the first table. This is normally not a critical issue even if the value is quite large.
mysql.performance.select_range_checkoperations/secondThe number of joins without keys that check for key usage after each row. If this is not 0, you should carefully check the indexes of your tables.
mysql.performance.select_scanoperations/secondThe number of joins that did a full scan of the first table.
mysql.performance.slow_queriesqueries/secondThe rate of slow queries.
mysql.performance.sort_merge_passesoperations/secondThe number of merge passes that the sort algorithm has had to do. If this value is large, you should consider increasing the value of the sort_buffer_size system variable.
mysql.performance.sort_rangeoperations/secondThe number of sorts that were done using ranges.
mysql.performance.sort_rowsoperations/secondThe number of sorted rows.
mysql.performance.sort_scanoperations/secondThe number of sorts that were done by scanning the table.
mysql.performance.table_cache_hitshits/secondThe number of hits for open tables cache lookups.
mysql.performance.table_cache_missesmisses/secondThe number of misses for open tables cache lookups.
mysql.performance.table_locks_immediateThe number of times that a request for a table lock could be granted immediately.
mysql.performance.table_locks_waitedThe total number of times that a request for a table lock could not be granted immediately and a wait was needed.
mysql.performance.table_open_cacheThe number of open tables for all threads. Increasing this value increases the number of file descriptors that mysqld requires.
mysql.performance.thread_cache_sizebytesHow many threads the server should cache for reuse. When a client disconnects, the client’s threads are put in the cache if there are fewer than thread_cache_size threads there.
mysql.performance.threads_cachedthreadsThe number of threads in the thread cache.
mysql.performance.threads_connectedconnectionsThe number of currently open connections.
mysql.performance.threads_createdthreadsThe number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value.
mysql.performance.threads_runningthreadsThe number of threads that are not sleeping.
mysql.performance.user_timepercentPercentage of CPU time spent in user space by MySQL.
mysql.queries.countqueriesThe total count of executed queries per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.errorserrorsThe total count of queries run with an error per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.lock_timenanosecondsThe total time spent waiting on locks per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.no_good_index_usedqueriesThe total count of queries which used a sub-optimal index per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.no_index_usedqueriesThe total count of queries which do not use an index per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.rows_affectedrowsThe number of rows mutated per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.rows_examinedrowsThe number of rows examined per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.rows_sentrowsThe number of rows sent per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.select_full_joinThe total count of full table scans on a joined table per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.select_scanThe total count of full table scans on the first table per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.queries.timenanosecondsThe total query execution time per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.
mysql.replication.replicas_connectedNumber of replicas connected to a replication source.
mysql.replication.seconds_behind_mastersecondsThe lag in seconds between the master and the slave.
mysql.replication.slave_runningDeprecated. Use service check mysql.replication.replica_running instead. A boolean showing if this server is a replication slave / master that is running.
mysql.replication.slaves_connectedDeprecated. Use mysql.replication.replicas_connected instead. Number of slaves connected to a replication master.

Step 1 – Install Datadog Agent in Centos OR Ubuntu OR Windows

The MySQL check is included in the Datadog Agent package. No additional installation is needed on your MySQL server.

Step 2 – Install and Configure Mysql Server in Centos

Step 3 – Prepare MySQL. On each MySQL server, create a database user for the Datadog Agent:

# How to login mysql server?
$ mysql -h localhost -u root -p

mysql> CREATE USER 'datadog'@'localhost' IDENTIFIED BY '<UNIQUEPASSWORD>';
Query OK, 0 rows affected (0.00 sec)

For mySQL 8.0+ create the datadog user with the native password hashing method:

mysql> CREATE USER 'datadog'@'localhost' IDENTIFIED WITH mysql_native_password by '<UNIQUEPASSWORD>';
Query OK, 0 rows affected (0.00 sec)

Note: @'localhost' is only for local connections - use the hostname/IP of your Agent for remote connections. For more information, see the MySQL documentation.

Verify the user was created successfully using the following commands - replace <UNIQUEPASSWORD> with the password you created above:

mysql -u datadog --password=<UNIQUEPASSWORD> -e "show status" | \
grep Uptime && echo -e "3[0;32mMySQL user - OK3[0m" || \
echo -e "3[0;31mCannot connect to MySQL3[0m"

mysql -u datadog --password=<UNIQUEPASSWORD> -e "show slave status" && \
echo -e "3[0;32mMySQL grant - OK3[0m" || \
echo -e "3[0;31mMissing REPLICATION CLIENT grant3[0m"

Step 4 – The Agent needs a few privileges to collect metrics. Grant the user the following limited privileges ONLY:

mysql> GRANT REPLICATION CLIENT ON *.* TO 'datadog'@'localhost' WITH MAX_USER_CONNECTIONS 5;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> GRANT PROCESS ON *.* TO 'datadog'@'localhost';
Query OK, 0 rows affected (0.00 sec)

For MySQL 8.0+ set max_user_connections with:

mysql> ALTER USER 'datadog'@'localhost' WITH MAX_USER_CONNECTIONS 5;
Query OK, 0 rows affected (0.00 sec)

If enabled, metrics can be collected from the performance_schema database by granting an additional privilege:

mysql> show databases like 'performance_schema';
+-------------------------------+
| Database (performance_schema) |
+-------------------------------+
| performance_schema            |
+-------------------------------+
1 row in set (0.00 sec)

mysql> GRANT SELECT ON performance_schema.* TO 'datadog'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Step 5 – Configure Datadog agent to start collection mysql metrix.

Edit the mysql.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your MySQL metrics and logs. See the sample mysql.d/conf.yaml for all available configuration options.

$ cd /etc/datadog-agent/conf.d/mysql.d/
$ sudo cp conf.yaml.example conf.yaml
$ sudo vi conf.yaml (CHECK IMAGE BELOW)
$ sudo service datadog-agent restart [UBUNTU]
$ sudo systemctl restart datadog-agent [Centos]


Metric collection
Add this configuration block to your mysql.d/conf.yaml to collect your MySQL metrics:

init_config:

instances:
  - server: 127.0.0.1
    user: datadog
    pass: "<YOUR_CHOSEN_PASSWORD>" # from the CREATE USER step earlier
    port: "<YOUR_MYSQL_PORT>" # e.g. 3306
    options:
      replication: false
      galera_cluster: true
      extra_status_metrics: true
      extra_innodb_metrics: true
      extra_performance_metrics: true
      schema_size_metrics: false
      disable_innodb_metrics: false
Note: Wrap your password in single quotes in case a special character is present.

Step 5 – Validate mysql metrices

$ systemctl restart datadog-agent

$ datadog-agent status

MariaDB changes


mysql> CREATE USER 'datadog'@'%' IDENTIFIED BY 'Raju$123456';

mysql> GRANT REPLICATION CLIENT ON *.* TO 'datadog'@'%'
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER USER 'datadog'@'%' WITH MAX_USER_CONNECTIONS 5;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT PROCESS ON *.* TO 'datadog'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> show databases like 'performance_schema';
+-------------------------------+
| Database (performance_schema) |
+-------------------------------+
| performance_schema            |
+-------------------------------+
1 row in set (0.00 sec)

mysql> GRANT SELECT ON performance_schema.* TO 'datadog'@'%';

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x