PostgreSQL Server Exporter
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
The PostgreSQL Server Exporter allows you to export various PostgreSQL metrics.
For self-compiled installations, you must install and configure it yourself.
To enable the PostgreSQL Server Exporter:
-
Edit
/etc/gitlab/gitlab.rb
and enablepostgres_exporter
:postgres_exporter['enable'] = true
If PostgreSQL Server Exporter is configured on a separate node, make sure that the local address is listed in
trust_auth_cidr_addresses
or the exporter can’t connect to the database. -
Save the file and reconfigure GitLab for the changes to take effect.
Prometheus begins collecting performance data from
the PostgreSQL Server Exporter exposed under localhost:9187
.
Advanced configuration
In most cases, PostgreSQL Server Exporter works with the defaults and you should not need to change anything. To further customize the PostgreSQL Server Exporter, use the following configuration options:
-
Edit
/etc/gitlab/gitlab.rb
:# The name of the database to connect to. postgres_exporter['dbname'] = 'pgbouncer' # The user to sign in as. postgres_exporter['user'] = 'gitlab-psql' # The user's password. postgres_exporter['password'] = '' # The host to connect to. Values that start with '/' are for unix domain sockets # (default is 'localhost'). postgres_exporter['host'] = 'localhost' # The port to bind to (default is '5432'). postgres_exporter['port'] = 5432 # Whether or not to use SSL. Valid options are: # 'disable' (no SSL), # 'require' (always use SSL and skip verification, this is the default value), # 'verify-ca' (always use SSL and verify that the certificate presented by # the server was signed by a trusted CA), # 'verify-full' (always use SSL and verify that the certification presented # by the server was signed by a trusted CA and the server host name matches # the one in the certificate). postgres_exporter['sslmode'] = 'require' # An application_name to fall back to if one isn't provided. postgres_exporter['fallback_application_name'] = '' # Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely. postgres_exporter['connect_timeout'] = '' # Cert file location. The file must contain PEM encoded data. postgres_exporter['sslcert'] = 'ssl.crt' # Key file location. The file must contain PEM encoded data. postgres_exporter['sslkey'] = 'ssl.key' # The location of the root certificate file. The file must contain PEM encoded data. postgres_exporter['sslrootcert'] = 'ssl-root.crt'
-
Save the file and reconfigure GitLab for the changes to take effect.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support