cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom MariaDB 10.3.5+ - Extension

rgarzon1
Champion

Disclaimer & Introduction

This document outlines the configuration for a custom MariaDB extension. Please note the following:

This extension was developed as a proof-of-concept for MariaDB monitoring, specifically because the existing official Dynatrace extension for MySQL did not fully meet the requirements or function as expected with MariaDB in our testing environment. The development involved adapting queries from the current MySQL extension to be compatible with MariaDB. Some queries were modified where the originals did not yield the necessary information from MariaDB.

Consider this extension to be in a beta phase. While it has been tested and is functional, it may not encompass all scenarios or have the same level of polish as an officially released product.

Regarding certificates for the extension:

  • You can upload the Certificate Authority (CA) to the Dynatrace credential vault.
  • Alternatively, and this is the recommended approach, you can follow the process to set up a local signing environment, generate your own certificates, and then upload your self-signed extension.

Should you have any questions regarding the certificate generation process or any other aspect of this extension, the official Dynatrace documentation provides clear guidance. However, feel free to reach out to me through this channel, Discord, or WhatsApp for assistance.

MariaDB Configuration for Dynatrace Extension

To ensure the proper functioning and comprehensive metric capture of your MariaDB/MySQL instance with the Dynatrace extension, the following configurations are necessary. These instructions are based on MariaDB version 10.11.9.

rgarzon1_0-1747903385679.png

rgarzon1_1-1747903397982.png

 

Enabling Essential Features in MariaDB

The following steps describe how to permanently enable the Slow Query Log and the Performance Schema. It is crucial to edit your MariaDB/MySQL server's configuration file (my.cnf or my.ini), adding the specified directives within the [mysqld] section.

1. Enable the Slow Query Log

This feature allows you to identify queries that exceed a defined time threshold, facilitating performance optimization.

  • Access the MariaDB/MySQL configuration file. Common locations are:

    • /etc/my.cnf
    • /etc/mysql/my.cnf
    • /usr/local/mysql/etc/my.cnf
    • ~/.my.cnf (in the user's home directory)
  • Add or modify the following lines under the [mysqld] section:

    Ini, TOML
     
    [mysqld]
    slow_query_log = ON
    slow_query_log_file = /var/log/mariadb/slow-query.log
    long_query_time = 1
    
    • slow_query_log = ON: Activates the slow query log.
    • slow_query_log_file: Specifies the path and filename where the logs will be stored. Ensure the directory exists and has the appropriate permissions.
    • long_query_time = 1: Sets the threshold in seconds. Queries taking longer than 1 second to execute will be logged.

2. Enable the Performance Schema

The Performance Schema provides detailed instrumentation about server execution, which is essential for advanced performance monitoring.

  • In the same configuration file (my.cnf or my.ini), add or edit the following line under the [mysqld] section:

    Ini, TOML
     
    [mysqld]
    performance_schema = ON
    
    • performance_schema = ON: Enables the Performance Schema.

3. Apply Changes

For the modifications in the configuration file to take effect, it is necessary to restart the MariaDB/MySQL service.

  • Execute the following command in your terminal (superuser privileges may be required):

    Bash
     
    sudo systemctl restart mariadb

    Or the equivalent command for your operating system if you are not using systemd (e.g., sudo service mysql restart).


Certificate Installation for the Extension

For the remote extension to function correctly in Dynatrace, it is essential to sign it with a developer root certificate. This certificate must be deployed on the ActiveGate that will run the extension.

  • Required Certificate CA.PEM: (It is assumed that the certificate will be provided or linked here (inside SharedCertificates.zip)  .
    The original Dynatrace documentation link is a general reference on signing extensions).

  • Option B: Deploying a Developer Root Certificate to the ActiveGate (For local signing) If you are signing the extension locally with your own developer certificate:

    1. Save your developer root certificate file.
    2. Copy the certificate file to the corresponding directory within your ActiveGate:
      • Linux: <CONFIG>/remotepluginmodule/agent/conf/certificates/ (Default: /var/lib/dynatrace/remotepluginmodule/agent/conf/certificates/)
      • Windows: %PROGRAMDATA%\dynatrace\remotepluginmodule\agent\conf\certificates\ For more details on signing extensions, refer to the .zip file).

MariaDB Version Considerations

  • Reference Version: The configuration and available metrics have been validated with MariaDB 10.11.9.
  • Compatibility with Older Versions: If you are using an older version, such as MariaDB 10.2.8, the extension should still function. However, it is important to note that some advanced performance metrics may not be available. This is because the Performance Schema in MariaDB versions prior to 10.3.5 did not include all the tables and instrumentation that more recent versions possess. It is recommended to consider upgrading your MariaDB instance to take full advantage of the monitoring capabilities.

Virus total Analisis: VirusTotal - File - da2f5329d551e0731af5f65794b2e5d17ab01698c9432cf6186d89939c94efd6

fuelled by coffee and curiosity.
0 REPLIES 0

Featured Posts