Skip to content

Add Prometheus alerting rules for KV-cache metrics#676

Open
satyamg1620 wants to merge 1 commit into
llm-d:mainfrom
satyamg1620:prom-alert-rules
Open

Add Prometheus alerting rules for KV-cache metrics#676
satyamg1620 wants to merge 1 commit into
llm-d:mainfrom
satyamg1620:prom-alert-rules

Conversation

@satyamg1620

Copy link
Copy Markdown

Summary

Adds default Prometheus alerting rules for the KV-cache metrics,
so operators get sensible alerts out of the box instead of writing their own.

Rules (under kv_connectors/llmd_fs_backend/docs/deployment/monitoring/):

  • KVCacheLowIndexHitRatio — hit ratio < 30% while lookups are happening
  • KVCacheHighLookupLatency — P99 kvcache_index_lookup_latency_seconds > 500ms
  • KVCacheAbnormalEvictionSpike — eviction rate > 5× its 1h baseline
  • KVCacheHighTokenizationLatency — P99 tokenization latency > 1s
  • VLLMHighRequestBacklog / VLLMHighTTFT — optional vLLM-side alerts

Deliverables

  • kvcache-alerts.rules.yml — canonical plain rules file
  • prometheus-rules.yamlPrometheusRule CRD for prometheus-operator setups
  • prometheus.yaml — rules wired into the example config via rule_files
  • kvcache-alerts.test.yaml — promtool unit tests
  • monitoring.md — new "Alerting" section

Fixes: #664

Signed-off-by: satyamg1620 <Satyam.Gupta.3@ibm.com>
Copilot AI review requested due to automatic review settings June 20, 2026 19:20
@github-actions github-actions Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a default set of Prometheus alerting rules for KV-cache health/saturation signals, and wires them into the example monitoring deployment so operators get alerts out of the box (with promtool tests to validate correctness).

Changes:

  • Added canonical Prometheus alerting rules for KV-cache index + tokenization metrics (plus optional vLLM alerts).
  • Wired alert rule loading into the example Prometheus ConfigMap/deployment and added a Prometheus Operator PrometheusRule variant.
  • Added promtool unit tests and updated monitoring documentation with an “Alerting Rules” section.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
kv_connectors/llmd_fs_backend/docs/monitoring.md Documents where alert rules live, how to load/validate them, and operator-specific usage.
kv_connectors/llmd_fs_backend/docs/deployment/monitoring/prometheus.yaml Loads alert rule files via rule_files and embeds the rule file into the example Prometheus ConfigMap.
kv_connectors/llmd_fs_backend/docs/deployment/monitoring/prometheus-rules.yaml Adds a PrometheusRule CRD with the same alert definitions for prometheus-operator installs.
kv_connectors/llmd_fs_backend/docs/deployment/monitoring/kvcache-alerts.test.yaml Adds promtool unit tests covering the new alert rules.
kv_connectors/llmd_fs_backend/docs/deployment/monitoring/kvcache-alerts.rules.yml Adds the canonical plain-format rules file and associated guidance/comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +122 to +124
| `monitoring/kvcache-alerts.rules.yml` | Canonical plain rules file (source of truth). |
| `monitoring/prometheus-rules.yaml` | `PrometheusRule` CRD for prometheus-operator setups. |
| `monitoring/kvcache-alerts.test.yaml` | `promtool` unit tests for the rules. |
| `monitoring/prometheus-rules.yaml` | `PrometheusRule` CRD for prometheus-operator setups. |
| `monitoring/kvcache-alerts.test.yaml` | `promtool` unit tests for the rules. |

The bundled `monitoring/prometheus.yaml` already wires the rules in via
Comment on lines +3 to +7
# This is the canonical, plain-format rules file. It is consumed two ways:
# 1. Wired into the example prometheus.yml via `rule_files` (see prometheus.yaml).
# 2. Mirrored into a PrometheusRule CRD for prometheus-operator setups
# (see prometheus-rules.yaml). Keep the two in sync.
#
Comment on lines +6 to +8
# Rule content is kept identical to kvcache-alerts.rules.yml — update both
# together. If not using the operator, wire kvcache-alerts.rules.yml into your
# prometheus.yml via `rule_files` instead (see prometheus.yaml).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Observability] Add Prometheus alerting rules for KV-cache metrics

2 participants