Skip to content

gather_innodb_metrics fails on MariaDB 10.5.4+ #7968

@jorgemorgado

Description

@jorgemorgado

Relevant telegraf.conf:

[[inputs.mysql]]
  gather_innodb_metrics = true

System info:

  • Linux 3.10.0-1127.18.2.el7.x86_64
  • MariaDB-server-10.5.4-1.el7.centos.x86_64

Steps to reproduce:

  1. Enable gather InnoDB metrics in Telegraf's inputs_mysql.conf plugin (gather_innodb_metrics = true)
  2. Restart Telegraf

Expected behaviour:

MySQL/MariaDB metrics successfully collected.

Actual behavior:

The following error will be reported:

E! [inputs.mysql] Error in plugin: Error 1054: Unknown column 'status' in 'where clause'

Additional info:

The problem is the following query in the mysql plugin:

innoDBMetricsQuery = `
SELECT NAME, COUNT
FROM information_schema.INNODB_METRICS
WHERE status='enabled'
`

The status column has changed in recent versions of MariaDB (not sure if it's the same for MySQL). The correct query should be:

innoDBMetricsQuery = `
SELECT NAME, COUNT
FROM information_schema.INNODB_METRICS
WHERE ENABLED=1;
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mysqlbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions