Skip to content

inputs.mysql: field type conflict: input field "gtid_mode" - string vs integer #6646

@zarnovican

Description

@zarnovican

Relevant telegraf.conf:

[[inputs.mysql]]
  servers = ["monitoring:xxx@tcp(hostname:3306)/?tls=false"]
  metric_version = 2
  interval_slow = "1m"

System info:

Telegraf 1.12.4

Remote mysql version: 5.7.22-log, 5.7.26-log

The two mysql servers are Amazon RDS in master-slave setup. It should be reproducible outside AWS as well.

Steps to reproduce:

Monitor two mysql servers with different gtid_mode variable. One with boolean-like value and the other without.

mysql> show global variables like '%gtid_mode%';
+---------------+----------------+
| Variable_name | Value          |
+---------------+----------------+
| gtid_mode     | OFF_PERMISSIVE |
+---------------+----------------+
mysql> show global variables like '%gtid_mode%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_mode     | OFF   |
+---------------+-------+

Expected behavior:

No errors.

Actual behavior:

Nov 11 18:12:09 monitoring telegraf[8487]: 2019-11-11T18:12:09Z E! [outputs.influxdb] when writing to [https://influxdb.foo.com:8086]: received error partial write: field type conflict: input field "gtid_mode" on measurement "mysql_variables" is type string, already exists as type integer dropped=1; discarding points

Additional info:

From the MySQL doc, it seems that gtid_mode could contain four different values and should never be treated as boolean. I guess, that's where this integer is coming from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mysqlbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions