# Enable PostgreSQL Data Collection

Kloudfuse integrates with PostgreSQL through the Datadog agent.

## Prerequisites

To enable the agent to collect metrics and logs from PostgreSQL, you must first install PostgreSQL in your environment.

## Add Monitoring Permissions to the Datadog Agent

Run the following commands:

```console
kubectl exec -it <pod> bash
psql -U postgres
enter password to complete login

create user datadog with password '<PASSWORD>';
grant pg_monitor to datadog;
grant SELECT ON pg_stat_database to datadog;
```

Copied!

## Annotate PostreSQL Pods

```yaml
      ad.datadoghq.com/mysql.check_names: '[]'
      ad.datadoghq.com/mysql.init_configs: '[{}]'
      ad.datadoghq.com/mysql.instances: '[{"host": "%%host%%", "port":5432, "username": "datadog", "password" : "<password>"}]'
```

yamlCopied!

After deploying PostgreSQL on Kubernetes, proceed to enable [GitHub Agent for Events](https://docs.kloudfuse.com/platform/3.4.0.p1/agent-github/).
