Use Pulsar Realtime Trigger to push events into MySQL
Stream Apache Pulsar messages straight into MySQL in real time, one row per event.
Catch Redis caches that reject writes with OOM and stores that silently evict data, alert Slack, set maxmemory-policy with CONFIG SET and verify.
The right maxmemory-policy depends entirely on what an instance holds, and the wrong one fails in two opposite ways:
noeviction, the default, stops accepting writes once it reaches maxmemory: every SET fails with OOM command not allowed, and the application sees errors instead of a cache miss.maxmemory at all grows until the host runs out of memory.This blueprint reads maxmemory, maxmemory-policy and the eviction and error counters of every instance, and checks them against the role you declare. It alerts Slack, and can apply the right setting with CONFIG SET, then read it back to verify.
This blueprint was created by zkasuran.
| Finding | Role | Severity | Rule | Fix |
|---|---|---|---|---|
STORE_EVICTS |
STORE |
Critical | Any policy other than noeviction, with the keys already evicted |
maxmemory-policy noeviction |
CACHE_REJECTS_WRITES |
CACHE |
High | noeviction, with the error replies so far |
maxmemory-policy <cache_policy> |
CACHE_UNBOUNDED |
CACHE |
High | maxmemory 0 |
maxmemory <cache_maxmemory> |
CACHE_VOLATILE_POLICY |
CACHE |
Medium | A volatile-* policy, which only evicts keys with a TTL |
Report only |
UNREACHABLE |
any | High | No CONFIG reply |
Report only |
INVALID_ROLE |
other | High | Role is not CACHE or STORE |
Report only |
read (io.kestra.plugin.core.flow.Loop) runs CONFIG GET maxmemory-policy, CONFIG GET maxmemory and INFO stats on each instance with io.kestra.plugin.redis.cli.RedisCLI, read-only. An unreachable instance does not stop the others.findings applies the rules per role in one jq expression. summary logs the result.route (io.kestra.plugin.core.flow.If):alert posts to Slack.remediate_gate runs only when auto_remediate is true and dry_run is false.remediate (concurrencyLimit: 1) runs each CONFIG SET in its own task.reread reads the settings again, and verify_result fails if any instance still does not match its role.errors alerts Slack when the flow fails.OOM command not allowed errors from a full cache, or lost sessions after a traffic spike.RedisCLI example.The eviction policy is set once, often by a Helm chart default, and never checked against the instance's role. Kestra keeps the role of every instance next to the flow and checks them on a schedule. It sends mismatches to Slack with their impact, applies the fix behind auto_remediate and dry_run, verifies it, and keeps a history of every change.
On Kestra 2.0.5 OSS against three Redis 7 containers, with a local HTTP sink standing in for Slack:
bp-rcache: maxmemory 4mb, noeviction. Filling it, 992 of 3,000 SET failed with OOM command not allowed;bp-rqueue: maxmemory 64mb, allkeys-lru. Filling it, Redis evicted 4,853 session keys;bp-rnolimit: no maxmemory.| Run | Inputs | Result |
|---|---|---|
| 1 | defaults | 4 findings, with the 992 error replies and 4,853 evicted keys. Alert sent |
| 2 | auto_remediate: true, dry_run: true |
Same report. The cache is still noeviction |
| 3 | auto_remediate: true, dry_run: false |
4 CONFIG SET applied and verified. Then in Redis: a SET on the full cache returns OK and evicts old keys. 2,000 more writes to the full store are rejected with OOM and no key is evicted, so the application gets an error instead of losing data |
| 4 | defaults | Every instance matches its role |
| 5 | unknown host | UNREACHABLE reported |
RedisCLI tasks start. CONFIG must be allowed for remediation.CACHE if losing a key is acceptable, STORE if not.docker run -d --name redis-cache redis:7-alpine redis-server --maxmemory 4mb --maxmemory-policy noeviction;SET until writes fail.SLACK_WEBHOOK_URL: used by alert and the errors block. In Kestra OSS, provide it as the base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Default | Purpose |
|---|---|---|
instances |
2 example hosts | Host to role, CACHE or STORE |
port |
6379 |
Port on every instance |
cache_policy |
allkeys-lru |
Policy applied to caches |
cache_maxmemory |
256mb |
Limit applied to caches with none |
network |
empty | Docker network for the redis-cli containers |
auto_remediate |
false |
Allow CONFIG SET |
dry_run |
true |
Must be false for a change to apply |
SLACK_WEBHOOK_URL secret.instances.auto_remediate: true and dry_run: false, then persist the settings in redis.conf or with CONFIG REWRITE.hourly trigger, which always runs in safe mode.evicted_keys grows between two runs on a cache, a sign it is undersized.password: "{{ secret('REDIS_PASSWORD') }}" on each RedisCLI task.CONFIG REWRITE after verify_result when your instances use a writable config file.