Skip to main content

Monitoring

From Web Console, you could check storage usage, inodes amount, QPS and traffic.

Also, we provide API for integrating status of the JuiceFS into your monitoring system (JSON and Prometheus compatible format).

JSON API

API URL: https://juicefs.com/api/volume/VOLUME_NAME/status?token=YOUR_TOKEN

VOLUME_NAME is the name of your volume, YOUR_TOKEN could be check out from the "Setting" of Web Console (it's the same token when you mount).

API response example:

{
"files": 1234, // Inode amount,
"dns": "a.meta.juicefs.io", // DNS domain,
"port": 9404, // Metadata service port
"size": 1024000, // Storage usage
"trash_files": 100, // Files amount in trash bin
"trash_size": 100000, // Size of files in trash bin
// Active clients within 2 hours
"clients": [
{
// Operation statistics of metadata service
"operations": {
"rename": 0, // Renaming a file or directory,
"setattr": 0, // set attributes
"read": 0, // read operation
"statfs": 0, // file system statistics
"wbytes": 0, // write bytes
"mkdir": 0, // directory creation
"mknod": 0, // file creation
"symlink": 0, // symbol link creation
"write": 0, // write operation
"getattr": 0, // read attributes
"lookup": 0, // lookup file or directory
"rmdir": 0, // remove directory
"rbytes": 0, // read bytes
"link": 0, // hard link creation
"readlink": 0, // read symbol link
"unlink": 0, // remove link
"open": 0, // open file
"readdir": 0 // read directory
},
// Operation statistics of client
"stats": {
"uptime": 21,
"cpuusage": 356212,
"memusage": 23243000,
"fuse_ops": 179,
"fuse_ops.create": 1,
"fuse_ops.flush": 1,
"fuse_ops.getattr": 39,
"fuse_ops.getattr-cached": 7,
"fuse_ops.statfs": 60,
"fuse_ops.opendir": 2,
"fuse_ops.release": 1,
"fuse_ops.releasedir": 1,
"fuse_ops.readdir": 13,
"fuse_ops.readdir.with_attrs": 4,
"fuse_ops.lookup": 54,
"fuse_ops.lookup.master": 44,
"fuse_ops.lookup.master.positive": 2,
"fuse_ops.lookup.master.negative": 42,
"fuse_ops.lookup.internal": 2,
"fuse_ops.lookup.cached": 8,
"fuse_ops.lookup.cached.readdir": 8,
"master": 12428,
"master.usec_ping": 59166,
"master.usec_timediff": 6109,
"master.bytes_received": 3915,
"master.bytes_sent": 8210,
"master.packets_sent": 203,
"master.packets_received": 100
},
"openfiles": 0, // open file count currently
"ip": "1.2.3.4", // Client IP,
"hostname": "my-host", // Your VM's hostname,
"version": "4.2.1", // Client version,
"mountpoint": "/jfs" // Endpoint you mounted
}, // client1

// ...... Other clients' data

]
}

Prometheus API

JuiceFS exposes a Prometheus API for each file system. The endpoint is https://juicefs.com/api/vol/VOLUME_NAME/metrics?token=API_TOKEN. You can configure data scraping from your own Prometheus instance. For on-prem deployments, you should change the address to match your on-prem JuiceFS Web Console. For details, please consult the JuiceFS team.

VOLUME_NAME is the JuiceFS Volume name, API_TOKEN is the API-only token, can be obtained from JuiceFS Web Console, under the "Access Control" tab.

Below is the example scrape config:

scrape_configs:
- job_name: 'juicefs'
scrape_interval: 15s
scheme: 'https'
metrics_path: '/api/vol/VOLUME_NAME/metrics'
params:
token: ['API_TOKEN']
static_configs:
- targets: ['juicefs.com']

You can visualize JuiceFS monitoring data in Grafana using the pre-built dashboard template provided by JuiceFS. Simply navigate to Grafana and load the template with the URL https://grafana.com/grafana/dashboards/20794/ or with ID 20794.

Metrics definition are listed in JuiceFS Metrics.

Client Statistics

JuiceFS has some virtual files in text format in the root directory of each mount point, which record real-time statistics and access log data of JuiceFS clients. For details, please refer to the "Troubleshooting Methods" document.