Clear Pulsar backlogs held by subscriptions nobody consumes
Detect Apache Pulsar subscriptions with no consumers that still pin a large backlog, then clear or remove them behind a dry run, an approval pause and a live re-read that fails the run.
Audit a Quickwit index's queued delete tasks, alert Slack on a growing backlog, and log the result for data platform teams.
A Quickwit delete task stays listed on its index until the background merge pipeline actually removes the matching documents; if that pipeline falls behind, the queue grows and nothing in Quickwit itself pages anyone about it. This blueprint reads the real queued delete tasks and their real creation timestamps, and reports the exact backlog, not a guess from a dashboard someone has to remember to check.
This blueprint was created by Mohit Jeswani.
list_delete_tasks (io.kestra.plugin.quickwit.deletetask.List) lists every delete
task still queued on index_id. Read-only; nothing in Quickwit is changed.
allowFailure: true covers an unreachable Quickwit instance or a missing index without
failing the flow outright.evaluate (io.kestra.plugin.core.output.OutputValues) reads the real queued count
directly from the response's own size field, and computes the oldest task's age from
its real createTimestamp with a jq filter.route (io.kestra.plugin.core.flow.If):summary logs both numbers and the severity, closing the governance cycle.errors alerts Slack if the flow itself fails, for example an unreachable Quickwit
cluster.deletetask.List used
as a standing backlog sentinel, distinct from this repo's existing Quickwit blueprints,
which audit index source connectors and search latency rather than queued delete tasks.Quickwit lists its queued delete tasks on request; it does not keep a schedule, compare the
queue depth or oldest task's age against a tolerance you declare, or notify a Slack channel
when either crosses it. Kestra keeps max_queued_count and max_task_age_seconds as flow
inputs, turns the list into a Slack page naming the real numbers, and keeps a full execution
history of every check.
quickwit/quickwit Docker image,
with an index that has at least one delete task issued against it.SLACK_WEBHOOK_URL: used by alert and the errors block. In Kestra OSS, provide it as
the base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Default | Purpose |
|---|---|---|
index_id |
<your-quickwit-index> |
Index to audit |
max_queued_count |
10 |
Queued delete task count at or above which the alert fires |
max_task_age_seconds |
3600 |
Oldest queued task's age at or above which the alert fires |
{{ outputs.list_delete_tasks.deleteTasks }} / .size: every queued delete task
(createTimestamp, opstamp, deleteQuery) and how many.{{ outputs.evaluate.values.queued_count }} / .oldest_age_seconds: the same count, and
how old the oldest queued task is, in seconds.{{ outputs.evaluate.values.severity }}: OK, DELETE_TASK_BACKLOG, or CRITICAL.deleteTasks has no explicit per-task status field; this check infers backlog purely from
count and age, not from any "in progress" versus "pending" distinction Quickwit itself
does not expose through this endpoint.index_id must be an existing index; a typo surfaces via allowFailure as CRITICAL,
not a silently empty queue.docker run -p 7280:7280 quickwit/quickwit:latest run) and add the
SLACK_WEBHOOK_URL secret.index_id to a real index, issue a delete task against it via Quickwit's own API.summary logs the queued count and oldest age.max_queued_count or max_task_age_seconds below the real current values to
confirm alert fires.hourly trigger once both thresholds reflect your real operational policy.index_id values with io.kestra.plugin.core.flow.Loop to audit every
index in a cluster in one scheduled run.deleteQuery.query in the Slack alert to show exactly which
documents are waiting to be removed.queued_count over successive runs in a KV entry to chart whether the backlog is
growing or shrinking, not just its current size.