Schedule icon
Search icon
FacetSearch icon
Return icon
Switch icon
SlackIncomingWebhook icon
Log icon

Typesense Collection Drift and Zero-Hit Sentinel

Monitor Typesense collections on a schedule for zero-hit search outages, document depletion drift, and cluster reachability failures with Slack alerting.

Categories
Data

Silent failures in customer-facing search infrastructure are among the most difficult production outages to catch with standard infrastructure health checks. A Typesense process can report 200 OK on its HTTP /health endpoint while the underlying collection has been wiped by a faulty ingestion batch, corrupted during a schema migration, or depleted due to an unhandled upstream filter drop. When customers type common queries, they receive empty search result pages while synthetic ping probes report all systems green.

This blueprint implements a production-grade sentinel pattern that actively validates search result integrity, catalog depth, and facet availability inside Typesense on an automated schedule.

How it works

  1. A disabled-by-default io.kestra.plugin.core.trigger.Schedule triggers the workflow every 30 minutes, or upon manual execution by platform engineers.
  2. probe_search_canary (io.kestra.plugin.typesense.Search) executes a representative query (such as shoes) with allowFailure: true so network timeouts or deleted collections do not crash the flow before classification occurs.
  3. probe_facet_distribution (io.kestra.plugin.typesense.FacetSearch) evaluates the multi-facet category distribution across the collection to confirm index breadth.
  4. classify_sentinel_status (io.kestra.plugin.core.debug.Return) evaluates probe outputs using Pebble logic, categorizing status into PROBE_FAILED, ZERO_HITS, LOW_INVENTORY_DRIFT, or HEALTHY.
  5. route_by_sentinel_status (io.kestra.plugin.core.flow.Switch) routes downstream actions:
    • On ZERO_HITS: Dispatches a high-priority Slack incident notification.
    • On LOW_INVENTORY_DRIFT: Dispatches a Slack warning flagging catalog depletion.
    • On PROBE_FAILED: Dispatches an unreachable cluster or missing collection alert.
    • On HEALTHY: Emits an operational confirmation log with total hit metrics.
  6. log_audit_summary (io.kestra.plugin.core.log.Log) records an immutable audit trail entry with execution ID and verified document counts.
  7. A top-level errors handler catches unexpected orchestration faults and routes them to Slack.

What you get

  • Active search quality and index integrity validation beyond superficial HTTP uptime pings.
  • Automated detection of empty search result states caused by upstream pipeline drops.
  • Tiered Slack alerts differentiating between catastrophic zero-hit outages and catalog depletion drift.
  • Complete execution audit trail recording document hit counts over time.

Who it's for

  • Platform Engineers and SREs maintaining production search clusters and e-commerce storefronts.
  • Data Engineers orchestrating batch ingestion into Typesense who need automated post-sync validation gates.
  • Search Relevance teams monitoring catalog depth across core facets.

Why orchestrate this with Kestra

Script-based search monitoring typically requires cron servers, unmanaged secrets, and custom alerting scripts that fail silently when network errors occur. Kestra provides native Typesense tasks, declarative secret injection, robust conditional branching via Pebble expressions, and built-in Slack notification dispatching within a single auditable workflow.

Prerequisites

  • A running Typesense server or cluster (e.g., standard Docker image typesense/typesense:27.1).
  • An indexed Typesense collection with searchable documents.
  • A Slack incoming webhook URL for alerting.

Secrets

  • TYPESENSE_API_KEY: API key with search permissions on the target Typesense collection (required).
  • SLACK_WEBHOOK: Slack Incoming Webhook URL used for dispatching alert notifications (required).

Quick start

  1. Configure TYPESENSE_API_KEY and SLACK_WEBHOOK secrets in your Kestra namespace.
  2. Start a local Typesense container if running locally: docker run -p 8108:8108 -v /tmp/typesense-data:/data typesense/typesense:27.1 --data-dir /data --api-key=xyz
  3. Import this blueprint into Kestra and click Execute with default parameters.
  4. Verify the audit log output in the execution logs tab.
  5. Enable the every_30_minutes schedule trigger to establish automated monitoring.

How to extend

  • Add automated rollback or re-sync tasks: wire a downstream subflow execution to trigger a catalog re-ingestion when ZERO_HITS is detected.
  • Multi-collection iteration: wrap the probe tasks inside a ForEach loop to validate multiple business-critical collections sequentially.
  • PagerDuty integration: replace or supplement Slack alerts with PagerDuty incidents for immediate on-call escalation during critical zero-hit states.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.