Hello!
I'm setting up Metricbeats on Ubuntu 18.04 to track metrics for a MySQL database. Unfortunately, starting the agent fails with the following error:
May 02 11:08:07 ubuntu metricbeat[69057]: 2021-05-02T11:08:07.990+0530 ERROR instance/beat.go:971 Exiting: 1 error: missing required field accessing '0.queries' (source:'/etc/metricbeat/modules.d/mysql.yml')
Here's what the MySQL config for Metricbeats looks like:
# Module: mysql
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.x/metricbeat-module-mysql.html
- module: mysql
metricsets:
- status
#- galera_status
- performance
- query
period: 10s
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"
# or "unix(/var/lib/mysql/mysql.sock)/",
# or another DSN format supported by <https://github.com/Go-SQL-Driver/MySQL/>.
# The username and password can either be set in the DSN or using the username
# and password config options. Those specified in the DSN take precedence.
hosts: ["root:password@tcp(127.0.0.1:3306)/"]
# Username of hosts. Empty by default.
#username: root
# Password of hosts. Empty by default.
#password: secret
For the record, I'm using Metricbeat 7.12.1, with MySQL 5.7.33. So far I don't think there's anything iffy with the Elastic stack setup, because the same agent is also polling for metrics from MongoDB, Redis and RabbitMQ on the same machine. I believe the issue has been raised before too: Exiting: 1 error: missing required field accessing '0.queries' (source:'/etc/metricbeat/modules.d/mysql.yml'). Would love some tips here - thanks a ton!