redis-observability — скилл для Claude Code: метрики и отладка Redis
Подсказывает, какие метрики Redis держать под наблюдением и какие встроенные команды запускать при разборе инцидентов.
npx skills add redis/agent-skills --skill redis-observability -a claude-codeЧто делает redis-observability
Скилл описывает набор метрик из INFO, которые стоит выгружать в систему мониторинга: used_memory, connected_clients, blocked_clients, instantaneous_ops_per_sec, keyspace_hits и keyspace_misses, rejected_connections, rdb_last_save_time. Для каждой указано, при каком значении подавать алерт — например, память выше 80% от maxmemory или доля попаданий в кэш ниже 80%. Рядом лежит короткий пример на Python: он считает hit ratio и печатает память, число клиентов и ops/sec.
Вторая часть — таблица команд для быстрой диагностики. SLOWLOG GET 10 показывает команды, перешагнувшие порог slowlog-log-slower-than (по умолчанию 10ms), с точной длительностью в микросекундах. MEMORY DOCTOR выдаёт абзац о том, что необычного в расходе памяти прямо сейчас. Ещё есть INFO all, MEMORY STATS, MEMORY USAGE <key>, CLIENT LIST, FT.INFO <idx> и FT.PROFILE <idx> SEARCH QUERY "..." для профилирования поисковых запросов.
Для интерактивной работы упоминается официальный GUI Redis Insight: он показывает те же данные из SLOWLOG, INFO и FT.PROFILE визуально. Автор прямо оговаривает, что это не замена выгрузке метрик в мониторинг, так что для алертов всё равно придётся настроить экспорт в Prometheus, Datadog или CloudWatch.
Какие задачи решает
- настроить алерты на память, соединения и долю попаданий в кэш
- разобраться, почему выросла задержка Redis
- найти медленные команды через
SLOWLOG - понять, куда утекает память, по выводу
MEMORY DOCTOR - профилировать медленный запрос
FT.SEARCH
Примеры запросов агенту
- Помоги настроить мониторинг Redis: какие метрики выгружать и при каких значениях алертить
- У меня выросла задержка Redis — пройдись по
SLOWLOGиINFO, покажи, что тормозит - Как профилировать медленный
FT.SEARCHчерезFT.PROFILE?
Как установить redis-observability
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-observability -a claude-code2Вручную: положить файлы
~/.claude/skills/redis-observability/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/redis-observability/
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-observability -a codex2Вручную: положить файлы
.agents/skills/redis-observability/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-observability -a cursor2Вручную: положить файлы
.cursor/skills/redis-observability/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install redis/agent-skills redis-observability2Вручную: положить файлы
.github/skills/redis-observability/SKILL.md1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-observability -a gemini-cli2Командой платформы
gemini skills install https://github.com/redis/agent-skills --path skills/redis-observabilityВручную: положить файлы
.devin/skills/redis-observability/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-observability -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о redis-observability
Как установить redis-observability в Claude?
Выполните npx skills add redis/agent-skills --skill redis-observability -a claude-code. Скилл окажется в ~/.claude/skills/redis-observability/SKILL.md.
Что делает redis-observability?
Даёт агенту справочник по наблюдаемости Redis: список метрик из INFO с порогами для алертов и набор встроенных команд для разбора инцидентов.
Нужен ли Redis Insight, если метрики уже идут в мониторинг?
Нет. Insight — официальный GUI для интерактивной работы с ключами и профилирования индексов, но выгрузку метрик в Prometheus, Datadog или CloudWatch он не заменяет.
Исходный текст
SKILL.md · MIT
---
name: redis-observability
description: Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO, MEMORY DOCTOR, CLIENT LIST, FT.PROFILE), and when to use the Redis Insight GUI. Use when setting up monitoring or alerts for a Redis instance, diagnosing a performance regression, profiling a slow FT.SEARCH query, or wiring Redis metrics into Prometheus, Datadog, or similar.
license: MIT
metadata:
author: Redis, Inc.
version: "0.1.0"
---
# Redis Observability
What to watch, what to run, and what to alert on. Covers the metrics every Redis deployment should monitor and the built-in commands for ad-hoc diagnosis.
## When to apply
- Setting up monitoring or alerts for a Redis instance.
- Diagnosing a Redis performance regression (high latency, memory pressure, connection storms).
- Profiling a slow `FT.SEARCH` or pipeline.
- Wiring Redis metrics into Prometheus, Datadog, CloudWatch, or similar.
## 1. Monitor these metrics
These come from `INFO` and should be exported to your monitoring system.
| Metric | What it tells you | Alert when |
|---|---|---|
| `used_memory` | Current memory usage | > 80% of `maxmemory` |
| `connected_clients` | Open connections | Sudden spikes or drops |
| `blocked_clients` | Clients waiting on blocking ops | > 0 sustained |
| `instantaneous_ops_per_sec` | Current throughput | Significant drops |
| `keyspace_hits` / `keyspace_misses` | Cache hit ratio | Hit ratio < 80% |
| `rejected_connections` | Hit `maxclients` cap | > 0 |
| `rdb_last_save_time` | Last persistence snapshot | Too old vs. RPO |
```python
info = redis.info()
hit_ratio = info["keyspace_hits"] / max(1, info["keyspace_hits"] + info["keyspace_misses"])
print(f"Memory: {info['used_memory_human']}")
print(f"Clients: {info['connected_clients']}")
print(f"Ops/sec: {info['instantaneous_ops_per_sec']}")
print(f"Hit ratio: {hit_ratio:.1%}")
```
See [references/metrics.md](references/metrics.md).
## 2. Built-in commands for debugging
Reach for these when something looks off.
| Topic | Command |
|---|---|
| Slow commands | `SLOWLOG GET 10` / `SLOWLOG LEN` / `SLOWLOG RESET` |
| Server snapshot | `INFO all` (or `INFO memory` / `INFO stats` / `INFO clients` / `INFO replication`) |
| Memory diagnostics | `MEMORY DOCTOR` / `MEMORY STATS` / `MEMORY USAGE <key>` |
| Connections | `CLIENT LIST` / `CLIENT INFO` |
| RQE / Search | `FT.INFO <idx>` / `FT.PROFILE <idx> SEARCH QUERY "..."` |
The two most useful for incident triage:
- **`SLOWLOG GET`** to find queries that exceeded the `slowlog-log-slower-than` threshold (10ms by default). The output shows the exact command and duration in microseconds.
- **`MEMORY DOCTOR`** for memory pressure — it returns a one-paragraph summary of what's unusual about memory usage right now.
```python
for entry in redis.slowlog_get(10):
print(f"{entry['duration']}μs {entry['command']}")
```
See [references/commands.md](references/commands.md).
## 3. Redis Insight
For interactive use (running queries, browsing keys, profiling indexes), [Redis Insight](https://redis.io/insight/) is the official GUI. It surfaces the same `SLOWLOG` / `INFO` / `FT.PROFILE` data visually and includes Redis Copilot for natural-language queries. Useful during development and incident response; not a replacement for exporting metrics to your monitoring system.
## References
- [Redis: Latency monitoring](https://redis.io/docs/latest/operate/oss_and_stack/management/optimization/latency/)
- [Redis Insight](https://redis.io/insight/)
© Redis, Inc. · MIT · redis/agent-skills