Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Cortex Ingester Ring Unhealthy and Series Overflow Sentinel

Audits Cortex ingester telemetry to detect hash ring member node failures, in-memory timeseries overflow, and chunk write flush errors.

Categories
CloudInfrastructure

Automates continuous health and consensus stability surveillance for Cortex multi-tenant metrics storage ingesters.

How it works

  1. A schedule trigger executes the Cortex ingester audit workflow every 15 minutes.
  2. The Python task queries the Cortex ingester metrics service endpoint on port 8000.
  3. The script extracts hash ring member node states, in-memory active series counts, and chunk flush error totals.
  4. An evaluation gate determines whether unhealthy nodes, series overflow limits, or flush errors breach bounds.
  5. When ingester ring degradation is detected, a high-priority Slack alert is dispatched to the Observability SRE team.
  6. When ingesters maintain healthy ring consensus and stream timeseries to cold storage cleanly, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for metrics infrastructure governance and write SLA records.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Cortex Metrics]
    ScanMetrics --> EvalBreach{Unhealthy Nodes > 1 OR Series Overflow?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Observability Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Cortex State]
    SlackAlert --> EmitManifest[Debug Return: Metrics Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes Cortex ingester Prometheus metrics endpoints using Docker container runners.
  • Decision Gate: Evaluates whether unhealthy ring member counts or in-memory timeseries volumes exceed limits.
  • Notification Task: Dispatches structured Slack alerts with tenant identifier and unhealthy node metrics.
  • Audit Manifest: Emits JSON execution payloads containing Cortex storage health and timestamps.

Key capabilities

  • Continuous surveillance of Cortex consistent hash ring topologies and member heartbeat health.
  • Early warning detection for timeseries churn spikes leading to in-memory Series limit exhaustion.
  • Automated tracking of chunk flush failures to object storage backends like S3 or GCS.
  • Zero host dependency execution via isolated containerized Python runners.

What you get

  • Real-time visibility into distributed metrics ingestion quorum, node balance, and memory headroom.
  • Proactive alerts preventing 500 Internal Server Error ingestion dropouts during write replication quorum loss.
  • Standardized audit manifests containing exact active member totals and execution timestamps.
  • Zero-overhead deployment compatible with self-hosted Kubernetes clusters and managed cloud providers.

Who it's for

  • Observability and monitoring SREs operating multi-tenant Cortex, Mimir, or Thanos backends.
  • Platform reliability engineers tracking Prometheus remote-write ingestion latency and throughput.
  • Cloud infrastructure architects designing high-volume timeseries retention systems.
  • Enterprise DevOps teams validating write availability and timeseries cardinalities across teams.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages metrics control plane surveillance as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical ingester telemetry in searchable Kestra execution logs.

Use cases

  • Hash Ring Partition Prevention: Alerts engineers before member dropouts drop replication below quorum (RF=3).
  • Memory Headroom Gating: Monitors active memory series before high cardinality metrics trigger node OOM kills.
  • Chunk Flush Stall Detection: Identifies slow cloud storage write API rates during hourly chunk compaction cycles.

Inputs

Name Type Default Description
cortex_metrics_url STRING http://cortex-ingester.cortex.svc.cluster.local:8000 Internal HTTP URL exposing Prometheus metrics for Cortex.
tenant_id STRING enterprise-telemetry-tenant Identifier of the target Cortex tenant partition.
max_unhealthy_ring_nodes_threshold INT 1 Maximum allowable unhealthy ring nodes before alerting.
max_in_memory_series_limit INT 2000000 Maximum acceptable in-memory series count per ingester.
alert_on_ring_unhealthy BOOL true Toggle whether ring unhealthy status triggers an alert.

Expected outputs

  • {{ outputs.scan_cortex_telemetry.vars.unhealthy_ring_nodes_count }}: Count of unhealthy ingester nodes in the ring.
  • {{ outputs.scan_cortex_telemetry.vars.in_memory_series_count }}: Maximum observed in-memory timeseries volume.
  • {{ outputs.scan_cortex_telemetry.vars.active_ring_members_total }}: Total count of active healthy ring member nodes.
  • {{ outputs.scan_cortex_telemetry.vars.is_alerting }}: Boolean flag indicating if metrics storage SLA is breached.
  • {{ outputs.scan_cortex_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the storage audit run.

Prerequisites

  • Cortex 1.15+ deployed with Prometheus metrics enabled on port 8000.
  • Network connectivity from the Kestra worker to the Cortex ingester metrics service.
  • Configured Slack incoming webhook URL with permissions to post in observability alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing storage alerts to the Observability SRE Slack channel.

Quick start

  1. Verify that Cortex ingester exposes Prometheus metrics on HTTP port 8000.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your tenant identifier in tenant_id.
  4. Run a manual flow execution via the Kestra UI to validate metric ingestion.
  5. Enable the periodic_cortex_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • Gossip Protocol Partitions: Member-list gossip communication issues can report false unhealthy ring node states.
  • Disk WAL Write Stalls: Slow local NVMe disk writes can back up the ingester write-ahead log (WAL).
  • Object Storage Rate Limits: Ingester chunk flush errors often stem from cloud S3 rate limiting on PUT requests.
  • Replication Factor Settings: Ensure ingester ring replication factor (default 3) matches cluster sizing.

How to extend

  • Automated Ring Token Rebalance: Trigger an administrative ring cleanup API call to forget dead member nodes.
  • PagerDuty Escalation: Escalate to on-call observability engineers if unhealthy ring nodes persist for 2 cycles.
  • Tenant Cardinality Breakdown: Fetch per-metric series breakdown from the Cortex ruler API during series overflow alerts.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.