监控告警

JuiceFS 文件系统的监控指标与 Grafana 仪表盘

JuiceFS 每个实例会在配置的端口(默认 9567)暴露 Prometheus 格式的监控指标。


监控架构

JuiceFS Instance (port: 9567)
    ↓ /metrics
VictoriaMetrics (scrape)
    ↓
Grafana Dashboard

Pigsty 会自动将 JuiceFS 实例注册到 VictoriaMetrics,目标文件位于:

/infra/targets/juice/<hostname>.yml

关键指标

对象存储指标

指标类型说明
juicefs_object_request_durations_histogram_secondshistogram对象存储请求延迟分布
juicefs_object_request_data_bytescounter对象存储数据传输量
juicefs_object_request_errorscounter对象存储请求错误数

缓存指标

指标类型说明
juicefs_blockcache_hitscounter块缓存命中数
juicefs_blockcache_missescounter块缓存未命中数
juicefs_blockcache_writescounter块缓存写入数
juicefs_blockcache_dropscounter块缓存丢弃数
juicefs_blockcache_evictionscounter块缓存淘汰数
juicefs_blockcache_hit_bytescounter缓存命中字节数
juicefs_blockcache_miss_bytescounter缓存未命中字节数

元数据指标

指标类型说明
juicefs_meta_ops_durations_histogram_secondshistogram元数据操作延迟分布
juicefs_transaction_durations_histogram_secondshistogram事务延迟分布
juicefs_transaction_restartcounter事务重试次数

FUSE 操作指标

指标类型说明
juicefs_fuse_ops_durations_histogram_secondshistogramFUSE 操作延迟分布
juicefs_fuse_read_size_byteshistogram读操作大小分布
juicefs_fuse_written_size_byteshistogram写操作大小分布

文件系统指标

指标类型说明
juicefs_used_spacegauge已使用空间(字节)
juicefs_used_inodesgauge已使用 inode

常用 PromQL

缓存命中率

rate(juicefs_blockcache_hits[5m]) /
(rate(juicefs_blockcache_hits[5m]) + rate(juicefs_blockcache_misses[5m]))

对象存储 P99 延迟

histogram_quantile(0.99, rate(juicefs_object_request_durations_histogram_seconds_bucket[5m]))

元数据操作 P99 延迟

histogram_quantile(0.99, rate(juicefs_meta_ops_durations_histogram_seconds_bucket[5m]))

读写吞吐量

# 读吞吐
rate(juicefs_blockcache_hit_bytes[5m]) + rate(juicefs_blockcache_miss_bytes[5m])

# 写吞吐
rate(juicefs_fuse_written_size_bytes_sum[5m])

指标采集配置

JuiceFS 实例注册到 VictoriaMetrics 的目标文件格式:

# /infra/targets/juice/<hostname>.yml
- labels: { ip: 10.10.10.10, ins: "node-jfs", cls: "jfs" }
  targets: [ 10.10.10.10:9567 ]

如需手动重新注册,执行:

./juice.yml -l <ip> -t juice_register

最后修改 2026-01-25: add piglet docs (9e7ad23)