Schedule icon
Request icon
Search icon
Switch icon
Log icon
SlackIncomingWebhook icon

Meilisearch Index Health Sentinel and Search Audit

Automate Meilisearch index stats monitoring and search query probing with Slack alerting for Day 2 operations.

Categories
DataInfrastructure

Automate Meilisearch index health auditing, search query probing, and threshold evaluation with automated Slack notifications.

How it works

  • Index Stats Retrieval: Queries the Meilisearch REST API to fetch real-time index metrics including document counts and indexing status.
  • Search Probing: Executes a test search query against the target Meilisearch index using the official Meilisearch plugin task.
  • Health Evaluation: Evaluates total hit counts against predefined threshold inputs using flow switch logic.
  • Alert Routing: Dispatches structured Slack alerts when zero hits are detected or execution errors occur.
  • Audit Log Emission: Produces structured log outputs summarizing index health and query response metrics.

What you get

  • Automated Day 2 observability for Meilisearch search indexes without third-party monitoring agents.
  • Configurable search query probing with automated Slack alerts on zero-hit or degraded search responses.
  • Centralized flow-level error catching to notify operations teams immediately upon engine or connection failure.

Who it's for

  • Search Engineers managing Meilisearch production workloads.
  • DevOps and Reliability Engineers monitoring search cluster availability and API health.

Why orchestrate this with Kestra

  • Direct integration with native Meilisearch tasks avoiding shell script boilerplate.
  • Declarative trigger schedules for continuous background index auditing.
  • Built-in failure handling and notification integration for instant incident dispatch.

Prerequisites

  • A running Meilisearch server reachable by Kestra network host or container.
  • A valid Meilisearch API master key or search-enabled API key stored as a Kestra secret.
  • A Slack Incoming Webhook URL stored as a secret for alerting.

Quick start

  1. Deploy a local Meilisearch container:
    docker run -d --name meilisearch -p 7700:7700 -e MEILI_MASTER_KEY=masterKey123 getmeili/meilisearch:v1.6
    
  2. Connect the Meilisearch container to your Kestra Docker network:
    docker network connect YOUR_KESTRA_NETWORK meilisearch
    
    Note: Run docker network ls to identify your active Kestra network name.
  3. Configure Kestra secrets:
    • Set MEILISEARCH_MASTER_KEY to masterKey123.
    • Set SLACK_WEBHOOK to your Slack webhook URL. Note for OSS Kestra setups: Store secrets as base64-encoded environment variables formatted as SECRET_MEILISEARCH_MASTER_KEY and SECRET_SLACK_WEBHOOK.
  4. Execute the flow manually or enable the schedule trigger.

How to extend

  • Index Auto-Compaction: Add a task to trigger index task pruning or snapshot creation when document counts exceed max limits.
  • Multi-Index Loop: Wrap the probe task in a loop to monitor multiple search indexes in a single run.
  • PagerDuty Integration: Swap or append PagerDuty notification tasks for high-priority outage alerting.

Secrets

  • MEILISEARCH_MASTER_KEY: API key with read/search access to Meilisearch indexes.
  • SLACK_WEBHOOK: Webhook URL for Slack channel alert delivery.

Inputs

Parameter Type Default Allowed Values Description
meilisearch_url STRING http://meilisearch:7700 Any valid URL HTTP endpoint URL of target Meilisearch instance.
index_name STRING products Any valid index name Target index name to monitor and probe.
search_query STRING laptop Any query string Query string used to probe search availability.
min_document_count SELECT 500 100, 500, 1000, 5000 Minimum expected document count.
alert_on_zero_hits SELECT true true, false Whether to trigger alert on zero search hits.

Outputs

  • {{ outputs.probe_search.totalHits }}: Total hits returned by the search probe task.
  • {{ outputs.probe_search.uri }}: Kestra storage URI containing search result payload in Ion format.
  • {{ outputs.fetch_index_stats.body }}: Raw JSON response body containing index statistics.

Links

Pitfalls

  • Port Conflicts: Ensure port 7700 does not conflict with local host services. Do not use port 8080.
  • Network Isolation: Ensure Kestra containers can resolve the meilisearch container hostname across Docker networks.
  • Authentication Failures: Missing or invalid MEILISEARCH_MASTER_KEY will result in HTTP 401 Unauthorized errors during probe execution.
See How

New to Kestra?

Use blueprints to kickstart your first workflows.