Links#
1. Dashboard Rule#
Folder: Database
Dashboard: Valkey - Overview
Rows:
Overview:
engine CPU、host CPU、memory、connections、eviction、hit rate、replication lag
Drilldown:
network in/out、replication lag detail
Capacity:
memory usage trend、host freeable memory、connection trend、network trend、eviction trend
Debug:
swap usage 这类宿主机压力信号,不放第一屏;排查 host 压力时查看2. Overview#
| Panel | Metrics | Why |
|---|---|---|
| Engine CPU | EngineCPUUtilization |
Redis / Valkey 主线程压力 |
| Host CPU | CPUUtilization |
host 层资源压力 |
| Memory usage | DatabaseMemoryUsagePercentage |
判断缓存空间是否接近打满 |
| Host freeable memory | FreeableMemory |
辅助看宿主机内存缓冲空间,不等于可用缓存内存 |
| Evictions per period | Evictions |
当前 CloudWatch / YACE 周期里发生了多少 eviction |
| Hit rate | CacheHits, CacheMisses |
cache 是否真正有效 |
| Replication lag | ReplicationLag |
replica / failover 风险 |
| Connections | CurrConnections, NewConnections |
client 连接压力 |
3. Drilldown#
| Panel | Metrics | Why |
|---|---|---|
| Network in / out | NetworkBytesIn, NetworkBytesOut |
看流量方向和波动 |
| Replication lag detail | ReplicationLag |
作为 overview 之外的第二视角看复制延迟 |
4. Capacity#
| Panel | Metrics | Why |
|---|---|---|
| Memory usage trend | DatabaseMemoryUsagePercentage |
评估是否需要扩容或调整 TTL |
| Host freeable memory | FreeableMemory |
观察 host 是否还有可回收内存,但不作为缓存剩余空间的直接判断 |
| Eviction trend | Evictions 1h rolling sum |
看 eviction 是偶发还是持续存在 |
| Connection trend | CurrConnections, NewConnections |
评估 client pool 和 maxclients |
| Network trend | NetworkBytesIn, NetworkBytesOut |
评估 node type 和流量增长 |
| Hit rate trend | hit rate from hits / misses | 判断 cache 投入是否有效 |
5. Debug#
| Panel | Metrics | Why |
|---|---|---|
| Swap | SwapUsage |
swap 会显著影响 latency |
6. YACE Metrics#
如果 Valkey dashboard 使用 aws_elasticache_* metrics,需要 YACE 采集 AWS/ElastiCache。Valkey / Redis OSS 内部 keyspace、command 细节仍然建议用 redis_exporter 补充。
YACE config:
apiVersion: v1alpha1
sts-region: ap-northeast-1
discovery:
jobs:
- type: AWS/ElastiCache
regions:
- ap-northeast-1
customTags:
- key: environment
value: uat
period: 300
length: 600
nilToZero: true
metrics:
- name: EngineCPUUtilization
statistics: [Average]
- name: CPUUtilization
statistics: [Average]
- name: DatabaseMemoryUsagePercentage
statistics: [Average]
- name: FreeableMemory
statistics: [Average]
- name: Evictions
statistics: [Sum]
- name: CacheHits
statistics: [Sum]
- name: CacheMisses
statistics: [Sum]
- name: ReplicationLag
statistics: [Maximum]
- name: CurrConnections
statistics: [Average]
- name: NewConnections
statistics: [Sum]
- name: NetworkBytesIn
statistics: [Sum]
- name: NetworkBytesOut
statistics: [Sum]
- name: SwapUsage
statistics: [Average]Exporter naming note:
当前 Valkey dashboard 按实际 YACE metric name 对齐,例如:
aws_elasticache_engine_cpuutilization_average
aws_elasticache_cpuutilization_averageFreeableMemory note:
FreeableMemory 是 host-level freeable memory,单位 bytes。
它不等于 Valkey 可用缓存内存。
判断缓存是否接近打满,优先看:
DatabaseMemoryUsagePercentage
Evictions
SwapUsageSwapUsage note:
SwapUsage 是 host-level 指标,不是 engine-level 指标。
它有值,不一定代表 CPU 或缓存使用率异常。
更需要关注的是:
SwapUsage 持续升高
或同时伴随 latency / memory pressure 变差Evictions note:
Evictions 是因为触发 maxmemory 限制,被 Valkey / Redis OSS 淘汰掉的 key 数量。
Evictions = 0:
很多时候是正常的,通常说明当前还没有因为内存压力开始淘汰 key。
Evictions > 0:
说明新写入已经开始逼近容量边界,engine 需要腾空间。
它不是“缓存有没有在工作”的指标。
判断容量是否真的紧张,应该结合:
DatabaseMemoryUsagePercentage
Evictions
CacheMisses
SwapUsage
一起看。确认 metric name:
{__name__=~"aws_elasticache_.*"}7. Do Not Put In Overview#
不要放:
每个 command 的全量延迟
keyspace 详细分布
slowlog 文本内容
原因:
ElastiCache overview 重点是 CPU、memory、eviction、hit rate、replication、connections