Managing Langfuse queues with the BullMQ admin API

When trace ingestion backs up or events fail, the BullMQ admin API is how operators check queue lengths, replay failed events and clear bad jobs. This page covers what to confirm in the docs, how to enable access safely and how to act during an incident.

On this page

What the BullMQ admin API lets operators do in a self-hosted Langfuse incident

The BullMQ admin API is for operators who need to see and act on background queues in a self-hosted Langfuse during an incident, such as a growing ingestion backlog, a run of failed events or a bad batch of jobs that should not be processed. It belongs with the platform team that runs the Langfuse deployment, not with application developers who only send traces. Use it when the symptom is in the queues rather than in the web interface or the SDK, and only after you have confirmed the problem is not a simple outage of a container or a database.

Langfuse Worker processes asynchronous events from queues. Those queues sit behind the Redis or Valkey dependency, which holds the queue state that the worker reads from, so queue inspection depends on that store being reachable and healthy. Before you touch anything, confirm in the current Langfuse self-hosting documentation and in the release you actually run whether the admin API is enabled by a key variable, which endpoints it exposes, how it is authenticated and which queue names it accepts. The research behind this page does not document those endpoints, key variable or queue names, so do not copy them from older posts or from another instance.

Treat every write action as a change to production data. Record the queue state before you act, agree who approves a replay or a job removal, and make sure the admin key is stored in your secrets manager and restricted to the operators on call. Confirm with your own test environment, running the same release, how replay and cleanup behave before you rely on them in an incident. Whether a replayed event produces duplicate data in ClickHouse is something to verify in that environment, not assume.

How events move through the queues the admin API inspects

The path starts with an SDK or OpenTelemetry client sending traces to Langfuse Web. Web writes the event payload to blob storage and enqueues work in Redis or Valkey. Langfuse Worker consumes those jobs and writes results to ClickHouse and PostgreSQL. The operator reads queue state only through the admin API, over a restricted network path, so check that the Redis or Valkey store stays behind that boundary.

Event flow from SDK to storage, with the admin API boundary around the queue store.

Which incidents call for queue inspection before any repair

Queue repairs are fast to run and hard to undo, so the first step in each incident is to read the queue state. The situations below look alike from the dashboard but have different causes, and each one points to a different first measurement.

Growing backlog with healthy workers

The worker containers report healthy, yet waiting jobs keep climbing. Measure the waiting and active counts for the ingestion queue over time, and compare the arrival rate with the processing rate before touching anything. A rising backlog with healthy workers usually means throughput is short, not that jobs are broken. Repairing or clearing jobs here would discard trace data that workers are still able to process, so scale or tune first and inspect only the jobs that stay stuck.

Langfuse scaling guide

Failed events after a dependency outage

A burst of failed jobs often follows a short outage of PostgreSQL, ClickHouse, Redis or Valkey, or blob storage. Measure the failed count and the timestamps of the first failures, and line them up with the dependency outage window. Failed jobs from an outage are usually recoverable once the dependency is back, so confirm that before replaying anything. Replaying while a dependency is still unhealthy can create a second failure wave and make the queue harder to read.

Unwanted jobs after a bad release

A release that changes event handling, or a bulk import that sends unexpected payloads, can fill the queue with jobs nobody wants processed. Measure the job names, the payload sources and the time window the jobs were created in, and compare them with the release or import timeline. Clearing jobs is only safe once you know which ones are unwanted, because the same queue may hold valid traces from other sources. Check that the release is not the cause of the errors before removing anything.

Stale queue state after a Redis or Valkey restart

After Redis or Valkey restarts, the queue view can look frozen, with jobs marked active that no worker is handling, or counts that do not match what workers report. Measure the active and stalled counts, check worker logs for reconnection messages, and confirm the Redis or Valkey version and persistence settings for your deployment. Stale-looking state is often a connection or persistence question, so wait for the cause before moving or removing jobs. Forcing jobs back to waiting while workers still hold them can run the same event twice.

Queue counts that disagree with trace data

Sometimes the queue shows little pending work, but traces are missing in the UI. Measure the queue counts and then check the event in blob storage and worker processing for a sample trace. A quiet queue does not prove that events were processed, so compare both sides before concluding the queue is healthy. The gap may sit in another part of the pipeline, and a queue repair would not fix it.

Admin API actions and when each fits an incident

This table compares the actions an operator can take against Langfuse background queues, from read-only inspection to removing jobs, and shows when each fits an incident. Read it from top to bottom: start with the lowest-risk action, and only move down when the earlier step has shown what is wrong. Confirm each endpoint and its behavior against the documented admin API for your deployed version before using it.

ActionWhen it fitsMain riskWho should approve it
Read-only inspection of queue lengths and job statesFirst step in any incident, to see whether jobs are waiting, active, delayed or failed before changing anythingLow. Mainly the risk of misreading a backlog that is still draining as a faultOn-call operator, no separate approval needed
Checking individual failed job payloadsWhen failures cluster and you need to know whether they share a cause, such as a missing blob or a bad project referenceLow, but payloads can contain personal data from traces, so access should be limitedOn-call operator, with the data owner informed if payloads contain personal data
Pausing or resuming processingWhen a faulty worker or downstream store is writing bad data and processing should stop while you investigate. Confirm whether the admin API offers pause and resume for your versionIngestion backlogs grow while paused, and traces may be delayed in the UIIncident lead, recorded in the incident ticket
Replaying failed jobsAfter the root cause is fixed, such as a restored ClickHouse or blob storage connection, and a small sample replays cleanlyDuplicate writes if the processing is not idempotent for your version, and a repeat of the original failure at scalePlatform owner and the incident lead, with a rollback plan
Removing selected jobsOnly for jobs confirmed as invalid or duplicated, such as malformed events that will never succeedPermanent loss of trace data that cannot be recovered from the queue, so the event may never reach LangfusePlatform owner and data protection or compliance lead, with a record of the job IDs removed
Bulk clearing of a queueRarely appropriate. Only consider it when a queue is confirmed to contain only unwanted work and the data loss is accepted in writingIrreversible loss of large volumes of trace or evaluation input, which may not be visible until traces are reported missingHead of platform engineering and the data owner, with a documented decision

Enabling the admin API key and checking queue access

This sequence prepares a self-hosted Langfuse so on-call staff can inspect background queues safely during an incident. It confirms the version and access path, sets the admin API key, and produces a read-only access check and a baseline record. Each step ends with a check that the next step depends on.

  1. Confirm the deployed Langfuse version

    The platform engineer checks the Langfuse version running in each environment against the releases page on GitHub, where the latest release listed is v4.63.0, published October 16, 2026. Record the exact image tag or Helm chart version, then read the release notes and the upgrade guide for that version to confirm the admin API is available in it. If the admin API is absent, plan an upgrade before adding a key to that build. Done when the version, its release notes and the availability result are written in the runbook.

  2. Set the admin API key

    Using the configuration that the self-hosting docs name for your install method, set the admin API key on the containers that serve the admin API. Generate a long random value and store it in your secrets manager so that it never appears in a shared configuration file or chat thread. Redeploy the containers, then confirm the variable is present in the running environment without printing its value to logs. Done when the containers restart cleanly and report the key as set.

  3. Restrict network access to the endpoint

    The network or platform team limits which networks can reach the admin API path at the load balancer, ingress or network policy layer. Allow only the bastion host, VPN range or on-call jump host, and keep this path off public routes entirely. The key is a second control, so confirm in your version's documentation what access model the admin API itself applies. Done when a test request from an address outside the allowed range is refused and a request from inside the range reaches the service.

  4. Make a read-only access check

    From an approved host, send one read-only request to the admin API that returns queue status, passing the key in the header the documentation specifies. Use only a request that reads state, never one that pauses, retries or removes jobs. An authorized success response confirms the key and route work, an unauthorized response points to the key or header, and a not-found response suggests the version lacks the endpoint. Done when the response is saved as evidence with its timestamp and the Langfuse version.

  5. Record baseline queue lengths

    During normal ingestion, the operator records the waiting, active, delayed and failed counts for each queue at several points across a typical working period. Note the usual range for each queue and how quickly it returns to normal after a busy period. Ask your vendor or check your environment to confirm the queue names exposed by your version. Done when you have a baseline table that on-call staff can compare against during an incident, and the table is dated.

  6. Store the runbook for on-call access

    Publish the runbook in the incident platform or internal wiki that on-call staff already use. Include where the key is held in the secrets manager, the approved access path, the read-only check, the baseline table and the version record. Name an owner, state who may rotate the key, and add a review step to every Langfuse upgrade. Done when an engineer who did not take part in setup can find the key owner, run the read-only check and locate the baseline using the runbook alone.

Replaying failed events without duplicating or reordering traces

Replaying failed events is the step most likely to create new damage during an incident, so treat it as a controlled change rather than a bulk retry. The three risks to plan for are duplicate writes into ClickHouse if processing is not idempotent, out-of-order processing for events that belong to the same trace, and load spikes that slow the UI or push the worker containers into memory pressure. Before you move any job from the failed set back to the waiting queue, confirm with Langfuse how replayed ingestion events are deduplicated and ordered in the version you run. Do not assume the behavior from a previous release, and record the answer in your runbook.

Take a snapshot of the Redis or Valkey data before the first replay, so you can return to the pre-replay state if the replay goes wrong. Then replay a small batch, chosen by time window or by a single project, and watch the worker logs, queue lengths and the ClickHouse insert pattern while the batch drains. Check a handful of the replayed events in the Langfuse UI and confirm in storage that each trace has one copy of each observation and that the events sit in a sensible order. The check is simple to describe but easy to skip under pressure, so write it into the runbook with named owners.

Only after the small batch passes should you replay the rest, and do it in stages sized so that worker CPU and memory stay within the limits you set for them. If the failed set is large, ask Langfuse or your platform team to confirm the replay rate that your ClickHouse and worker sizing can absorb, and pause between stages to let the queue drain. Keep the failed jobs in place until the verification is complete, and record which job IDs were replayed so that a later investigation can separate original and replayed writes.

Inspect, replay or clear: what each action needs before you run it

Inspecting a queue only reads state, so it has the lightest preconditions, but it still needs a stated reason. Before you open the admin view, write down the symptom that prompted the look, such as traces that have not appeared in the UI, and the queue you expect to be involved. Confirm the queue names your version exposes, because naming can change between releases.

  • Cause hypothesis: record the symptom and the suspected stage (ingestion, processing or write) before reading any counts, so the readings are tested against a stated idea.
  • Access scope: enable the admin API key only for the duration of the work, limit it to operator hosts, and confirm your network policy allows only those hosts to reach the admin path.
  • Timed readings: capture waiting, active, delayed and failed counts with timestamps at least twice, so you can tell whether backlog is moving or stuck.
  • Verification: compare the readings with worker logs and web container errors for the same period, and note any mismatch as a finding rather than a fix.
  • Incident record: save the hypothesis, the readings, the timestamps, the key used and the person who ran the inspection. Disable the admin key again when the work is finished.

No rollback is needed because nothing changed, but the saved readings are the baseline that replay or clear decisions will rely on.

Protecting the admin API and the queues behind it

The BullMQ admin API can change or delete queued work, so it needs the same care as any privileged credential. The controls below cover who holds the key, where the endpoint is reachable, how destructive actions are recorded and how dashboards reduce the need to use the API at all.

Treat the admin key as a privileged credential

The admin key lets its holder inspect and change background queues, so it should be stored in a secrets manager, not in shared configuration files or chat logs. Set a rotation schedule and record which systems read the key, so a rotation does not break a running worker or an automation job. Confirm with your Langfuse configuration documentation how the key is supplied to the web and worker containers and whether a restart is needed after changing it.

Langfuse self-hosting docs

Keep the endpoint off the internet

Admin routes should be reachable only from the operator network, a bastion host or a VPN, and never through the public load balancer that serves users and SDK traffic. Block them at the ingress or proxy layer and test the block from outside your network after every change to routing. Route admin access through the same SSO-controlled path your operators already use, where your platform allows it.

Log and approve destructive actions

Deleting or retrying jobs during an incident can remove the only copy of an event that an operator still needs. Require a named ticket and a second person for bulk removals, and record the queue name, the job IDs, the command and the operator in your incident log before running it. Ask Langfuse whether the admin API writes to its audit log, because audit logs are an Enterprise feature under the license key documentation and the admin API is not listed there.

License key docs

Limit Redis or Valkey access

The queues live in Redis or Valkey, so anyone who can connect to that store can bypass the admin API entirely. Allow connections only from the Langfuse web and worker services and from a small operator group, using network policies, security groups or ACLs, and require authentication. Check that Redis or Valkey is not published on a host port in your Docker Compose or Kubernetes manifests.

Alert on queue depth

A growing waiting-job count is the earliest sign of a stuck worker or a database slowdown, so alerting on it lets the team act before anyone needs to touch the queue directly. Chart queue length and failed-job count over time, set thresholds based on your normal ingestion volume and link each alert to a runbook that says when to use the admin API and when to scale workers instead. Fewer manual interventions also means fewer chances for an accidental deletion.

Questions operators ask before running queue repairs

Does the BullMQ admin API in self-hosted Langfuse need an Enterprise license?

Confirm this in the license key documentation before you enable the admin API in production. The Enterprise features listed in the supplied documentation include project-level RBAC roles, protected prompt labels, data retention policies, audit logs, server-side data masking, UI customization, organization creators, the org management API with SCIM and the instance management API. The queue admin API is not on that list. Langfuse states that core features and APIs are available in the MIT-licensed version, but the ee/, web/src/ee/ and worker/src/ee/ directories fall under a separate enterprise license. Check the repository to see where the admin API code lives, and ask the vendor in writing if the answer is unclear. Your legal or procurement team should review the license terms before the feature reaches production.

How much effort does a queue incident usually take to resolve?

Effort depends on what caused the backlog or failure, not on the admin API calls themselves. The main drivers are the size of the waiting and failed job sets, how old the oldest jobs are, and whether the failed events contain data that must be preserved or replayed exactly. Effort rises when the root cause sits in ClickHouse, PostgreSQL or blob storage rather than in the queue, because then the queue fix alone will not clear the incident. It also rises when several environments share one Redis or Valkey instance, or when you must prove to auditors what was replayed or deleted. Ask any provider for an effort estimate tied to a written scope that names the environments, the failure types and the verification steps. No duration is given in this guide because it depends on your environment.

Can our internal team run queue repairs without outside help?

A team with Redis or Valkey operations experience and working knowledge of how Langfuse web and worker containers process events can usually handle routine queue checks in-house. The risk lies in destructive steps. Clearing or replaying jobs incorrectly can drop trace data or duplicate it, and the consequences are hard to reverse. Your team should be able to answer three questions before acting: what state each job type is in, which jobs must be kept, and what the rollback path is. If any of those answers are uncertain, rehearse the procedure in a non-production copy first. Outside help is most useful for the first incident, for writing the runbook, and for training the on-call staff who will run it later.

What does our organization need to provide before queue repairs start?

Queue repair needs access, documented procedures and time to act safely. Typical inputs include:

  • Read and write access to the Redis or Valkey instance that backs the queues, plus access to the web and worker containers and their logs
  • The admin API key stored in your secrets manager, with a named owner and a rotation process
  • A written runbook that states which job types may be replayed, which may be cleared and who approves each action
  • A maintenance window or agreed change window, and a named incident owner who can stop the work
  • Recent backups of the data stores that the queued events eventually write to, so you can restore if a replay goes wrong

Confirm the exact access model and key handling with your own security team and with the Langfuse self-hosting documentation before you grant anything.

How do we tell a queue problem from a missing trace problem?

A queue problem means events were accepted but are not being processed, while a missing trace problem can begin earlier in the path. Start by checking whether the SDK received a success response, then whether the event reached the queue, then whether the worker processed it. A growing waiting count or old jobs in the queue point toward a queue or worker problem. If the queue is empty but the trace never appears, the failure is more likely in the web container, in blob storage or in the processing path, and a queue replay will not help. Logs from both containers usually show which case you are in. The sibling guide on troubleshooting missing traces covers that path in more detail, so use it to narrow the cause before you touch the queue.

What does a fixed-scope engagement cover for Langfuse queue management?

A fixed-scope engagement sets out the work, deliverables and timeline in writing before anything starts. For queue management, the scope usually names the environments, the queues and job types in question, and the actions allowed, such as inspection only or inspection with replay and clearing. Typical deliverables include a queue health review, a runbook for checking lengths and failed jobs, a replay and clearing procedure with approval steps, verification evidence after each repair and handover to your operators. Exclusions should be stated too, for example root-cause repair in ClickHouse or PostgreSQL. Ongoing support, upgrades and continuous checks are available as retainers. DeployOpen does not publish a price list, so a quote follows from the written scope.

What to confirm in your environment before relying on the admin API

This page does not document the BullMQ admin endpoints, so treat every path, header and behavior below as unverified until you have tested it. The checks cover the Langfuse version, the queue store, how your install method exposes the key, migration behavior and failover.

Endpoint names and authentication

Confirm the exact admin endpoint paths, the HTTP methods they accept, and how the admin key is passed for your Langfuse version. Endpoint names can change between releases, so check the current self-hosting documentation and the release notes for the version you run. Do not script incident runbooks against paths you have not called yourself in a test environment. Record the version and the verified paths together in your runbook.

Self-hosting docs

Queue store: Redis or Valkey version

Confirm whether your queue store is Redis or Valkey and which version it runs. The v4 upgrade guide requires Redis 7.0 or later, so a Redis 6 or older queue store blocks that upgrade and changes which operations you can rely on. Check the version on the live instance, not only in your deployment manifest, because managed services sometimes differ from the template you deployed.

Install method and key exposure

Confirm how your install method, whether Docker Compose, Helm or Terraform, sets and exposes the admin key. Each method may store the secret differently, and a value set in one place may not reach the worker or web container that serves the admin route. Verify that the key is stored in your secrets manager, that it is not written into logs or shell history, and that rotating it updates every container that needs it.

Behavior during a v3 to v4 migration

Confirm how the admin API responds while a v3 to v4 upgrade is running, including whether queues accept or pause jobs during database migrations and during the ClickHouse backfill. The upgrade guide advises planning for extra ClickHouse disk headroom during backfill, so queue depth can grow during that window. Test the endpoints against a staging copy of your data before any production upgrade.

v3 to v4 guide

Queue state across failover

Confirm whether queued and failed job state survives a Redis or Valkey failover in your setup. This depends on whether you run a single node, a replicated pair with automatic failover, or a managed service, and on its persistence settings. Simulate a failover in a test environment, then compare the queue lengths and failed sets before and after. If jobs can be lost, plan how you will replay the affected events from your own records.

How DeployOpen scopes and supports queue management for self-hosted Langfuse

DeployOpen treats queue work on a self-hosted Langfuse as part of the platform it runs in your infrastructure. We scope the admin API access, the queue inspection and repair procedures, and the incident runbook in writing before any change is made, then build and test them in a non-production copy first. Every repair is documented so your operators can run it again without us.

How we scope

  • Written scope names which queues, workers and Redis or Valkey instances the admin API work covers.
  • We confirm who may enable the admin API key and where that key is stored and rotated.
  • The scope lists the incident types covered, such as stalled ingestion, replay of failed events and job clearing.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We set up the admin API behind network controls you approve, with the key scoped to operators who need it.
  • Queue length checks are written as repeatable steps that compare waiting, active and failed counts.
  • Replay and clearing procedures are tested on a copy of your deployment before they go near production data.
  • Each runbook step records what it changes so that a repair can be reviewed and reversed where possible.

How we hand over

  • You receive a runbook with decision points for replaying failed events versus clearing unwanted jobs.
  • Operators are walked through each procedure on your environment until they can run it without us.
  • Documentation covers version requirements, the Langfuse version you run and the Redis or Valkey version in use.
  • Access, key handling and audit expectations are recorded so your security team can review them.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped in writing.
  • After a Langfuse upgrade, we re-verify queue procedures, since admin tooling can change between versions.
  • Incident support can be included in a retainer, with response expectations stated in the written agreement.
  • Retesting of queue controls is offered after changes to network access, key rotation or worker scaling.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.