Skip to content

Instantly share code, notes, and snippets.

@arsalanses
Last active January 15, 2024 13:18
Show Gist options
  • Select an option

  • Save arsalanses/d0452a132fe65095c104f55459b933c7 to your computer and use it in GitHub Desktop.

Select an option

Save arsalanses/d0452a132fe65095c104f55459b933c7 to your computer and use it in GitHub Desktop.
MySQL Exporter Quickstart and Dashboard
[client]
user=username
password=password
services:
mysqld-exporter:
image: prom/mysqld-exporter:latest
container_name: mysqld-exporter
environment:
- MYSQLD_EXPORTER_PASSWORD=password
- DATA_SOURCE_NAME="user:password@(db:3306)/database"
command:
- --mysqld.address=database:3306
- --mysqld.username=username
- --web.config.file=/cfg/webconfig.yml
# - --config.my-cnf=/cfg/.my.cnf
volumes:
- ./webconfig.yml:/cfg/webconfig.yml
# - ./config.my-cnf:/cfg/.my.cnf
ports:
- 9104:9104
links:
- db
depends_on:
- db
# https://grafana.com/grafana/dashboards/14057-mysql/
# echo 1234 | htpasswd -inBC 10 "" | tr -d ':\n'
basic_auth_users:
admin: $2y$10$DflJBSLBlS2z3d9rk6pdk.EadVxBVlXc084wPgCqoaW2T1KblOjyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment