# PostgreSQL

### Supported Platforms

| Platform | Metrics | Logs | Traces |
| -------- | ------- | ---- | ------ |
| Linux    | ✓       | ✓    |        |
| Windows  | ✓       | ✓    |        |
| macOS    | ✓       | ✓    |        |

### Prerequisites

This source supports PostgreSQL versions 10.18 and higher.

The monitoring user must be granted `SELECT` on `pg_stat_database`.

### Configuration Table

<table><thead><tr><th width="179.625">Parameter</th><th width="111.43359375">Type</th><th width="355.27734375">Default</th><th width="297.484375">Description</th></tr></thead><tbody><tr><td>telemetry_types</td><td><code>telemetrySelector</code></td><td><code>["Logs", "Metrics"]</code></td><td>Choose Telemetry Type.</td></tr><tr><td>postgresql_log_path</td><td><code>strings</code></td><td>For CentOS / RHEL: <code>- \"/var/log/postgresql/postgresql_.log\"</code> \nFor SLES: <code>- \"/var/lib/pgsql/data/log/postgresql_.log\"</code> \nFor Debian / Ubuntu: <code>- \"/var/lib/pgsql/_/data/log/postgresql_.log\"</code></td><td>Path to Postgres log file(s).</td></tr><tr><td>start_at</td><td><code>enum</code></td><td>end</td><td>Start reading the file from the 'beginning' or 'end'.</td></tr><tr><td>username*</td><td><code>string</code></td><td></td><td>Username used to authenticate.</td></tr><tr><td>password*</td><td><code>string</code></td><td></td><td>Password used to authenticate.</td></tr><tr><td>endpoint</td><td><code>string</code></td><td>localhost:5432</td><td>The endpoint of the Postgres server. If transport is set to unix, the endpoint will internally be translated from host:port to /host.s.PGSQL.port.</td></tr><tr><td>transport</td><td><code>enum</code></td><td>tcp</td><td>The transport protocol used to connect to Postgres. Valid values are <code>tcp</code>, or <code>unix</code>.</td></tr><tr><td>databases</td><td><code>strings</code></td><td></td><td>The list of databases for which the receiver will attempt to collect statistics. If an empty list is provided, the receiver will attempt to collect statistics for all databases.</td></tr><tr><td>collection_interval</td><td><code>int</code></td><td>60</td><td>Sets how often (seconds) to scrape for metrics.</td></tr><tr><td>enable_tls</td><td><code>bool</code></td><td>false</td><td>Whether or not to use TLS.</td></tr><tr><td>enable_tlsinsecure_skip_verify</td><td><code>bool</code></td><td>false</td><td>Enable to skip TLS certificate verification.</td></tr><tr><td>ca_file</td><td><code>string</code></td><td></td><td>Certificate authority used to validate the database server's TLS certificate.</td></tr><tr><td>cert_file</td><td><code>string</code></td><td></td><td>A TLS certificate used for client authentication, if mutual TLS is enabled.</td></tr><tr><td>key_file</td><td><code>string</code></td><td></td><td>A TLS private key used for client authentication, if mutual TLS is enabled.</td></tr></tbody></table>

<mark style="color:red;">\*</mark>*<mark style="color:red;">required field</mark>*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/postgresql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
