Prerequisites
- A Bronto account and API key (how to create one)
- PostgreSQL writing logs to disk. The default
log_directorylives under the data directory; Debian/Ubuntu packages use/var/log/postgresql/ - An OpenTelemetry Collector (recommended) or Fluent Bit installed on the same host
postgresql.conf and reload:
postgresql.conf
Configure the Collector
PostgreSQL entries can span multiple lines (statements, context). Usemultiline keyed on the leading timestamp:
/etc/otel/config.yaml
<REGION> to eu or us.
What you will see in Bronto
Open Search and filter byservice.name = postgresql. Entries include slow-query lines (with duration and statement text), connection and disconnection events, errors, and warnings — each prefixed with a timestamp, process ID, and severity. Bronto’s Custom Parser extracts these fields server-side.
Troubleshooting
- Where are the logs? Run
SHOW log_directory;andSHOW log_filename;inpsql, or read$PGDATA/current_logfiles. Adjust theincludepath to match. - Want structured fields at the source? On PostgreSQL 15+, set
log_destination = 'jsonlog'for JSON log files (*.json) and pointincludeat them for direct field extraction. - For general issues, see OTel Collector troubleshooting.
Alternative: Fluent Bit
If you already run Fluent Bit, tail the PostgreSQL log files and forward them over HTTP:fluent-bit.conf
json_lines, not json. For statements that span lines, add a multiline.parser keyed on the leading timestamp. See Connect Fluent Bit to Bronto.
