Prometheus exporter vs OTLP for Temporal SDK metrics in multi-worker deployments

I just wrote up a detailed comparison of these two approaches, specifically for the case where you run multiple Temporal workers on the same host (bare metal, PM2, systemd).

The core issue is that the Prometheus exporter starts an in-process HTTP server. Scale to 2+ workers on the same machine → every worker tries to bind:9464 → EADDRINUSE. You can assign unique ports per worker, but now your Prometheus scrape config is tightly coupled to your process management.

The alternative: OTLP push to a shared OpenTelemetry Collector. All workers push to grpc://localhost:4317; the collector aggregates and serves Prometheus text format on:9464. One scrape target regardless of worker count—no port management.

The post includes:

\- Working OTel Collector config (OTLP receiver → batch processor → Prometheus exporter)

\- Docker Compose with proper resource limits

\- PM2 ecosystem config with per-worker service names

\- Startup guard script so the collector doesn't fail silently

\- Honest discussion about metrics loss when the collector is down

\- Comparison table of both approaches

[https://2ssk.medium.com/temporal-sdk-metrics-prometheus-exporter-vs-otlp-for-multi-worker-deployments-df9327b28fc5\](https://2ssk.medium.com/temporal-sdk-metrics-prometheus-exporter-vs-otlp-for-multi-worker-deployments-df9327b28fc5)

Would be interested to hear what others are using. I know K8s changes the equation since each worker is its own pod with its own port — Prometheus operator handles that well. But for bare metal / PM2 users, OTLP has been a big improvement.

TLDR: Prometheus exporter for single workers/Docker/K8s, OTLP for multi-worker on same host.

(GPT has been used to write this body.)

reddit.com
u/ban_rakash — 8 days ago

Using OTel Collector as a bridge between Temporal SDK workers and Prometheus

A practical example of using the OpenTelemetry Collector as an intermediary for Temporal SDK metrics.

The Temporal SDK supports both the Prometheus exporter (pull) and OTLP (push). If you're running multiple workers on the same host, the Prometheus exporter causes port conflicts. Switching to OTLP lets all workers push to a single collector, which then serves Prometheus HTTP for scraping.

https://2ssk.medium.com/temporal-sdk-metrics-prometheus-exporter-vs-otlp-for-multi-worker-deployments-df9327b28fc5

Would love feedback on the OTel collector config — any improvements for production?

reddit.com
u/ban_rakash — 9 days ago

Prometheus exporter vs OTLP for Temporal SDK metrics in multi-worker deployments

I just wrote up a detailed comparison of these two approaches, specifically for the case where you run multiple Temporal workers on the same host (bare metal, PM2, systemd).

The core issue is that the Prometheus exporter starts an in-process HTTP server. Scale to 2+ workers on the same machine → every worker tries to bind:9464 → EADDRINUSE. You can assign unique ports per worker, but now your Prometheus scrape config is tightly coupled to your process management.

The alternative: OTLP push to a shared OpenTelemetry Collector. All workers push to grpc://localhost:4317; the collector aggregates and serves Prometheus text format on:9464. One scrape target regardless of worker count—no port management.

The post includes:

- Working OTel Collector config (OTLP receiver → batch processor → Prometheus exporter)

- Docker Compose with proper resource limits

- PM2 ecosystem config with per-worker service names

- Startup guard script so the collector doesn't fail silently

- Honest discussion about metrics loss when the collector is down

- Comparison table of both approaches

https://2ssk.medium.com/temporal-sdk-metrics-prometheus-exporter-vs-otlp-for-multi-worker-deployments-df9327b28fc5

Would be interested to hear what others are using. I know K8s changes the equation since each worker is its own pod with its own port — Prometheus operator handles that well. But for bare metal / PM2 users, OTLP has been a big improvement.

TLDR: Prometheus exporter for single workers/Docker/K8s, OTLP for multi-worker on same host.

(GPT has been used to write this body.)

reddit.com
u/ban_rakash — 9 days ago

PostgreSQL 17 migration postmortem - (WAL recycling, replication lag, silent timeouts, and conservative tuning gone wrong)

I recently went through a fairly painful PostgreSQL 17 migration involving async replication, WAL retention issues, replica rebuilds, and long-running restore operations getting interrupted by timeout/configuration problems.

I wrote a detailed postmortem covering:

  • how replication lag gradually snowballed
  • WAL recycling failure modes
  • why conservative Docker/container limits backfired
  • timeout settings that caused silent failures
  • recovery/rebuild strategy
  • and the operational lessons I took away from it

Would genuinely appreciate feedback from people with more PostgreSQL operational experience.

Specifically interested in:

  • what you would have done differently
  • better approaches for large migrations with replicas
  • WAL retention/replay best practices
  • whether my diagnosis and conclusions make sense
  • and any obvious mistakes in the migration strategy

Blog:
https://2ssk.medium.com/a-postgresql-17-migration-postmortem-wal-recycling-silent-timeouts-and-the-false-economy-of-73fcf6cdd704

Would love to hear perspectives from people who run PostgreSQL at larger scale or have dealt with similar replication incidents.

reddit.com
u/ban_rakash — 1 month ago
▲ 89 r/neovim

Hi fellow Neovim users,

The title says it all. Can you share your workflow for resolving git conflicts in Neovim?

Thanks.

reddit.com
u/ban_rakash — 2 months ago

I recently spent time improving how I handle PostgreSQL backups and restores for Docker deployments, and one thing became clear:

Creating backups is easy.
Designing reliable recovery is hard.

Some lessons I learned while building this setup:

• Docker volumes are not backups
• A backup you’ve never restored is unverified
• Restore procedures matter more than backup commands
• Automation without validation creates false confidence

I documented the process across a 3-part write-up covering backup strategy, safe restoration, and automation.

I’m curious how others here approach this:

Do you actively test restore procedures or mostly rely on backup success logs?

(Sharing the write-up for anyone interested — feedback from people running PostgreSQL in production would be really valuable.)

Part 1 — Backup Strategy
https://2ssk.medium.com/docker-postgresql-backups-production-ready-strategy-part-1-of-3-28f1f287cf57

Part 2 — Safe Restore / Zero Data Loss
https://2ssk.medium.com/restoring-docker-postgresql-safely-zero-data-loss-procedures-part-2-of-3-89118133bd6f

Part 3 — Automation
https://2ssk.medium.com/automating-docker-postgresql-backups-with-cron-complete-guide-part-3-of-3-d0c3b61e2bee

u/ban_rakash — 2 months ago