Shared Disks Metrics
Shared Disk Metrics are designed to provide you with comprehensive insights into the performance and utilization of your shared disks. These metrics help you monitor performance, identify bottlenecks, and ensure optimal resource utilization for your shared disks. The following key metrics are collected every 5 minutes for a period of 180 days for each shared disk.
Metrics | Query Parameter |
---|---|
Disk read IOPS | crusoe_sdisk_disk_read_iops |
Disk write IOPS | crusoe_sdisk_disk_write_iops |
Disk read bandwidth (bytes) | crusoe_sdisk_disk_read_bw_bytes |
Disk write bandwidth (bytes) | crusoe_sdisk_disk_write_bw_bytes |
Disk read latency | crusoe_sdisk_disk_read_latency |
Disk write latency | crusoe_sdisk_disk_write_latency |
Used disk capacity (bytes) | crusoe_sdisk_capacity_used_bytes |
Shared Disk Metrics are accessible in the Crusoe Cloud Console UI by clicking on the Storage tab in the left nav and selecting the shared disk for which the metrics are desired. They are also accessible via a Prometheus-compatible query API that accepts PromQL, as described in the section below.
Querying Shared Disk Metrics via API
To query shared disk metrics via the API, please follow the steps below.
Step 1: Install or Update Crusoe CLI
Please follow the instructions to install and configure Crusoe CLI on your device. If you already have the CLI installed and configured, please ensure you upgrade to the latest version.
Step 2: Generate Your Authentication Token
To generate the authentication token for shared disk metrics, run the following CLI command:
crusoe monitoring tokens create
This command generates an API-Key
that you'll use for authentication when querying the metrics API.
Step 3: Construct and Execute Your Query
Once the token is generated, you can directly query the metrics API endpoint to retrieve data for a single instant or a specific time range. The API endpoint is:
https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries
Here's an example curl
command to retrieve the most recent data point for the average disk write IOPS across all shared disks in a project:
curl -G https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries\?query=\
rate(crusoe_sdisk_disk_write_iops_count[5m]) \
-H 'Authorization: Bearer <API-Key>'
Understanding the Query Components
First, let's look at the Query URL
https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries
This is the base API endpoint. Replace <project-id>
with your actual project identifier.
Next, let's look at the query
query=rate(crusoe_sdisk_disk_write_iops_count[5m])
This is the PromQL query. rate()
calculates the per-second average rate of increase of the metric over the last 5 minutes, as indicated by [5m]
.
This is the specific metric parameter for disk write IOPS: crusoe_sdisk_disk_write_iops_count
.
The authentication header is -H 'Authorization: Bearer <API-Key>'
. Replace <API-Key>
with the token generated in Step 2.
Please refer to the Instant Queries and Range Queries sections in the Prometheus documentation to modify these queries for other time ranges and advanced filtering.
Suggested PromQL Queries for Shared Disk Metrics
Metrics | Suggested Query |
---|---|
Disk read IOPS | rate(crusoe_sdisk_disk_read_iops_count[5m]) |
Disk write IOPS | rate(crusoe_sdisk_disk_write_iops_count[5m]) |
Disk read bandwidth (bytes) | rate(crusoe_sdisk_disk_read_bw_bytes_sum[5m]) |
Disk write bandwidth (bytes) | rate(crusoe_sdisk_disk_write_bw_bytes_sum[5m]) |
Disk read latency | rate(crusoe_sdisk_disk_read_latency_sum[5m]) / rate(crusoe_sdisk_disk_read_latency_count[5m]) |
Disk write latency | rate(crusoe_sdisk_disk_write_latency_sum[5m]) / rate(crusoe_sdisk_disk_write_latency_count[5m]) |
Used disk capacity (bytes) | crusoe_sdisk_disk_capacity_used_bytes |
By default, queries return metrics for all disks within a project. To query metrics for a specific disk, you can specify the disk_id or disk_name parameter in your query. Example for a specific disk:
rate(crusoe_sdisk_disk_write_iops_count{disk_id="your-disk-id"}[5m])
Importing Data into Grafana
To import data into your own Grafana instance, add a Prometheus data source with the following options
Prometheus Server URL: https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries
Authentication → HTTP Headers:
Header: Authorization
Value: Bearer <API-Key>
Use the <API-Key>
generated in the 'Generating an Authentication Token' section