Fluentd pg_stat_statements plugin requires pg_read_all_stats role in Production
Follow on from production#5378 (comment 672710635)
Investigated in https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14404#note_702377666.
Previously investigated via gitlab-org&6235 (comment 624325008).
At present, the pg_stat_statements
fluentd plugin (source https://gitlab.com/gitlab-org/fluent-plugins/fluent-plugin-postgresql-csvlog), configured via the gitlab-fluentd cookbook (https://gitlab.com/gitlab-cookbooks/gitlab_fluentd/) is failing because the postgres user it is configured to run as, postgres_exporter
does not have the pg_read_all_stats
role granted.
This leads to invalid SQL statements being presented from the pg_stat_statements
view, which in turn leads to the fluentd plugin reporting that the queries are unparseable.
Staging
This access has already been granted in staging:
Staging
gitlabhq_production=# \du
List of roles
Role name | Attributes | Member of
----------------------------------+------------------------------------------------------------+---------------------
postgres_exporter | | {pg_read_all_stats}
Production
gitlabhq_production=> \du
List of roles
Role name | Attributes | Member of
-------------------+------------------------------------------------------------+-----------
postgres_exporter | | {}
Request
Grant postgres_exporter
the role pg_read_all_stats
on our Production cluster.
GRANT pg_read_all_stats to postgres_exporter;