Skip to content

feat(monitoring): alert when a noeviction Valkey nears its bound - #2615

Merged
dan-petty merged 2 commits into
mainfrom
feat/2094-valkey-memory-bound-alert
Oct 29, 2026
Merged

dan-petty merged 2 commits into
mainfrom
feat/2094-valkey-memory-bound-alert

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

ValkeyMemoryNearBound warns when a Valkey with the policy noeviction keeps its data above 80% of its maxmemory for 10 minutes. The cache Valkey (llm/valkey) has a bound of 1536 MiB and the policy noeviction (#711). At the bound it refuses each write, and Open WebUI cannot keep its session and task state. ValkeyCacheErrors does not cover a refused write.

The rule selects a Valkey by the policy that redis_instance_info reports, not by its job:

  • llm/valkey is the only exported Valkey that the rule watches today.
  • llm/valkey-devops evicts at its bound (allkeys-lru), so a full cache is normal there.
  • Argo CD's Redis has no bound (maxmemory 0, ratio +Inf). A guard leaves it out.
  • llm/valkey-runs has the same policy but no exporter. The rule covers it when it gets one.

The rule is in a group of its own, valkey-memory, after homelab-services, so that promtool unit tests cover it. k8s/README.md lists the alert.

Closes #2094

ValkeyMemoryNearBound warns when a Valkey with the policy noeviction keeps
its data above 80% of its maxmemory for 10 minutes. At the bound the cache
Valkey refuses each write, and Open WebUI loses its session and task state.

Refs #2094
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results (branch at 3ee88a12, rebased onto 29f5a745)

  • Failing first: before the rule existed, uv run devops ci test tests/test_k8s_monitoring_alerting.py gave 3 failed, 40 passed. These failed: test_the_baseline_rule_set, test_the_valkey_memory_rule_warns_on_a_valkey_that_refuses_writes_near_its_bound and the promtool test [valkey-memory].
  • After the change: 43 passed, including the promtool tests (promtool 3.15.0), with none skipped. The full suite gave 12,635 passed in 4 m 59 s.
  • Mutations, run through promtool test rules on the new fixture: each was caught (exit 1).
    • The rule without the redis_memory_max_bytes > 0 guard.
    • The rule without the redis_instance_info{maxmemory_policy="noeviction"} join.
    • The threshold raised to 0.95.
  • Live check, read-only, on Prometheus on 2026-10-29:
    • llm/valkey: max 1610612736 bytes, used 1427432 bytes, policy noeviction.
    • llm/valkey-devops: max 100663296 bytes, policy allkeys-lru.
    • Argo CD's Redis: max 0, policy noeviction, ratio +Inf.
    • Without its threshold, the expression returns only llm/valkey, at 0.00089. With the threshold, it returns no series.

@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 03:36
@dan-petty
dan-petty merged commit f452644 into main Oct 29, 2026
16 checks passed
@dan-petty
dan-petty deleted the feat/2094-valkey-memory-bound-alert branch October 29, 2026 04:16
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.15.0](v0.14.0...v0.15.0)
(2026-10-29)


### Features

* **k8s:** derived push entries, Secret types, one stack list
([#2618](#2618))
([3634c6f](3634c6f)),
closes [#2008](#2008)
* **k8s:** image-pins refuses an image on the latest tag
([#2617](#2617))
([548b3ba](548b3ba)),
closes [#2093](#2093)
* **monitoring:** alert when a noeviction Valkey nears its bound
([#2615](#2615))
([f452644](f452644)),
closes [#2094](#2094)
* **review:** golangci-lint runs offline in the review sandbox
([#2622](#2622))
([20915ce](20915ce)),
closes [#2129](#2129)
* **review:** the SARIF export writes how each tool run ended
([#2620](#2620))
([8f8ef44](8f8ef44)),
closes [#2100](#2100)


### Bug Fixes

* **release:** parse release pull request number safely in urgent merge
([#2621](#2621))
([262244d](262244d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(monitoring): an alert fires when the cache valkey nears its memory bound

1 participant