New to Kestra?
Use blueprints to kickstart your first workflows.
Audits Aerospike namespace RAM and storage capacity against stop-writes limits, calculating headroom and alerting DBAs on Slack.
In ultra-low latency NoSQL architectures powered by Aerospike, each data namespace is configured with strict safety ceilings (stop-writes-pct and high-water-memory-pct). When memory utilization or storage device capacity crosses the configured stop-writes-pct threshold (typically 90%), Aerospike immediately enters a read-only protective state.
Once stop-writes is triggered, all subsequent incoming write transactions (inserts, updates, and deletes) fail with AS_ERR_FAIL_FORBIDDEN error codes. In mission-critical deployments such as payment authorization, fraud detection, and user profile stores, unexpected write rejection leads to catastrophic transaction processing halts across client microservices.
This blueprint provides an automated Aerospike capacity sentinel. Running on a recurrent ten-minute schedule, it communicates with Aerospike cluster nodes via standard info protocol sockets, calculates remaining memory and device headroom before stop-writes enforcement, and delivers proactive alerts to database administrators on Slack.
poll_aerospike_headroom trigger (io.kestra.plugin.core.trigger.Schedule) initiates the metric scan every ten minutes.scan_namespace_headroom task (io.kestra.plugin.scripts.python.Script) opens a socket to the Aerospike daemon, querying namespace/<namespace> to extract memory-size, used-bytes-memory, stop-writes-pct, and current stop-writes flags.evaluate_stop_writes_risk flowable task (io.kestra.plugin.core.flow.If) branches based on whether calculated headroom has eroded beneath the designated safety margin.alert_slack_stop_writes_breach (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) delivers an actionable notification with current saturation percentages and dynamic CLI reconfiguration commands (asinfo set-config).log_healthy_namespace_capacity logs healthy operational state.export_stop_writes_manifest task records an execution summary for SRE telemetry ingestion.flowchart TD
A[Schedule: Every 10 Minutes] --> B[scan_namespace_headroom: Aerospike Info Protocol]
B --> C{Stop-Writes Headroom Breached?}
C -- Yes --> D[alert_slack_stop_writes_breach: Slack Webhook]
C -- No --> E[log_healthy_namespace_capacity: Log]
D --> F[export_stop_writes_manifest: Return JSON]
E --> F
| Name | Type | Default | Description |
|---|---|---|---|
aerospike_host |
STRING | "localhost" |
Hostname or IP address of the Aerospike cluster seed node. |
aerospike_port |
INT | 3000 |
Network communication port exposing Aerospike info commands. |
target_namespace |
STRING | "test" |
Name of the Aerospike data namespace to audit. |
headroom_threshold_percentage |
INT | 15 |
Minimum acceptable headroom percentage before alerting. |
slack_channel |
STRING | "#aerospike-reliability" |
Slack channel destination for distributed database alerts. |
{{ outputs.scan_namespace_headroom.vars.is_critical }}: Boolean flag indicating if headroom breached threshold or stop-writes triggered.{{ outputs.scan_namespace_headroom.vars.headroom_pct }}: Remaining percentage headroom before write rejection.{{ outputs.scan_namespace_headroom.vars.mem_usage_pct }}: Current namespace RAM utilization percentage.{{ outputs.scan_namespace_headroom.vars.stop_writes_limit }}: Configured stop-writes limit percentage on the namespace.{{ outputs.scan_namespace_headroom.outputFiles['aerospike_headroom_report.json'] }}: Structured diagnostic JSON artifact.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL with permissions to post messages.SLACK_WEBHOOK_URL in your Kestra namespace secrets.aerospike_host, aerospike_port, and target_namespace to reflect your cluster deployment.ssl.wrap_socket and authenticate with user credentials via the Aerospike binary protocol.storage-engine device), stop-writes can be triggered by either RAM or disk exhaustion; monitor both resources.asinfo -v "set-config:context=namespace;id=<namespace>;memory-size=<new_size>" after human approval.asinfo -v "truncate:namespace=<ns>;set=<set_name>".namespaces info command.