Langfuse health and readiness endpoints for probes: what to check and when
A platform team running self-hosted Langfuse on Kubernetes sees pods restart during a brief PostgreSQL or ClickHouse failover, even though the database came back within moments. The usual cause is a liveness probe that depends on the database. When the database is briefly unreachable, the probe fails, the kubelet restarts the container, and the restart adds load and cold-start work at the moment the system is already degraded. The fix is to give each probe one job: liveness answers whether the process is alive and should be restarted, readiness answers whether the pod should receive traffic, and a load balancer check answers whether the target should stay in rotation. Langfuse Web and Langfuse Worker are separate containers, so each needs its own decision. Langfuse Web serves the UI and APIs and benefits from a readiness check that drops it from the load balancer during a dependency problem. Langfuse Worker processes asynchronous events, so its health check matters for restarts, not for routing.
Check whether your installed version exposes the health and readiness endpoints you plan to use, and confirm their paths, response codes and whether the database connectivity check is optional before you write any probe. Endpoint details can change between releases, so read the self-hosting documentation for the exact version you run, starting with the Langfuse self-hosting docs. Confirm also what each endpoint checks (process only, or database and other dependencies), since a probe that tests the database will behave very differently during a failover than one that tests only the process. Record the answer in your runbook.
This work matters most for production clusters, for Langfuse behind a shared load balancer where unhealthy targets affect other services, and for teams whose on-call runbook depends on restart counts being meaningful. A single-VM test deployment with no high availability gains little from these settings. Plan the probe design together with startup time, since slow migrations or cold starts can trigger premature liveness failures if the initial delay is too short. Ask your platform or Langfuse-experienced engineers to test failover in a non-production cluster before the probes go live, and to confirm the thresholds with the database owners who know their real failover times.
Which endpoint each component should answer to
Langfuse Web serves the UI and the APIs that SDKs and users call, so its probes decide whether traffic reaches a given replica. A liveness check tells the orchestrator whether the process is stuck and should be restarted. A readiness check tells the Service or load balancer whether this replica should receive requests now. For web, readiness matters most for user-facing errors, and liveness should be lenient so a slow dependency does not trigger restarts.
- What it protects against: Requests reaching a replica that cannot reach PostgreSQL, ClickHouse or Redis or Valkey, which surfaces as errors for SDKs and users.
- Failed readiness: The pod is removed from Service endpoints and stops receiving traffic, but it keeps running and is checked again.
- Failed liveness: The container restarts, which drops in-flight requests and adds load during a rollout.
- Database check option: Confirm whether your version offers an optional database connectivity check on the health endpoint and whether it is off by default before you use it for readiness.
- Release notes: Confirm the endpoint path, query options and response codes for the version in use in the Langfuse releases notes, since they have changed across major versions.
Before go-live, stop the database briefly in a test environment and confirm that web readiness fails while liveness stays healthy.
Langfuse Worker processes asynchronous events and receives no direct user traffic, so its probes work differently from web. Nothing is routed to it through a Service, which means a failed readiness check mostly affects rollout status and dashboards. The more consequential decision is liveness, because a restart interrupts work that is already in progress and can slow the backlog from clearing.
- What it protects against: A worker that is running but has lost its connection to Redis or Valkey, ClickHouse or blob storage, so events wait in the queue unprocessed.
- Readiness on a worker: Without a Service in front, a failed readiness check blocks rollout progress and marks the pod unready, but it does not stop traffic.
- Liveness on a worker: A restart interrupts processing, and repeated restarts during a backlog extend catch-up time.
- Scaling interaction: Autoscalers that read CPU can misread a restarting worker, so keep probe failures rare to keep scaling signals meaningful.
- Release notes: Confirm whether the version in use exposes a worker health endpoint at all, how it reports queue connectivity, and how interrupted jobs are handled on restart.
Before relying on the worker probe, pause ingestion in a test environment, let a backlog build and confirm the probe fails only when the worker truly cannot process events.
The load balancer in front of Langfuse Web decides which replicas receive traffic. Its health check should exercise the same readiness behavior as the web probe, not only an open TCP port, because a replica can accept connections while returning errors. A failed check removes the target from rotation without restarting anything, so a failure across all replicas leaves no targets and users see gateway errors.
- What it protects against: Routing to a web replica that accepts TCP connections but cannot serve requests, which a port-only check would miss.
- Check path and codes: Point the health check at the web readiness path and accept only the success codes documented for your Langfuse version.
- Timing and thresholds: Set the interval, timeout and unhealthy threshold so a brief database interruption does not drain every replica at once. Confirm values against your load balancer's documentation and your own test results.
- Timeout alignment: Confirm that the load balancer's idle timeout is longer than the keep-alive timeout on Langfuse Web, since a mismatch causes intermittent 502 and 504 errors.
- Release notes: Recheck the health path and response behavior after each upgrade, because a changed path silently marks every target unhealthy.
After each upgrade, confirm in a staging environment that all web targets report healthy before the production change window closes.
Probe configuration options and when each fits
This table compares liveness-only probes, readiness with a database check, and load balancer health checks, along with the startup and worker probes configured alongside them. Read each row by the restart and traffic-removal behavior it produces during a database outage. The main takeaway is to keep the database check in readiness, where it only removes pods from traffic, so a short outage does not restart healthy containers.
| Option | What it checks | When it fits | Trade-off and settings to confirm |
|---|---|---|---|
| Liveness only | The web or worker process still responds | Restarting hung processes, with no view of PostgreSQL or ClickHouse | Restarts do not fix a database outage. Confirm the liveness path, period and failure threshold in your values. |
| Readiness with database check | The process responds and can reach its database | Removing pods from traffic while the database is unreachable | A short database failover can make all pods unready at once, returning errors without restarts. Confirm the database check option in your chart version. |
| Liveness with database check | Process health plus database connectivity | Rarely, such as a deliberate test of a stuck pod that has no other signal | A short database outage can restart healthy containers and deepen the incident. Avoid it unless you have measured the failover window. |
| Load balancer health check | An HTTP request to the web path from outside the pod | Cloud or ingress load balancers that route only to healthy targets | Interval, timeout and unhealthy threshold must match your keep-alive and idle timeouts. Confirm the path and thresholds with your load balancer. |
| Startup probe | Whether the container has finished booting | Updates within a major version, where migrations run automatically at startup | Without a startup allowance, liveness can kill a container mid-migration. Confirm the startup failure budget against your migration run time. |
| Worker health check | Worker process liveness and any worker endpoint your version exposes | Worker pods that consume the ingestion queue | Confirm whether your worker version exposes a health endpoint. If it does not, rely on process liveness and queue metrics. |
Wiring the probes into a Langfuse deployment
This sequence confirms which health endpoints your Langfuse version exposes, sets probe timing from measured startup, and checks that a short database interruption does not trigger restarts. The result is a probe configuration you have tested against your own deployment.
Confirm the health endpoints for your version
The platform engineer deploying Langfuse checks the Langfuse self-hosting documentation for the health endpoints that your release exposes on Langfuse Web and Langfuse Worker. Record each path, port and expected success response in the deployment repository. Confirm the paths against the running version, not against older examples you may find online. Done when a manual request to each endpoint returns the documented success response from inside the cluster.
Measure startup time including migrations
The platform engineer starts Langfuse Web and Langfuse Worker in a non-production environment with the same image, database sizes and resource limits planned for production. Langfuse applies database migrations automatically at startup within a major version, so the measured time must include those migrations, and a restored database with production-like size gives a more useful number than an empty one. Record how long each container takes to report healthy after its process starts. Done when you have a measured startup time for each container and a note of which migration runs took longest.
Set initial delay and period values
The platform engineer sets the readiness and liveness initial delay and period values for each container with a margin above the measured startup time. A liveness probe that fires before migrations finish can restart the container in a loop, so liveness settings should be more lenient than readiness settings. Write the values into the Helm values or manifests with a comment that cites the measurement date and version. Done when a fresh rollout of the deployment reaches ready state without any restarts during startup.
Configure the database connectivity option
The platform engineer checks whether the deployed version offers a health option that includes database connectivity, and confirms how it is enabled and what it reports. If the option exists, the engineer decides whether it belongs on readiness, which removes a pod from traffic, or on liveness, which restarts it, and records that decision. If the version does not offer the option, the engineer keeps the readiness probe on the basic endpoint and relies on database monitoring for alerts. Done when the chosen option is set, and a test request shows the expected behavior when the database is reachable.
Point load balancer checks at the web endpoint
The platform engineer points the load balancer or ingress health check at the Langfuse Web health endpoint, with a check interval, timeout and unhealthy threshold that match the measured startup behavior. The check should not depend on the worker, because the worker serves no user traffic. Confirm that the load balancer marks the targets healthy only after the web container reports ready. Done when the load balancer target group shows all web targets healthy and removing one container from service moves it to unhealthy within the configured threshold.
Simulate a short database interruption
The platform engineer, in a test environment only, blocks connections from Langfuse to PostgreSQL for a short period, then restores them, while recording the state of each probe and the container restart count. Run the same test against ClickHouse and Redis or Valkey if those are in the deployment, because their outages affect ingestion differently. Watch for restarts, unhealthy targets that stay unhealthy after recovery and error spikes in container logs. Done when the test shows no restarts from the interruption, the endpoints recover on their own after the connection returns, and the results are saved with the probe configuration.
Which checks can restart a pod during a database outage
The diagram starts with the kubelet and the load balancer, which call health endpoints on Langfuse Web and Langfuse Worker. Each container also reaches PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible storage, so a probe that tests those dependencies can fail when only one store is down. A failed kubelet check leads to a container restart, while a failed load balancer check removes the target from rotation. Before you wire the probes, confirm in your Langfuse version which dependencies each endpoint tests and whether the database connectivity option is available.
Probe callers, Langfuse containers and the data stores they depend on.
Why restarts during short database outages make things worse
A short database outage is usually recoverable without intervention, but orchestrators often treat it as an application failure. Each card below describes a way that a restart, triggered by a failing probe, turns a brief dependency problem into a longer incident for Langfuse web, worker and the stores behind them.
Restart loops that add load
When liveness probes call the database, every Langfuse web and worker container restarts during an outage. When PostgreSQL or ClickHouse returns, all containers start together, run their startup work and open connections at once, which can overload the database a second time. Keep liveness checks local to the process and reserve database checks for readiness. Test by stopping PostgreSQL for a few minutes in staging and watching restart counts and connection totals as it comes back.
Migrations interrupted at startup
Within a major version, Langfuse applies database migrations automatically at startup. If a probe or the orchestrator kills a container while a migration runs, the schema can be left partly changed, and the next start has to resolve that state. Set startup probes with enough time for migrations, and confirm with your release notes how a restarted migration behaves before you upgrade. Test by terminating a container during a migration in a copy of your environment, then checking that the next start completes cleanly.
Langfuse upgrade guideStale connection pools
After a database failover or network interruption, existing pooled connections can point at sockets that no longer work. The application may keep reporting ready while requests fail, or it may fail readiness long after the database is back. Confirm the connection timeout and validation behavior of the Langfuse release you run, and set pool lifetimes that suit your database proxy or failover method. Test by forcing a failover in staging and checking whether requests recover without a manual restart of web or worker.
Workers that drop in-flight events
Langfuse Worker processes asynchronous events, so a worker restarted mid-batch may leave events half processed. Whether those events are retried, redelivered or lost depends on the queue and retry settings in your release, which you should confirm with the vendor before relying on them. Coordinate worker rollouts and graceful shutdown periods with your queue behavior. Test by restarting a worker under steady ingestion, then comparing trace counts in the UI and blob storage with the number of events the SDKs sent.
Alerts that hide the real fault
When restarts are the only signal, an alert on pod restarts fires after the database has already been unavailable, and the restarts themselves look like application instability. Operators then investigate the containers instead of PostgreSQL, ClickHouse or blob storage. Alert on the dependency errors and ingestion backlog directly, and treat restart counts as a secondary signal. Test by injecting a database outage and confirming that the alert names the database and fires before the restart threshold is reached.
Questions teams ask before wiring Langfuse probes
How much effort does it take to wire Langfuse probes?
For most teams the effort is a small set of configuration changes plus testing, and its size depends on how many Langfuse deployments you run. Each deployment needs probes for the web and worker containers, and the load balancer or ingress checks must match them. The main drivers are the number of environments, whether you split langfuse-web into separate ingestion and user interface deployments, how many ingress paths front the instance, and how thoroughly you rehearse database outages in staging. Most of the time goes into verification rather than the manifests. Ask any partner for a written scope that lists each deployment, each probe type and each failure test.
What makes the cost of this work go up or down?
The cost is mostly the labor to design, test and document the probes. Someone pays for that time, either your platform team through internal effort or a fixed-scope engagement with DeployOpen. One-time costs cover the initial design, staging tests and runbook. Recurring costs come from rechecking probes after each Langfuse upgrade, since endpoints and behavior can change between versions, and from reviewing restart alerts. Costs rise with more deployments, stricter change control and more than one database platform. They fall when one probe template is reused across services and a staging cluster can simulate a database failover. When you request a quote, ask what testing includes, whether retesting after upgrades is covered and who maintains the runbook. DeployOpen does not publish prices, so a quote follows from the written scope.
How long should a team expect to wire probes into production?
No fixed duration applies, because it depends on how many services you run and how much change control your organization requires. A single web and worker pair in a non-production environment is typically a small task for an engineer who knows Kubernetes probes. Production rollout adds approvals, load balancer coordination and a window for failover testing. Timing drivers include confirming which health endpoints your Langfuse version exposes, agreeing on thresholds with the team that owns the database and rehearsing a short database outage. Version also matters. The v3 to v4 upgrade guide requires ClickHouse 25.12 or later, PostgreSQL 15 or later and Redis 7.0 or later, so probe work planned alongside an upgrade takes longer. Ask for a timeline in the written scope that separates staging validation from production cutover.
What does this work need from our platform team?
Your platform team supplies the parts that only your organization can provide:
- Cluster access and deployment rights for the Langfuse web and worker workloads
- Ownership of the load balancer or ingress, including its health check settings and idle timeouts
- The database owners' expected failover behavior for PostgreSQL and ClickHouse, plus the Redis or Valkey details
- An alert channel that receives restart and unready events
Someone on the team also needs to set the thresholds, because a probe that is too strict causes restarts during brief slowdowns. Agree on these decisions before configuration starts, so the probe settings reflect how your database and network actually fail.
Can our own team wire Langfuse probes without outside help?
Yes, if your team already runs Kubernetes workloads and has a staging environment where it can interrupt a database on purpose. The configuration itself is standard, so the usual gap is knowing which endpoints your Langfuse version exposes and how the load balancer treats failing checks. Start with the self-hosting documentation for your deployment method, then test the web and worker probes separately. Verify that a short database interruption leaves pods running and that a sustained failure produces the alert you expect. Keep probe settings in version control next to your Helm values or manifests, and record the expected behavior in a runbook. If your team has little Kubernetes or database failover experience, outside help is a better fit for this part of the work.
Should a Langfuse liveness probe check the database connection?
Generally, a liveness probe should not depend on the database. A short database outage would otherwise cause the orchestrator to restart healthy Langfuse containers, which slows recovery. Use readiness probes to decide whether a pod receives traffic, and keep liveness checks limited to whether the process responds. Langfuse documents a database connectivity option for its health checks, and it is worth enabling for readiness once you confirm how your version reports it. Set the period and failure threshold so that a brief dependency problem removes the pod from the load balancer without triggering a restart. Test this by stopping the database in staging and watching restart counts. Record the result in your runbook, because it shapes how on-call engineers respond during an incident.
Is a Langfuse Enterprise license needed to use these endpoints?
The health endpoints are not on the list of features that need an Enterprise license key. Langfuse states that all core features and APIs are available in the MIT-licensed open source version without limits. Features that need a key include project-level RBAC roles, protected prompt labels, data retention policies, audit logs, server-side data masking, UI customization, organization creators, and the org management and instance management APIs with SCIM. Confirm this against the license key documentation for the version you run, because the list can change between releases. If you also plan to use Enterprise features such as audit logs or data retention, configure them as a separate workstream from probe work so each has its own tests.
When is outside help worth paying for on Langfuse probes?
Outside help is worth considering when probe work is part of a larger production rollout, when your team cannot rehearse database failures, or when a restart incident has already happened. Langfuse's Self-Hosted Enterprise plan is custom-priced and includes a named support engineer, solutions architect access and a support SLA, so it is one route to vendor-backed support. A fixed-scope engagement with DeployOpen can cover planning, configuration, staging tests and a runbook, and retesting after upgrades can be arranged as a retainer. Ask for a written scope that names each deployment, each probe, each failure test and the handover. Compare that cost with the impact of a misconfigured probe that restarts the whole instance during a database blip, using your own incident records to size that risk.
How DeployOpen scopes and delivers Langfuse probe work
DeployOpen plans, builds and documents Langfuse health and readiness probes inside your own Kubernetes or VM infrastructure, using the same codebase as Langfuse Cloud. We start from your actual web, worker and database topology so that probe design matches how your platform really fails.
How we scope
- Inventory the web, worker, PostgreSQL, ClickHouse and Redis or Valkey components and which probe endpoints each one can use.
- Agree in writing whether the database connectivity option is enabled, and which failures should restart pods and which should only remove them from routing.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts. Ongoing support is available as a retainer.
How we build
- Write liveness, readiness and startup probe definitions for each Langfuse Web and Langfuse Worker deployment in your chart or manifests.
- Set probe timeouts and failure thresholds so short database outages do not trigger container restarts during a rolling deployment.
- Test probe behavior by simulating database and dependency interruptions in a non-production environment before changes reach production.
How we hand over
- Deliver versioned probe manifests, load balancer health check settings and a short runbook explaining what each endpoint reports.
- Document the failure modes each probe covers, the ones it does not, and the alerts your team should set from probe results.
- Walk your platform and SRE teams through the configuration and confirm that the handover checklist in the written scope is complete.
How we support
- Review probe behavior after Langfuse version upgrades, since endpoint behavior and chart values can change between releases.
- Re-test probes when you split web into ingestion and UI deployments or add autoscaling for workers.
- Provide ongoing support, upgrades and continuous testing through a retainer if your team wants DeployOpen to keep the configuration current.

