Is it possible to add datadog agent support to a postgres db in Aptible?

According to the install documentation - - you would need to modify conf.d/postgres.d/conf.yaml and postgresql.conf and create a read-only user?

Database containers cannot be accessed directly so software such as the Datadog agent cannot be added to the Database itself. However, based on the Install the Agent instructions it appears that it can query the Database remotely in order to monitor it. This can be accomplished by deploying the agent as an App on the same Stack and configuring it with the Database’s remote connection details via the conf.d/postgres.d/conf.yaml file. Since the agent is not running in the Database container, it cannot be used to collect logs but you can use a Log Drain to send your container logs to Datadog.

The rest of the steps can be completed by tunneling into the Database using the aptible db:tunnel CLI command and connecting to the Database with psql .

To configure the Database according to the Configure Postgres settings section, use the ALTER SYSTEM command and, to apply the settings, reload the Database with aptible db:reload . See our PostgreSQL Configuration documentation for more details. Currently, pg_stat_statements is included in shared_preload_libraries by default.

Everything else can be completed according to Datadog’s guide.

1 Like