Schedule icon
Webhook icon
Request icon
Script icon
Docker icon
Switch icon
Log icon
SlackIncomingWebhook icon
If icon
Create icon

Upstash Vector Index Capacity and Staleness Sentinel

Monitor Upstash Vector index capacity and pending-vector backlog. Alert Slack and open a GitHub issue when quotas or indexing lag breach thresholds.

Categories
AIInfrastructure

Upstash Serverless Vector is the go-to zero-infrastructure vector store for RAG pipelines, AI agent memory, semantic search, and recommendation systems. Because indexes operate within hard plan ceilings (10 000 vectors on the free tier) and pending upserts are asynchronously indexed by the Upstash backend, two silent failure modes can degrade retrieval quality without triggering any application error: quota exhaustion, where new upserts are silently dropped, and indexing backlog, where embeddings exist but have not yet been made searchable.

This blueprint provides a Day 2 operations sentinel that probes the Upstash Vector REST /info endpoint on a daily schedule or on-demand webhook, analyses vector count utilisation and pending backlog against configurable thresholds, and routes alerts to Slack with precise metrics, optionally escalating to a GitHub issue for sprint-backlog tracking.

How it works

  1. daily_capacity_check (io.kestra.plugin.core.trigger.Schedule, cron 0 7 * * *, shipped disabled: true) runs the audit every morning before peak AI workloads. on_demand_audit (io.kestra.plugin.core.trigger.Webhook) allows CI/CD pipelines to trigger a capacity check immediately after a large embedding batch completes.
  2. query_index_info (io.kestra.plugin.core.http.Request) issues an authenticated GET /info against the Upstash Vector REST API and surfaces the full index statistics as a JSON body.
  3. analyze_capacity (io.kestra.plugin.scripts.python.Script in python:3.12-slim) parses vectorCount, pendingVectorCount, indexSize, dimension, namespaceCount, and similarityFunction. It derives utilization percentage, compares pending count against max_pending_vectors, and classifies the verdict as HEALTHY, BREACH_CAPACITY, BREACH_STALENESS, or BREACH_BOTH. A bundled offline fixture guarantees the script runs successfully without live credentials for initial testing.
  4. route_on_verdict (io.kestra.plugin.core.flow.Switch) branches on the verdict:
    • HEALTHY: logs a clean audit record.
    • BREACH_CAPACITY: posts a formatted Slack block-kit card with utilization, vector count, and recommended upgrade action. When open_github_issue is true, io.kestra.plugin.github.issues.Create files a labeled sprint-tracking issue.
    • BREACH_STALENESS: posts a Slack card flagging the pending-vector backlog with counts and threshold details.
    • BREACH_BOTH: posts a critical combined Slack alert and optionally opens a high-priority GitHub issue.
  5. The errors block catches REST authentication failures or network timeouts and alerts Slack so the absence of an alert is never mistaken for a healthy index.

What you get

  • Silent upsert-drop prevention by catching quota saturation before the plan ceiling is reached.
  • Indexing-lag detection that surfaces stalled embedding pipelines before retrieval quality degrades.
  • Rich Slack block-kit alert cards with exact metrics and direct console links.
  • Optional GitHub issue creation so capacity breaches are tracked in the engineering sprint backlog.
  • Offline fixture fallback making the flow safely testable in CI or on a laptop without live credentials.

Who it's for

  • AI Engineers and MLOps teams operating RAG pipelines, semantic search, or recommendation engines on Upstash Vector.
  • Platform Engineers responsible for serverless vector infrastructure capacity planning.
  • Site Reliability Engineers who need automated early-warning on index quota exhaustion.

Why orchestrate this with Kestra

A bespoke cron script polling /info lacks versioned configuration, encrypted secret management, structured execution history, and team-visible alerting. Kestra provides declarative YAML that encodes the full audit and alerting topology, Kestra-native secret masking for REST tokens and Slack URLs, a Switch task that cleanly separates all four verdict paths without nested conditionals, and a webhook trigger that plugs the sentinel directly into embedding batch pipelines.

Prerequisites

  • An Upstash Vector index reachable from the Kestra worker.
  • A Slack Incoming Webhook URL for alert delivery.
  • A GitHub Personal Access Token with Issues write permission if open_github_issue is enabled.

Secrets

  • UPSTASH_VECTOR_WEBHOOK_KEY: Secret key guarding the on-demand webhook trigger URL.
  • UPSTASH_VECTOR_REST_TOKEN: Upstash Vector REST API token found in the Upstash Console under the Vector index details.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for capacity and staleness breach alerts.
  • GITHUB_TOKEN: GitHub Personal Access Token (scope repo or Issues write) used when open_github_issue is true.
  • GITHUB_REPOSITORY: Target repository in owner/repo format where issues are created.

Quick start

  1. Add UPSTASH_VECTOR_WEBHOOK_KEY, UPSTASH_VECTOR_REST_TOKEN, and SLACK_WEBHOOK_URL to your Kestra namespace secrets.
  2. Import this blueprint and click Execute with the default upstash_vector_url to run against the bundled fixture and verify Slack message rendering.
  3. Update upstash_vector_url to your live index endpoint and re-execute to observe real metrics in execution outputs.
  4. Enable daily_capacity_check by setting disabled: false, or POST to the webhook to integrate with your upsert pipeline.
  5. Set open_github_issue: true and configure GITHUB_TOKEN and GITHUB_REPOSITORY to activate sprint-tracking issue creation.

How to extend

  • Add a io.kestra.plugin.core.flow.Loop loop over multiple index endpoints to monitor an entire fleet of Upstash Vector databases in one execution.
  • Connect the BREACH_STALENESS branch to a downstream flow that retries failed upsert batches from a dead-letter queue or S3 staging area.
  • Push vector_count and pending_count to a Prometheus Pushgateway to chart index growth trends over time.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.