Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Case study mediumAdept

How We Export Metrics to Third-Party Services

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. Collectors are provisioned through the OTel Kubernetes Operator via a custom resource. Each one scrapes sql_exporter and Vector endpoints using Kubernetes pod service discovery filtered by project label, then applies memory limiting and batching before exporting. Per-project placement was chosen over per-user or per-org collectors to avoid cross-region scraping latency and to keep failure domains isolated, and the setup reuses the same scraping model as the internal vmagent/VictoriaMetrics monitoring pipeline.

Related posts

  • How We Export Postgres Logs to Third-Party Services

    Neon mediumAdept

    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.

  • Own Your Observability: Supabase Metrics API

    Supabase mediumAdept

    Supabase's Metrics API exposes roughly 200 Postgres health and performance metrics per project in Prometheus exposition format at a privileged endpoint authenticated with service-role Basic Auth, refreshed every minute. It can be scraped by Grafana Cloud, Datadog, AWS Managed Prometheus or any Prometheus-compatible backend, so database telemetry can be correlated with existing application observability. Suggested signals and alerts include connection saturation, CPU/memory above 80%, disk I/O wait, replication lag and post-deploy query regressions, plus using PgBouncer for bursty connection patterns.

  • OpenTelemetry Basics on Heroku Fir

    Heroku Engineering mediumAdept

    Heroku's Fir platform has OpenTelemetry built in and acts as the telemetry collector, so apps can forward platform logs, metrics and traces to any OTLP-compatible backend without running their own collector. After a brief primer on OpenTelemetry signals and the split between SDKs and collectors, a Go sample app is deployed to a Fir space and wired to Grafana Cloud. The setup takes Grafana's OTLP endpoint and auth headers, converts the headers to JSON with sed, and registers them with `heroku telemetry:add`. Metrics, router traces and logs then appear in Grafana within minutes.

  • Migrate Datadog telemetry with the OpenTelemetry Collector

    ClickHouse mediumAdept

    The OpenTelemetry Collector's Datadog receiver lets existing Datadog agents and SDKs send logs, traces and metrics to a Collector. The Collector translates them into the OpenTelemetry data model, and they can then be exported to any backend or dual-written alongside Datadog for side-by-side evaluation. ClickHouse contributed fixes upstream: proper log timestamps and severity mapping, promotion of resource attributes, reconstruction of 128-bit trace IDs for log-trace correlation, in-Collector JSON log decoding, and Zstandard support for Datadog Agent 7.59+. A worked example points a Datadog agent's datadog.yaml at ClickStack's Collector on port 8126. The receiver is still alpha: it is recommended for evaluating logs and traces, while metrics support covers only the v1/v2 intake endpoints and needs more testing.

  • Ensuring reliable OpenTelemetry ingestion at scale

    ClickHouse mediumAdept

    ClickHouse's LogHouse OpenTelemetry pipeline, ingesting 50 million events per second, absorbs database backpressure by failing over to S3 rather than buffering in memory, local WALs or Kafka. Collector file_storage WALs forced StatefulSets, drained slowly (about 4 hours per TiB) and queued fresh data behind backlog in FIFO order. The final design uses the OTel failoverconnector to route to ClickHouse first and spill to S3 only under backpressure, which limits PUT costs to outage windows. A separate scale-to-zero collector replays spilled blobs via SQS event notifications. Key details include disabling the ClickHouse exporter's sending queue so errors reach the connector, keeping inline retries, enabling the queue on the S3 exporter, and spreading keys across a wide keyspace to avoid prefix throttling.

The quest for software engineering knowledge.

Look:
Layout: