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

Aerospike Namespace Device High Watermark and Eviction Sentinel

Monitors Aerospike flash namespace disk utilization and eviction velocity to prevent stop-write lockouts and unintended TTL record purging.

Categories
DataInfrastructure

Audits Aerospike real-time NoSQL database telemetry across cluster nodes to detect namespace flash device capacity saturation, eviction velocity spikes, and stop-write triggers.

How it works

  1. A schedule trigger executes the database audit workflow every 15 minutes.
  2. The Python task queries the Aerospike Prometheus exporter endpoint (aerospike-exporter:9145).
  3. The script extracts namespace storage device utilization percentages, evicted record counters, active stop-write flags, and master object totals.
  4. An evaluation gate determines whether device saturation or active eviction rates breach operational safety bounds.
  5. When thresholds are breached, a high-priority Slack alert is dispatched to database administrators and platform SREs.
  6. When storage consumption remains safely below high-watermark thresholds, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for database capacity governance and SLA compliance archives.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Aerospike Exporter Metrics]
    ScanMetrics --> EvalBreach{Disk Used >= Threshold OR Evictions > 1000 OR Stop-Writes?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency DBA Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Namespace Capacity State]
    SlackAlert --> EmitManifest[Debug Return: Aerospike Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute intervals.
  • Script Task: Scrapes Aerospike Prometheus exporter metrics using Docker container isolation.
  • Decision Gate: Evaluates whether namespace device consumption exceeds high-watermark safety ceilings.
  • Notification Task: Dispatches structured Slack alerts with namespace identity and eviction metrics.
  • Audit Manifest: Emits JSON execution payloads containing storage capacity metrics and timestamps.

Key capabilities

  • Continuous surveillance of Aerospike namespace NVMe flash storage and memory devices.
  • Rapid detection of high-water-disk-pct breaches triggering automated background record evictions.
  • Immediate identification of stop-writes conditions locking applications out of insert operations.
  • Zero external dependency execution via isolated containerized Python runners.

What you get

  • Preemptive alerting on flash storage saturation before critical cache and session records are deleted.
  • Automated tracking of eviction velocity relative to total master record counts.
  • Real-time audit manifests capturing namespace capacity trends for hardware procurement planning.
  • Configurable tolerance thresholds adaptable to in-memory, hybrid-memory, and all-flash namespaces.

Who it's for

  • Database administrators maintaining ultra-low-latency Aerospike clusters.
  • SREs overseeing high-throughput real-time bidding, fraud detection, and session caching platforms.
  • Platform engineers managing NVMe flash storage arrays and bare-metal database nodes.
  • DevOps engineers diagnosing sudden cache miss spikes and application write rejections.

Why orchestrate this with Kestra

  • Deterministic Scheduling: Guarantees regular database capacity audits without fragile local crontabs.
  • Containerized Runners: Runs Python tasks inside isolated Docker containers without host library dependencies.
  • Condition Branching: Flowable If tasks route alerts and nominal logging cleanly without spaghetti code.
  • Enterprise Secret Safety: Securely injects Slack webhook credentials without plain-text exposure.

Use cases

  • Unintended TTL Eviction: Detects when storage fills up and Aerospike evicts records before their expected expiration.
  • Stop-Writes Emergency: Alerts immediately when disk utilization reaches stop-writes-pct (default 90%).
  • Flash Device Defrag Lag: Identifies when defragmentation workers cannot keep pace with write block allocation.
  • Node Capacity Imbalance: Surfaces uneven partition data distribution across cluster nodes.

Inputs

Name Type Default Description
aerospike_metrics_url STRING http://aerospike-exporter.database.svc.cluster.local:9145 Base HTTP URL exposing Aerospike Prometheus metrics.
namespace_name STRING user_sessions_cache Target Aerospike namespace under surveillance.
max_used_bytes_percent_threshold INT 85 Maximum allowable device usage percent before alerting.
lookback_minutes INT 15 Lookback evaluation window in minutes for eviction rates.
alert_on_high_watermark BOOL true Toggle Slack alert dispatch upon detecting high watermark.

Expected outputs

  • {{ outputs.scan_aerospike_namespace_metrics.vars.namespace_device_used_percent }}: Percentage of namespace device storage consumed.
  • {{ outputs.scan_aerospike_namespace_metrics.vars.evicted_records_count }}: Count of records evicted due to storage pressure.
  • {{ outputs.scan_aerospike_namespace_metrics.vars.is_stop_writes_active }}: Boolean flag indicating if stop-writes mode is engaged.
  • {{ outputs.scan_aerospike_namespace_metrics.vars.total_master_records }}: Total number of primary master records stored.
  • {{ outputs.scan_aerospike_namespace_metrics.vars.is_alerting }}: Boolean flag indicating whether watermark thresholds were breached.
  • {{ outputs.emit_audit_manifest.value }}: Structured JSON audit manifest emitted for compliance archives.

Prerequisites

  • Aerospike database cluster deployed with aerospike-prometheus-exporter active.
  • Exporter port 9145 reachable from the Kestra worker execution environment.
  • Docker daemon running on the Kestra host to execute containerized Python tasks.

Secrets

  • SLACK_WEBHOOK_URL: Incoming webhook URL for the target DBA Slack alerting channel.

Quick start

  1. Ensure aerospike-prometheus-exporter is scraping asadm or node info ports.
  2. Configure the SLACK_WEBHOOK_URL secret in your Kestra namespace settings.
  3. Specify your target namespace in namespace_name.
  4. Execute a manual test run via the Kestra UI to verify metric ingestion.
  5. Enable the periodic_aerospike_audit trigger to establish automated continuous surveillance.

Common pitfalls and troubleshooting

  • High-Watermark Parameter Tuning: In aerospike.conf, high-water-disk-pct triggers evictions; ensure it matches alerting limits.
  • Tombstone Accumulation: Heavy record deletions without truncate can leave tombstones occupying flash space.
  • LDT Deprecation: Ensure legacy Large Data Types are not bloating block allocations on older Aerospike releases.
  • Cold Start Duration: After node restart, Aerospike scans devices; wait for scan completion before reading metrics.

How to extend

  • Automated Namespace Truncate: Trigger an automated truncate task for temporary staging sets when stop-writes occurs.
  • Dynamic High-Watermark Adjustment: Chain a configuration update flow via asadm to temporarily raise thresholds during migrations.
  • PagerDuty Escalation: Escalate immediately to on-call database engineers if stop-writes is active on any node.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.