Skip to content

feat: log api-db/keycloak-db slow queries to stdout - #4129

Open
rocketeerbkw wants to merge 1 commit into
mainfrom
slow-query-log
Open

feat: log api-db/keycloak-db slow queries to stdout#4129
rocketeerbkw wants to merge 1 commit into
mainfrom
slow-query-log

Conversation

@rocketeerbkw

Copy link
Copy Markdown
Member

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

n/a

Description

The default for Lagoon db images is to log queries to /var/log which is not persistent and does not prevent endless growth.

This PR configures the slow query log (when enabled) to print to stdout so that they can be ingested by normal container log methods.

Closing issues

n/a


set -eo pipefail

if [ -n "$MARIADB_LOG_SLOW" ]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than have a MARIADB_ and MYSQL_ prefix on the variable, why not use APIDB_SLOW_LOG and KEYCLOAKDB_SLOW_LOG

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my only thing would be there is no way to turn it on for one or the other without doing some crafty chart changes with supporting logic for whether the chart is installing with mysql/mariadb and then keycloakdb/apidb

at least with isolation the chart logic is a bit simpler and the db type wouldn't matter.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw where you were going to use this, directly with env vars in the values. I guess it works in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants