I’m trying to monitor MySQL using Prometheus, Docker and prom/mysqld-exporter. I have already searched many sites and follow all of them step by step, but unfortunately I didn’t get the result that I wanted.

There are two main problem:

I can’t even connect to mysql with user and password I defined in the docker-compose.yml file.

I have also checked the popular questions in stackoverflow like this one and tried all of them, but it still doesn’t work properly. I have also add command: mysqld --default-authentication-plugin=mysql_native_password to configuration of mysql in docker-compose file.

Whenever I set the DATA_SOURCE_NAME environment variable,I’ve faced with http timeout of the metrics on localhost:9104/metrics, whereas I can get localhost:9104 without any problem and while I add some flags but it doesn’t works!