Introduction

MySQL is a widely used relational database management system known for its performance, reliability, and ease of use. It is commonly used in various applications ranging from web applications to enterprise-level databases.

To monitor the MySQL efficiently, OpenTelemetry MySQL Receiver can be used to fetch key MySQL performance metrics.

Kubernetes 2.0 ConfigMap

Users should update or append the existing ConfigMap named opsramp-workload-metric-user-config by adding application-specific fields. These fields may include authentication credentials, collection frequency, and other relevant configurations.

apiVersion: v1
kind: ConfigMap
metadata:
  name: opsramp-workload-metric-user-config
  namespace: opsramp-agent
data:
  workloads: |
    mysql:
    - name: mysql1
      userName: 
        source: value
        value: username
      password: 
        source: value 
        value: password 
      port: 
        source: value 
        value: '3306' 
      targetPodSelector: 
        matchLabels: 
          - key: app 
            operator: exists
            value: 
              - mysql

Supported Metrics

Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.

MetricDescription
mysql_buffer_pool_data_pagesNumber of data pages in the MySQL buffer pool.
mysql_buffer_pool_operationsTotal number of operations performed on the MySQL buffer pool.
mysql_buffer_pool_page_flushesNumber of page flush operations performed on the MySQL buffer pool.
mysql_buffer_pool_pagesTotal number of pages in the MySQL buffer pool.
mysql_buffer_pool_usagePercentage of the MySQL buffer pool that is currently in use.
mysql_double_writesNumber of double writes performed in MySQL, typically related to crash recovery operations.
mysql_handlersNumber of handler operations performed by MySQL (e.g., read, write, etc.).
mysql_locksTotal number of locks held by MySQL.
mysql_log_operationsTotal number of operations performed on the MySQL transaction log.
mysql_mysqlx_connectionsTotal number of active MySQL X protocol connections.
mysql_opened_resourcesNumber of resources (e.g., tables, files) opened by MySQL.
mysql_operationsTotal number of operations executed by MySQL (queries, etc.).
mysql_page_operationsNumber of operations involving pages in MySQL (e.g., read/write operations on pages).
mysql_prepared_statementsNumber of prepared statements in MySQL.
mysql_row_locksTotal number of row-level locks acquired by MySQL.
mysql_row_operationsTotal number of row-level operations (inserts, updates, deletes) performed by MySQL.
mysql_sortsTotal number of sort operations performed by MySQL.
mysql_threadsTotal number of threads currently active in MySQL.
mysql_tmp_resourcesTotal number of temporary resources used by MySQL (e.g., temporary tables, files).
mysql_uptimeTime (in seconds) that the MySQL server has been running since the last restart.