Learn Labs
Operations

Monitoring

The metrics that matter, the alerts, and the dashboard

Every SeaweedFS component serves Prometheus metrics on its -metricsPort. The Prometheus stack from the Prometheus & Grafana module scrapes all eight:

- job_name: seaweedfs-masterleader status, volume layout, replicationstatic_configs:- targets: ["host.docker.internal:9324", "host.docker.internal:9331", "host.docker.internal:9332"]- job_name: seaweedfs-volumedisk space, read/write failuresstatic_configs:- targets: ["host.docker.internal:9325", "host.docker.internal:9326","host.docker.internal:9327", "host.docker.internal:9330"]- job_name: seaweedfs-filerfiler and the S3 gateway (same process, same port)static_configs:- targets: ["host.docker.internal:9328"]

The metrics that matter

MetricMeans
SeaweedFS_master_is_leader1 on the leader. Every component exports it; only the leader says 1
SeaweedFS_master_volume_layout_writable{collection}Writable volumes per bucket. 0 = writes to it fail
SeaweedFS_master_under_replicated_volumes{collection}Volumes missing copies
SeaweedFS_volumeServer_resource{type="avail"} and {type="all"}Disk space per volume server
SeaweedFS_volumeServer_file_read_failures, _write_failuresDisk-level errors
SeaweedFS_s3_request_total{bucket,code,type}S3 requests by bucket, status and operation
SeaweedFS_s3_request_seconds_bucketS3 latency histogram
SeaweedFS_s3_bucket_size_bytes, _object_countPer-bucket usage

Three traps in these metrics

S3 request metrics also appear only after the first request: a freshly started gateway has no SeaweedFS_s3_request_total series at all.

Alerts

SeaweedFSVolumeServerDown up{job="seaweedfs-volume"} == 0 for 1mSeaweedFSUnderReplicated sum(under_replicated and on (instance) is_leader == 1) > 0 for 10mSeaweedFSNoWritableVolumes sum by (collection) (writable ... is_leader == 1) == 0 for 5m criticalSeaweedFSNoMasterLeader sum(SeaweedFS_master_is_leader) != 1 for 2m criticalSeaweedFSS3Errors 5xx / all S3 requests > 1% for 5mSeaweedFSDiskFillingUp avail / ignoring (type) all < 15% for 15m

SeaweedFSNoMasterLeader uses != 1 on purpose: 0 means no leader (no new writes), and 2 would mean a split brain, which Raft should never allow but you'd want to know about immediately.

The dashboard

Grafana provisions SeaweedFS Overview from grafana/dashboards/Storage/seaweedfs-overview.json:

  • Top row: volume servers up, leader count, under-replicated volumes, S3 requests per second, S3 error ratio, lowest free disk.
  • S3 gateway: requests by operation and by bucket, p99 latency by operation, bytes in and out.
  • Cluster: writable volumes per bucket, free disk per server, read and write failures, leader changes, bucket sizes and object counts.

Lab

  1. Open the dashboard and run s3_basics.py a few times. Which operation type is slowest at p99?
  2. Stop one volume server and watch which panels and alerts change, and how long each takes.
  3. Stop the leader master and find the leader change on the dashboard.

On this page