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:
{
"files": 1234, // Inode amount,
"dns": "a.meta.juicefs.io", // DNS domain,
"port": 9404, // Meta 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 meta service
"operations": {
"rename": 0, // Renaming a file or directory,
"setattr": 0, // set attributes
"read": 0, // read operation
"statfs": 0, // filesystem 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¶
We provide an API help you monitor the JuiceFS in Prometheus.
Prometheus API:https://juicefs.com/api/volume/VOLUME_NAME/metrics?token=YOUR_TOKEN
YOUR_JUICEFS_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).
Please add the following into configuration of Prometheus (tested with 2.4.0):
scrape_configs:
- job_name: 'juicefs'
scrape_interval: 15s
scheme: 'https'
metrics_path: '/api/vol/VOLUME_NAME/metrics'
params:
token: ['YOUR_TOKEN']
static_configs:
- targets: ['juicefs.com']
We also provide a Grafana Dashboard to show the collected metrics in Prometheus。
Client Statistics¶
There’re three virtual files in your mounted endpoint tracked some logs and statistics.
.stats
tracked API access count of your object storage;.oplog
tracked live operation log of your client;
You could get API access count of your object storage with the following command:
sudo cat /VOLUME_ENDPOINT/.stats | grep object
VOLUME_ENDPOINT
is the endpoint you mounted.
The result will like this:
object.copy: 0
object.delete: 1469927
object.get: 543465
object.list: 3251
object.put: 2213965
object: 4230608