-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activate slow query log in MySQL test setup #5186
Conversation
e07636f
to
c240324
Compare
@@ -28,4 +28,4 @@ setenv = | |||
8.0: MYSQL_VERSION=8.0 | |||
maria: COMPOSE_FILE=mariadb.yaml | |||
maria: MYSQL_FLAVOR=mariadb | |||
maria: MYSQL_VERSION=10.1.30-r1 | |||
maria: MYSQL_VERSION=10.1.43 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: I had to upgrade the image version because of a bug in the RC1 we were using - it wasn't able to read the my_custom.conf
config file properly due to a permission error.
@@ -7,6 +7,9 @@ services: | |||
- MYSQL_ALLOW_EMPTY_PASSWORD=1 | |||
ports: | |||
- "${MYSQL_PORT}:3306" | |||
volumes: | |||
# This is a supported conf location that isn't used by the image. | |||
- ${MYSQL_CONF_PATH}:/etc/my.cnf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: list of supported config files are documented here (table 4.2).
@@ -13,6 +13,8 @@ services: | |||
- MARIADB_DATABASE=my_database | |||
ports: | |||
- "${MYSQL_PORT}:3306" | |||
volumes: | |||
- ${MYSQL_CONF_PATH}:/bitnami/mariadb/conf/my_custom.cnf:ro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: the path to this config file is officially documented here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Just a comment about documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this will configure MySQL env to export and generate slow log reports, how does the agent get configured? There are some additional config files that need to be updated on the agent container. Maybe there needs to be another PR to handle broader log support via a ddev env start
option or flag?
Codecov Report
|
Thanks for the reviews! I pushed fixes in the latest commits.
Log collection by the agent is not automatically configured, indeed — the logs:
# ...
- type: file
path: /var/log/mysql/mysql-slow.log
source: mysql
sourcecategory: database
service: myapplication For development, I believe we don't need the Agent to collect logs, though. I went away with grabbing the output from the slow logs (e.g. in this case, using a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall.
Just a nit below.
What does this PR do?
Activate and configure slow query logs for the MySQL Docker Compose setup (for both MySQL and MariaDB flavors).
Motivation
This makes it much easier to test slow query logs locally. I essentially got tired of having to do the setup manually. :-)
Additional Notes
/
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached