---
title: "How We Export Postgres Logs to Third-Party Services"
description: "Neon exports customer Postgres logs by having Postgres write to rsyslogd alongside stderr, with rsyslogd pushing RFC 5424 syslog over TCP to an OpenTelemetry Collector that enriches and forwards them to Datadog or any OTLP-compatible platform."
url: "https://swe.quest/articles/how-we-export-postgres-logs-to-third-party-services-bed5372bbc749f83"
canonical: "https://neon.com/blog/logs-open-telemetry"
source: "Neon"
published: "2025-06-24"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["observability","postgres","kubernetes"]
---

# How We Export Postgres Logs to Third-Party Services

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-06-24, 4 min read, Case study. Original: [https://neon.com/blog/logs-open-telemetry](https://neon.com/blog/logs-open-telemetry)

## Summary

Neon exports customer Postgres logs by having Postgres write to rsyslogd alongside stderr, with rsyslogd pushing RFC 5424 syslog over TCP to an OpenTelemetry Collector that enriches and forwards them to Datadog or any OTLP-compatible platform. Scraping pods by label wasn't supported by the OTel Collector, and unstructured logs from multiple NeonVM processes made filtering unreliable, so they switched from pull to push. Roadblocks included rsyslogd requiring a restart rather than a config reload, and a k8sattributes bug fixed by a transform step that copies net.peer.ip into k8s.pod.ip for pod matching. The same rsyslogd instance also ships pg\_audit logs to secure storage for HIPAA customers.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)

## Prerequisites

- OpenTelemetry Collector basics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- syslog
- Kubernetes pods and labels ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))

## Keywords

Neon, rsyslogd, OpenTelemetry Collector, Datadog, RFC 5424, k8sattributes, pg\_audit, NeonVM

## Related posts

- [How We Export Metrics to Third-Party Services](https://swe.quest/articles/how-we-export-metrics-to-third-party-services-3378a3c9ceb725eb.md): Neon · 2025-06-24 · Medium · 4 min read · Observability, Kubernetes, PostgreSQL
  Neon streams Postgres and host metrics to Datadog, New Relic and any OTLP-compatible platform by running a per-project OpenTelemetry Collector colocated with compute pods in each region.
- [Change Data Capture with Serverless Postgres](https://swe.quest/articles/change-data-capture-with-serverless-postgres-4d667a8d26488042.md): Neon · 2023-12-21 · Medium · 7 min read · PostgreSQL, Replication, Event-driven architecture, Serverless
  Neon has released Postgres logical replication in beta, letting Neon databases act as publishers that stream an initial snapshot plus row-level changes to external stores for change data capture and real-time analytics.
- [Stream data from Neon to external data sources via logical replication](https://swe.quest/articles/stream-data-from-neon-to-external-data-sources-via-logical-replication-ba0a37ed2d47496f.md): Neon · 2024-08-09 · Medium · 7 min read · PostgreSQL, Replication, Event-driven architecture, Data pipelines
  Neon now supports outbound Postgres logical replication in beta, letting a Neon database publish WAL-decoded inserts, updates and deletes to warehouses, Kafka, CDC tools and other Postgres databases; inbound replication is coming later.
- [The Difference Between Postgres Logging and PGAudit](https://swe.quest/articles/the-difference-between-postgres-logging-and-pgaudit-3a35dae235b4a4b7.md): Neon · 2025-05-28 · Medium · 8 min read · PostgreSQL, Privacy, Security, Observability
  Postgres's built-in logging is designed for operational monitoring and troubleshooting, while PGAudit produces structured audit logs for compliance regimes like HIPAA, SOX and PCI DSS.
- [Postgres Meets Analytics: CDC From Neon to ClickHouse Via PeerDB](https://swe.quest/articles/postgres-meets-analytics-cdc-from-neon-to-clickhouse-via-peerdb-669fe8e963909dd5.md): Neon · 2024-10-02 · Medium · 5 min read · PostgreSQL, Event-driven architecture, Analytics & OLAP, Replication, Data pipelines
  Neon serverless Postgres can serve as the transactional system of record while ClickHouse handles real-time analytics, with PeerDB streaming changes between them via Postgres logical replication.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
