MariaDB extension

  • Latest Dynatrace
  • Extension
  • Published Oct 27, 2025

Remotely monitor your MariaDB instances, collect key KPIs & slow queries details

Get started

Overview

Remotely monitor your MariaDB instances, and collect key KPIs.

Have an overview of the MariaDB extension data.

Requirements

1 Create a MariaDB user:

  1. Create a user that is identified by a native password, customize the username and password as you please
CREATE USER 'dynatrace'@'%' IDENTIFIED BY 'password';
  1. Give the user the permissions:
  • GRANT SELECT ON performance_schema.* TO 'dynatrace'@'%';
    • Allows the user to query the performance_schema schema
  • GRANT PROCESS ON *.* TO 'dynatrace'@'%';
    • Allows the user to see thread and connection metrics for other users
  • GRANT SHOW DATABASES ON *.* TO 'dynatrace'@'%';
    • Allows the user to see database metrics for all databases
  • GRANT SELECT ON sys.x$memory_global_by_current_bytes TO 'dynatrace'@'%';
    • Allow the user to query memory statistics
  • GRANT SLAVE MONITOR ON *.* TO 'dynatrace'@'%';
    • Allow the user to query slave/replica metrics

Due to a MariaDB limitation, to calculate database sizes you MUST grant SELECT permissions on the individual databases where you want to collect size from.

2 Collect Top Slow Queries:

This applies to top_queries feature set which retrieves data from performance_schema.events_statements_summary_by_digest:

  1. Enable the necessary statement instruments - this tells MariaDB to track all statements:
UPDATE performance_schema.setup_instruments
SET ENABLED = 'YES', TIMED = 'YES'
WHERE NAME LIKE 'statement/%';
  1. Enable the consumers - this tells MariaDB where to store the tracked statements:
UPDATE performance_schema.setup_consumers
SET ENABLED = 'YES'
WHERE NAME IN ('events_statements_history', 'events_statements_summary_by_digest');

While the above commands work, the most robust way to enable this on RDS is to create a custom Parameter Group. In the parameter group, set performance_schema to 1 and ensure the consumer settings are enabled. This ensures the configuration persists across restarts and instance modifications. Turn on the Performance Schema for Amazon RDS for MariaDB or MySQL - Amazon Relational Database Service

  • ActiveGate installed with version 1.295+

  • MariaDB JDBC Driver downloaded from Maria DB Downloads/)

  • Download the Java 8+ platform independent connector, and copy the jar file to this directory on all ActiveGates in your desired group

    • Windows: C:\ProgramData\dynatrace\remotepluginmodule\agent\conf\userdata\libs
    • Linux: /var/lib/dynatrace/remotepluginmodule/agent/conf/userdata/libs
  • Ensure dtuserag user has read access to driver

  • Add custom_code_jdbc_allowed=true to extensionsuser.conf:

  • Restart EEC service

  • Ensure you have the performance schema activated and enabled for the MariaDB instances you will be monitoring

Compatibility information

global_status and global_status_extended feature sets: MariaDB 10.5.2+

replicas and replica_error_logs feature sets: MariaDB 11.6+

Activation and setup

  • Activate Extension in the Hub by going to:
  • Extensions → MariaDB → Add to environment
  • Add a new monitoring configuration for every MariaDB instance you'd like to monitor.

Details

Licensing and cost

The formula for datapoints per minute from the extension is:

(69 * # of Instances) + (1 * # of Databases)

This can then be multiplied by 0.001 to get DDUs used per Minute or by 525600 to get datapoints per year.

If your license consists of Custom Metrics. Each custom metric is equivalent to 525.6 DDUs/yr. Please see documentation for Metric Cost Calculation.

This extension also ingests logs. To calculate consumption, refer to the documentation depending on your licensing:

FAQ

Why do I not see Waits metrics?

To gather wait metrics, data collection need to be enabled for the MariaDB instance, please refer to the documentation: https://dev.mysql.com/doc/mysql-perfschema-excerpt/8.0/en/performance-schema-wait-tables.html

I get an error "RSA public key is not available client side"

This means that the username is not identified by a native password, please refer to Get Started.

I cannot see Memory metrics

Make sure that data collection is enabled for your instance.

SELECT SUBSTRING_INDEX(event_name,'/',2) AS code_area,
SUM(current_alloc) AS current_alloc
FROM sys.x$memory_global_by_current_bytes
GROUP BY SUBSTRING_INDEX(event_name,'/',2)
ORDER BY SUM(current_alloc) DESC;
I cannot see slow queries

Refer to the Collecting Top Slow Queries in the Getting Started session.

Feature sets

When activating your extension using monitoring configuration, you can limit monitoring to one of the feature sets. To work properly the extension has to collect at least one metric after the activation.

In highly segmented networks, feature sets can reflect the segments of your environment. Then, when you create a monitoring configuration, you can select a feature set and a corresponding ActiveGate group that can connect to this particular segment.

All metrics that aren't categorized into any feature set are considered to be the default and are always reported.

A metric inherits the feature set of a subgroup, which in turn inherits the feature set of a group. Also, the feature set defined on the metric level overrides the feature set defined on the subgroup level, which in turn overrides the feature set defined on the group level.

replicaErrorLogs
Metric nameMetric keyDescription
waits
Metric nameMetric keyDescription
Waits IOmariadb.waits.waits_io.countThe number of times that the server has waited for an I/O operation to complete.
Waits IO Timemariadb.waits.waits_io_time.countThe total time the server has waited for I/O operations to complete.
Waits Syncmariadb.waits.waits_sync.countThe number of times that the server has waited for a synchronization operation to complete.
Waits Sync Timemariadb.waits.waits_sync_time.countThe total time the server has waited for synchronization operations to complete.
topQueries
Metric nameMetric keyDescription
infrastructure
Metric nameMetric keyDescription
Memorymariadb.infrastructure.memoryThe amount of memory used per each code area.
globalStatus
Metric nameMetric keyDescription
Queriesmariadb.global_status.queries.countThe number of statements executed by the server. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count COM_PING or COM_STATISTICS commands.
Slow Queriesmariadb.global_status.slow_queries.countThe number of queries that have taken more than long_query_time seconds. This counter increments regardless of whether the slow query log is enabled. For information about that log, see Section 5.4.5, The Slow Query Log.
Table Locks Waitedmariadb.global_status.table_locks_waited.countThe number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.
Table Locks Immediatemariadb.global_status.table_locks_immediate.countThe number of times that a request for a table lock could be granted immediately.
Current Connectionsmariadb.global_status.current_connectionsThe number of currently open connections.
Threads Runningmariadb.global_status.threads_runningThe number of threads that are not sleeping.
Threads Createdmariadb.global_status.threads_createdThe number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. The cache miss rate can be calculated as Threads_created/Connections.
Innodb Buffer Pool Pages Datamariadb.global_status.innodb_buffer_pool_pages_dataThe number of pages in the InnoDB buffer pool containing data. The number includes both dirty and clean pages. When using compressed tables, the reported Innodb_buffer_pool_pages_data value may be larger than Innodb_buffer_pool_pages_total
Innodb Buffer Pool Pages Dirtymariadb.global_status.innodb_buffer_pool_pages_dirtyThe current number of dirty pages in the InnoDB buffer pool.
Innodb Buffer Pool Pages Freemariadb.global_status.innodb_buffer_pool_pages_freeThe number of free pages in the InnoDB buffer pool.
Innodb Buffer Pool Pages Totalmariadb.global_status.innodb_buffer_pool_pages_totalThe total size of the InnoDB buffer pool, in pages. When using compressed tables, the reported Innodb_buffer_pool_pages_data value may be larger than Innodb_buffer_pool_pages_total
Innodb Data Readsmariadb.global_status.innodb_data_reads.countThe total number of data reads (OS file reads).
Innodb Data Writesmariadb.global_status.innodb_data_writes.countThe total number of data writes.
Innodb Data Readmariadb.global_status.innodb_data_read.countThe total amount of data read from files.
Innodb Data Writtenmariadb.global_status.innodb_data_written.countThe total amount of data written.
Innodb Buffer Pool Readsmariadb.global_status.innodb_buffer_pool_readsThe number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from disk.
Innodb Buffer Pool Read Requestsmariadb.global_status.innodb_buffer_pool_read_requestsThe number of logical read requests.
Availabilitymariadb.global_status.availabilityWhether or not a connection can be made to the database
Statusmariadb.global_status.statusA status of AVAILABLE is returned if we can query the database
Uptimemariadb.global_status.uptimeThe time in seconds that the mariadb server has been running since it was started.
Handler Rollbackmariadb.global_status.handler_rollback.countThe number of requests for a storage engine to perform a rollback operation.
Innodb Log Waitsmariadb.global_status.innodb_log_waits.countThe number of times that the log buffer was too small and a wait was required for it to be flushed before continuing.
Innodb Row Lock Current Waitsmariadb.global_status.innodb_row_lock_current_waitsThe number of row locks currently waited for by operations on InnoDB tables.
Innodb Row Lock Time (Avg)mariadb.global_status.innodb_row_lock_time_avgThe average time to acquire a row lock for InnoDB tables
Innodb Row Lock Waitsmariadb.global_status.innodb_row_lock_waits.countThe number of times operations on InnoDB tables had to wait for a row lock.
Opened Tablesmariadb.global_status.opened_tables.countThe number of tables that have been opened. If Opened_tables is big, your table_open_cache value is probably too small.
Open Filesmariadb.global_status.open_filesThe number of files that are open. This count includes regular files opened by the server. It does not include other types of files such as sockets or pipes. Also, the count does not include files that storage engines open using their own internal functions rather than asking the server level to do so.
Open Tablesmariadb.global_status.open_tablesThe number of tables that are open.
Query Cache Free Memorymariadb.global_status.qcache_free_memoryThe amount of free memory for the query cache.
Query Cache Hitsmariadb.global_status.qcache_hits.countThe number of query cache hits.
Query Cache not Cachedmariadb.global_status.qcache_not_cached.countThe number of noncached queries (not cacheable, or not cached due to the query_cache_type setting).
Aborted Clientsmariadb.global_status.aborted_clients.countThe number of connections that were aborted because the client died without closing the connection properly.
Aborted Connectsmariadb.global_status.aborted_connects.countThe number of failed attempts to connect to the MySQL server.
Connection Errors Max Connectionsmariadb.global_status.connection_errors_max_connections.countThe number of connections refused because the server max_connections limit was reached.
Max Used Connectionsmariadb.global_status.max_used_connectionsThe maximum number of connections that have been in use simultaneously since the server started.
Questionsmariadb.global_status.questions.countThe number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries variable. This variable does not count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or COM_STMT_RESET commands.
globalStatusExtended
Metric nameMetric keyDescription
Query Cache Queries in Cachemariadb.global_status.qcache_queries_in_cache.countThe number of queries registered in the query cache.
Query Cache Free Blocksmariadb.global_status.qcache_free_blocksThe number of free memory blocks in the query cache.
Query Cache Total Blocksmariadb.global_status.qcache_total_blocksThe total number of blocks in the query cache.
Created Temporary Tablesmariadb.global_status.created_tmp_tables.countThe number of internal temporary tables created by the server while executing statements. You can compare the number of internal on-disk temporary tables created to the total number of internal temporary tables created by comparing Created_tmp_disk_tables and Created_tmp_tables values.
Created Temporary Disk Tablesmariadb.global_status.created_tmp_disk_tables.countThe number of internal on-disk temporary tables created by the server while executing statements. You can compare the number of internal on-disk temporary tables created to the total number of internal temporary tables created by comparing Created_tmp_disk_tables and Created_tmp_tables values.
Innodb Buffer Pool Sizemariadb.global_status.innodb_buffer_pool_sizeThe size in bytes of the buffer pool, the memory area where InnoDB caches table and index data.
databases
Metric nameMetric keyDescription
Database Sizemariadb.databases.sizeThe size of the Database
replicas
Metric nameMetric keyDescription
Slave IO Runningmariadb.replica.slave_io_runningWhether the replica I/O thread is running and connected (Yes - 1), running but not connected to a primary (Connecting - 2) or not running (No - 0).
Slave SQL Runningmariadb.replica.slave_sql_runningWhether the SQL thread is running and connected (Yes - 1), running but not connected to a primary (Connecting - 2) or not running (No - 0).
Relay Log Spacemariadb.replica.relay_log_spaceTotal size of all relay log files combined.
Last IO Errnomariadb.replica.last_io_errnoError code of the most recent error that caused the I/O thread to stop (also recorded in the replica's error log). 0 means no error. RESET SLAVE or RESET MASTER will reset this value.
Last SQL Errnomariadb.replica.last_sql_errnoError code of the most recent error that caused the SQL thread to stop (also recorded in the replica's error log). 0 means no error. RESET SLAVE or RESET MASTER will reset this value.
Seconds Behind Mastermariadb.replica.seconds_behind_masterDifference between the timestamp logged on the master for the event that the replica is currently processing, and the current timestamp on the replica. Zero if the replica is not currently processing an event.
Read Master Log Positionmariadb.replica.read_master_log_posPosition up to which the I/O thread has read in the current primary binary log file.
Exec Master Log Positionmariadb.replica.exec_master_log_posPosition up to which the SQL thread has processed in the current master binary log file.
statements
Metric nameMetric keyDescription
Commitsmariadb.statements.commit.countThe number of COMMIT statements executed by this server
Deletesmariadb.statements.delete.countThe number of DELETE statements executed by this server
Multi-Table Deletesmariadb.statements.delete_multi.countThe number of multi-table DELETE statements executed by this server
Insertsmariadb.statements.insert.countThe number of INSERT statements executed by this server
Selectsmariadb.statements.select.countThe number of SELECT statements executed by this server
Updatesmariadb.statements.update.countThe number of UPDATE statements executed by this server
Executesmariadb.statements.execute.countThe number of EXECUTE statements executed by this server
Multi-Table Updatesmariadb.statements.update_multi.countThe number of multi-table UPDATE statements executed by this server
Bytes Sentmariadb.statements.bytes_sent.countThe number of bytes sent to all clients
Bytes Receivedmariadb.statements.bytes_received.countThe number of bytes received from all clients
Rollbacksmariadb.statements.rollback.countThe number of ROLLBACK statements executed by this server
Insert Selectsmariadb.statements.insert_select.countThe number of insert-select statements executed by this server
Replace Selectsmariadb.statements.replace_select.countThe number of replace-select statements executed by this server
Prepared Statementsmariadb.statements.prepared_stmt_count.countThe current number of prepared statements
Related tags
DatabaseSQLSQLMariaDBApplication Observability