Schedule icon
Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
OutputValues icon

Microsoft Garnet Cache Saturation & Eviction Sentinel

Probes Microsoft Garnet memory saturation and key eviction counters with automated Slack alerting and actionable capacity runbooks.

Categories
Infrastructure

Microsoft Garnet is an open-source, next-generation remote cache-store developed by Microsoft Research. Built on the .NET Tsavorite storage engine, Garnet delivers multi-threaded throughput and sub-millisecond latencies as a drop-in RESP-compatible alternative to Redis. However, unchecked dataset expansion, uncapped caching layers, or missing Time-to-Live (TTL) policies can exhaust configured memory boundaries, leading to degraded hit rates, unexpected key evictions, or out-of-memory write rejections.

This blueprint provides an automated sentinel that periodically probes Garnet over the RESP protocol, measures active memory consumption against provisioned limits, audits eviction counters, evaluates risk thresholds through a conditional gate, dispatches context-rich Slack incident briefings, and logs structured capacity telemetry.

How it works

  1. periodic_saturation_check (io.kestra.plugin.core.trigger.Schedule) initiates automated surveillance every 10 minutes. It is shipped disabled by default for initial credential and connectivity validation.
  2. probe_garnet_metrics (io.kestra.plugin.scripts.python.Script running inside Docker) connects to the target Garnet instance via RESP, extracts INFO memory and INFO stats counters, calculates saturation percentages, and assesses key eviction trends.
  3. evaluate_saturation_state (io.kestra.plugin.core.flow.If) evaluates whether memory saturation exceeds memory_threshold_pct or if key evictions have occurred:
    • Alert Path: Dispatches a rich Block Kit notification via notify_slack_memory_alert (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) containing exact memory metrics, active eviction figures, and specific SRE runbook remediation steps.
    • Healthy Path: Records normal capacity status through log_healthy_metrics (io.kestra.plugin.core.log.Log) for historical baseline tracking.
  4. finalize_capacity_telemetry (io.kestra.plugin.core.output.OutputValues) publishes clean outputs for external dashboards, SLA audits, and capacity trend forecasting.
  5. The global errors handler captures connection timeouts, unreachable hostnames, or authentication failures to alert on-call teams immediately.

What you get

  • Early detection of memory leaks, cache growth spikes, and unexpiring key accumulation before application writes fail.
  • Continuous visibility into eviction behavior to safeguard critical warm data and preserve high cache hit ratios.
  • Contextual Slack alerts containing exact saturation figures, formatted byte quantities, and actionable SRE runbook steps.
  • Unbroken execution history and structured capacity telemetry in Kestra.

Who it's for

  • Site Reliability Engineers (SREs) and DevOps teams managing Microsoft Garnet deployments in production.
  • Backend developers relying on high-throughput in-memory caching for low-latency microservice APIs.
  • Platform engineers migrating workloads from single-threaded Redis to multi-threaded Garnet.

Why orchestrate this with Kestra

Monitoring high-performance cache tiers requires reliable scheduled polling, containerized script isolation, secure secret masking, conditional escalation, and resilient error recovery. Standalone cron jobs lack centralized audit history, execution logging, and unified Slack alert templates. Kestra provides declarative YAML workflows, built-in secret masking, robust error routing, and real-time execution observability.

Prerequisites

  • A running instance of Microsoft Garnet, reachable over the network. Garnet publishes an official open-source Docker image (ghcr.io/microsoft/garnet:latest) requiring no license or account.
  • A Slack Incoming Webhook URL configured with permission to post to the alert channel.
  • Docker enabled on Kestra workers to run the Python probe container.

Secrets

  • SLACK_WEBHOOK_URL: Incoming Webhook URL for the target Slack workspace.
  • GARNET_PASSWORD: (Optional) AUTH password for protected Garnet instances.

Quick start

  1. Start a local Microsoft Garnet container:
    docker run -d --name garnet-sentinel-test -p 3278:3278 ghcr.io/microsoft/garnet:latest
    
  2. Configure SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  3. Import this blueprint into Kestra under namespace company.cache.
  4. Click Execute with default inputs (garnet_host: localhost, garnet_port: 3278) to verify connectivity and observe healthy telemetry outputs.
  5. Enable periodic_saturation_check to begin continuous 10-minute capacity surveillance.

How to extend

  • Add automated scaling: invoke cloud infrastructure APIs (AWS ECS/EKS or Azure Container Apps) to scale Garnet memory limits dynamically when saturation exceeds 90%.
  • Integrate with PagerDuty via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert for Sev-1 alerts when active key evictions impact mission-critical caches.
  • Add automated keyspace sampling (SCAN or MEMORY USAGE) to identify and report the top memory-consuming key prefixes.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.