You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to expand visibility into the state of our postgresql databases, the developer will expand the regular Celery-Beat status check to also include the current size of the psql database and it’s relation to the max storage of the db which is 1TB.
QA Notes
The developer should include a screenshot of the status check, with it now having the size of the database.
DEV Notes
In order to directly query the postgresql database from a django management command, you will likely want to use the {{connection.cursor().execute()}} method. See the official Django documentation [here|https://docs.djangoproject.com/en/5.1/topics/db/sql/#executing-custom-sql-directly].
The PSQL command that you will likely want to use is:
Where [DB_NAME] is the name of the database in question. We store the database name in an environment variable, but if you needed to find it within the context of a psql shell, you could use:
{{select datname from pg_database where datistemplate=false order by pg_database_size(datname) desc limit 1;}}
The database name is sensitive information, and it should not be hard-coded. It must be retrieved at run-time, either from an environment variable or from psql directly, whichever is more convenient.
In order to expand visibility into the state of our postgresql databases, the developer will expand the regular Celery-Beat status check to also include the current size of the psql database and it’s relation to the max storage of the db which is 1TB.
QA Notes
The developer should include a screenshot of the status check, with it now having the size of the database.
DEV Notes
In order to directly query the postgresql database from a django management command, you will likely want to use the {{connection.cursor().execute()}} method. See the official Django documentation [here|https://docs.djangoproject.com/en/5.1/topics/db/sql/#executing-custom-sql-directly].
The PSQL command that you will likely want to use is:
{{select pg_size_pretty(pg_database_size('[DB_NAME]'));}}
Where [DB_NAME] is the name of the database in question. We store the database name in an environment variable, but if you needed to find it within the context of a psql shell, you could use:
{{select datname from pg_database where datistemplate=false order by pg_database_size(datname) desc limit 1;}}
The database name is sensitive information, and it should not be hard-coded. It must be retrieved at run-time, either from an environment variable or from psql directly, whichever is more convenient.
Design
null
See full ticket and images here: FECFILE-1973
Pull Request: #1313
The text was updated successfully, but these errors were encountered: