Can't see prepared queries in percona monitoring query analytics with MariaDB

I am currently experiencing an issue with the visibility of prepared queries in my query analytics tool for an application using the nodejs mysql2 library and MariaDB.

Application is using the execute method for performing queries. All these operations are working perfectly fine. However, these prepared queries are not visible in percona query analytics.

Performance schema in MariaDB is enabled.

MariaDB configuration

performance_schema=ON
performance_schema_instrument='statement/%=ON'
performance_schema_instrument='wait/%=ON'
performance_schema_instrument='memory/%=ON'
performance-schema-instrument='stage/%=ON'
performance-schema-consumer-statements-digest=ON
performance-schema-consumer-events_stages_current=ON
performance-schema-consumer-events_stages_history=ON
performance-schema-consumer-events_stages_history_long=ON
performance_schema_consumer_events_statements_current=ON
performance_schema_consumer_events_statements_history=ON
performance_schema_consumer_events_statements_history_long=ON
performance-schema-consumer-events_transactions_current=ON
performance-schema-consumer-events_transactions_history=ON
performance-schema-consumer-events_transactions_history_long=ON
performance-schema-consumer-events_waits_current=ON
performance-schema-consumer-events_waits_history=ON
performance-schema-consumer-events_waits_history_long=ON
innodb_monitor_enable=all
userstat=1

I know this is too much but I was just trying everything to make it work.

Mysql2 example query:

const pool = mysql.createPool({
  host: 'localhost',
  user: 'root',
  database: 'test'
});

pool.execute(
  'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',
  ['Rick C-137', 53],
  function(err, results, fields) {
  }
);

NodeJS Version: 20.2.0

Mysql2 Version: 3.3.1

MariaDB Version: 10.11.2

Hello @DarkGL! I appreciate your interest in PMM. Unfortunately, per [PMM-6578] Prepared statements support in PMM - Percona JIRA, prepared statements support in PMM hasn’t been implemented yet.

Hello @Roma_Novikov and @DarkGL, I’m encountering the same issue with Percona Server mySQL Database receiving queries from Gorm (Go applications). Is there any update or any workaround to make it work in PMM? I cannot use the slow query log since the Percona Server is in a docker container

I don’t think anything is happening. Status of the task on Jira is currently on hold. [PMM-6578] Prepared statements support in PMM - Percona JIRA

Thanks @DarkGL, did you find any workaround for your need? I’m afraid I may have to instrument the application instead

Unfortunately, I didn’t find anything :frowning_face:

That’s sad :frowning_face: It seems that no database monitoring tool is able to work with prepared statements in that way

I would suggest upvoting issues here Issue Navigator - Percona JIRA

1 Like