Change database name for postgres-exporter to the gitlab gitlabhq_* database
Summary
postgres-exporter
references the postgres
database in /opt/gitlab/etc/postgres-exporter/env/DATA_SOURCE_NAME
and should reference the gitlabhq_*
database. Queries that depend on pg_class
or information_schema.tables
do not have visibility into the tables in gitlabhq_*
if the database name is set to postgres
current value of /opt/gitlab/etc/postgres-exporter/env/DATA_SOURCE_NAME
user=gitlab-psql host=/var/opt/gitlab/postgresql database=postgres
Steps to reproduce
root@gitlab:~# gitlab-psql
psql (10.9)
Type "help" for help.
gitlabhq_production=# select current_database(), count(1) from pg_class;
current_database | count
---------------------+-------
gitlabhq_production | 2491
(1 row)
gitlabhq_production=# select current_database(), count(1) from pg_class where relname = 'issues';
current_database | count
---------------------+-------
gitlabhq_production | 1
(1 row)
gitlabhq_production=# \c postgres
You are now connected to database "postgres" as user "gitlab-psql".
postgres=# select current_database(), count(1) from pg_class;
current_database | count
------------------+-------
postgres | 341
(1 row)
postgres=# select current_database(), count(1) from pg_class where relname = 'issues';
current_database | count
------------------+-------
postgres | 0
(1 row)
postgres=#
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs
Details of package version
Omnibus
Configuration details
Omnibus
Created to address a problem uncovered by !3771 (merged)