CloudMonitor provides metrics for monitoring the status, performance, and usage of Object Storage Service (OSS). Query these metrics programmatically to track request volume, analyze traffic patterns, identify errors, and diagnose issues.
This topic covers API and SDK-based querying. To view monitoring data in the console, see Monitoring OSS with CloudMonitor.
For CloudMonitor SDK sample code, see SDK reference.
Metric types
OSS metrics fall into two categories. Choose the Period value based on the type you need:
| Type | What it measures | Period (seconds) | Scope |
|---|---|---|---|
| Non-metering metrics | Operational data: request counts, traffic, latency, error rates | 60 | Account level or bucket level |
| Metering metrics | Billing-related data: storage usage, billable request volume | 3600 | Account level or bucket level |
For billing details on metering metrics, see Billable usage metrics.
Query parameters
Each CloudMonitor API call requires five parameters. The examples in this topic use the CloudMonitor SDK for Java.
| Parameter | Description |
|---|---|
Namespace | The cloud service to monitor. Always set to acs_oss_dashboard for OSS. |
StartTime / EndTime | The query time range as a left-open, right-closed interval (StartTime, EndTime]. The interval cannot exceed 31 days, and only data from the past 31 days is available. |
Dimensions | Filters the query to a specific bucket. Set to {"BucketName":"examplebucket"} to query a single bucket. Omit to get account-level data aggregated across all buckets. |
Period | The metric sampling interval in seconds: 60 for non-metering metrics, 3600 for metering metrics. |
Metric | The specific metric to query, passed to setMetric(). |
Complete example
The following example queries the TotalRequestCount metric for a specific bucket over a one-hour window. All parameters are assembled in a single call.
import com.aliyuncs.cms.model.v20190101.DescribeMetricListRequest;
import com.aliyuncs.cms.model.v20190101.DescribeMetricListResponse;
DescribeMetricListRequest request = new DescribeMetricListRequest();
// Target OSS metrics
request.setNamespace("acs_oss_dashboard");
// Set the query time range (left-open, right-closed interval)
request.setEndTime("2019-05-13 11:06:27");
request.setStartTime("2019-05-13 10:20:27");
// Scope to a specific bucket; omit this line for account-level data
request.setDimensions("{\"BucketName\":\"examplebucket\"}");
// Use 60s for non-metering metrics, 3600s for metering metrics
request.setPeriod("60");
// Specify the metric to query
request.setMetric("TotalRequestCount");
DescribeMetricListResponse response = client.getAcsResponse(request);
System.out.println(response.getDatapoints());Set individual parameters
Namespace
Set Namespace to acs_oss_dashboard to query OSS metrics.
DescribeMetricListRequest request = new DescribeMetricListRequest();
request.setNamespace("acs_oss_dashboard");StartTime and EndTime
StartTime and EndTime define the query time range as a left-open, right-closed interval (StartTime, EndTime]. The interval cannot exceed 31 days, and only data from the past 31 days is available.
// Set the end time of the query range.
request.setEndTime("2019-05-13 11:06:27");
// Set the start time of the query range.
request.setStartTime("2019-05-13 10:20:27");Dimensions
Dimensions filters the query to a specific bucket. Omit it to get account-level data aggregated across all buckets.
// Query monitoring data for a specific bucket.
request.setDimensions("{\"BucketName\":\"examplebucket\"}");Period
Period sets the metric sampling interval in seconds:
60 — non-metering metrics (request counts, traffic, latency, error rates)
3600 — metering metrics (storage usage, billable GET/PUT request counts)
// Set the sampling interval for a non-metering metric.
request.setPeriod("60");Metric
Metric specifies which metric to query. Pass the metric name from the tables below to setMetric(). To browse all available metrics, see the Metric list page.
// Set the metric name.
request.setMetric("<MetricName>");Available metrics
Non-metering metrics (Period: 60s)
Non-metering metrics are available at two levels:
Account level — aggregated across all buckets under your account. Omit
Dimensionsto query these.Bucket level — scoped to a single bucket. Set
Dimensionsto the target bucket name.
Account-level metrics
| Metric | Description | Unit |
|---|---|---|
UserAvailability | Availability | % |
UserRequestValidRate | Percentage of valid requests | % |
UserTotalRequestCount | Total number of requests | — |
UserValidRequestCount | Number of valid requests | — |
UserInternetSend | Outbound traffic over the Internet | Bytes |
UserInternetRecv | Inbound traffic over the Internet | Bytes |
UserIntranetSend | Outbound traffic over the internal network | Bytes |
UserIntranetRecv | Inbound traffic over the internal network | Bytes |
UserCdnSend | Outbound traffic from Alibaba Cloud CDN | Bytes |
UserCdnRecv | Inbound traffic to Alibaba Cloud CDN | Bytes |
UserSyncSend | Outbound traffic generated by cross-region replication (CRR) | Bytes |
UserSyncRecv | Inbound traffic generated by CRR | Bytes |
UserServerErrorCount | Total requests that encountered server errors | — |
UserServerErrorRate | Percentage of requests that encountered server errors | % |
UserNetworkErrorCount | Total requests that encountered network errors | — |
UserNetworkErrorRate | Percentage of requests that encountered network errors | % |
UserAuthorizationErrorCount | Total failed authorization requests | — |
UserAuthorizationErrorRate | Percentage of failed authorization requests | % |
UserResourceNotFoundErrorCount | Total requests that failed because the resource does not exist | — |
UserResourceNotFoundErrorRate | Percentage of requests that failed because the resource does not exist | % |
UserClientTimeoutErrorCount | Total requests that failed due to client timeouts | — |
UserClientTimeoutErrorRate | Percentage of requests that failed due to client timeouts | % |
UserClientOtherErrorCount | Total requests that encountered other client errors | — |
UserClientOtherErrorRate | Percentage of requests that encountered other client errors | % |
UserSuccessCount | Total successful requests | — |
UserSuccessRate | Percentage of successful requests | % |
UserRedirectCount | Total redirection requests | — |
UserRedirectRate | Percentage of redirection requests | % |
Bucket-level metrics
General metrics
| Metric | Description | Unit |
|---|---|---|
Availability | Availability | % |
RequestValidRate | Percentage of valid requests | % |
TotalRequestCount | Total number of requests | — |
ValidRequestCount | Number of valid requests | — |
InternetSend | Outbound traffic over the Internet | Bytes |
InternetRecv | Inbound traffic over the Internet | Bytes |
IntranetSend | Outbound traffic over the internal network | Bytes |
IntranetRecv | Inbound traffic over the internal network | Bytes |
InternetSendBandwidth | Outbound bandwidth over the Internet | bps |
InternetRecvBandwidth | Inbound bandwidth over the Internet | bps |
IntranetSendBandwidth | Outbound bandwidth over the internal network | bps |
IntranetRecvBandwidth | Inbound bandwidth over the internal network | bps |
CdnSend | Outbound traffic from Alibaba Cloud CDN | Bytes |
CdnRecv | Inbound traffic to Alibaba Cloud CDN | Bytes |
SyncSend | Outbound traffic generated by CRR | Bytes |
SyncRecv | Inbound traffic generated by CRR | Bytes |
ServerErrorCount | Total requests that encountered server errors | — |
ServerErrorRate | Percentage of requests that encountered server errors | % |
NetworkErrorCount | Total requests that encountered network errors | — |
NetworkErrorRate | Percentage of requests that encountered network errors | % |
AuthorizationErrorCount | Total failed authorization requests | — |
AuthorizationErrorRate | Percentage of failed authorization requests | % |
ResourceNotFoundErrorCount | Total requests that failed because the resource does not exist | — |
ResourceNotFoundErrorRate | Percentage of requests that failed because the resource does not exist | % |
ClientTimeoutErrorCount | Total requests that failed due to client timeouts | — |
ClientTimeoutErrorRate | Percentage of requests that failed due to client timeouts | % |
ClientOtherErrorCount | Total requests that encountered other client errors | — |
ClientOtherErrorRate | Percentage of requests that encountered other client errors | % |
SuccessCount | Total successful requests | — |
SuccessRate | Percentage of successful requests | % |
RedirectCount | Total redirection requests | — |
RedirectRate | Percentage of redirection requests | % |
GetObject latency
| Metric | Description | Unit |
|---|---|---|
GetObjectE2eLatency | Average end-to-end (E2E) latency of GetObject requests | Milliseconds |
GetObjectServerLatency | Average server-side latency of GetObject requests, excluding network transfer time | Milliseconds |
MaxGetObjectE2eLatency | Maximum E2E latency of GetObject requests | Milliseconds |
MaxGetObjectServerLatency | Maximum server-side latency of GetObject requests | Milliseconds |
HeadObject latency
| Metric | Description | Unit |
|---|---|---|
HeadObjectE2eLatency | Average E2E latency of HeadObject requests | Milliseconds |
HeadObjectServerLatency | Average server-side latency of HeadObject requests | Milliseconds |
MaxHeadObjectE2eLatency | Maximum E2E latency of HeadObject requests | Milliseconds |
MaxHeadObjectServerLatency | Maximum server-side latency of HeadObject requests | Milliseconds |
PutObject latency
| Metric | Description | Unit |
|---|---|---|
PutObjectE2eLatency | Average E2E latency of PutObject requests | Milliseconds |
PutObjectServerLatency | Average server-side latency of PutObject requests | Milliseconds |
MaxPutObjectE2eLatency | Maximum E2E latency of PutObject requests | Milliseconds |
MaxPutObjectServerLatency | Maximum server-side latency of PutObject requests | Milliseconds |
PostObject latency
| Metric | Description | Unit |
|---|---|---|
PostObjectE2eLatency | Average E2E latency of PostObject requests | Milliseconds |
PostObjectServerLatency | Average server-side latency of PostObject requests | Milliseconds |
MaxPostObjectE2eLatency | Maximum E2E latency of PostObject requests | Milliseconds |
MaxPostObjectServerLatency | Maximum server-side latency of PostObject requests | Milliseconds |
AppendObject latency
| Metric | Description | Unit |
|---|---|---|
AppendObjectE2eLatency | Average E2E latency of AppendObject requests | Milliseconds |
AppendObjectServerLatency | Average server-side latency of AppendObject requests | Milliseconds |
MaxAppendObjectE2eLatency | Maximum E2E latency of AppendObject requests | Milliseconds |
MaxAppendObjectServerLatency | Maximum server-side latency of AppendObject requests | Milliseconds |
UploadPart latency
| Metric | Description | Unit |
|---|---|---|
UploadPartE2eLatency | Average E2E latency of UploadPart requests | Milliseconds |
UploadPartServerLatency | Average server-side latency of UploadPart requests | Milliseconds |
MaxUploadPartE2eLatency | Maximum E2E latency of UploadPart requests | Milliseconds |
MaxUploadPartServerLatency | Maximum server-side latency of UploadPart requests | Milliseconds |
UploadPartCopy latency
| Metric | Description | Unit |
|---|---|---|
UploadPartCopyE2eLatency | Average E2E latency of UploadPartCopy requests | Milliseconds |
UploadPartCopyServerLatency | Average server-side latency of UploadPartCopy requests | Milliseconds |
MaxUploadPartCopyE2eLatency | Maximum E2E latency of UploadPartCopy requests | Milliseconds |
MaxUploadPartCopyServerLatency | Maximum server-side latency of UploadPartCopy requests | Milliseconds |
Request counts by operation
| Metric | Description | Unit |
|---|---|---|
GetObjectCount | Number of successful GetObject requests | — |
HeadObjectCount | Number of successful HeadObject requests | — |
PutObjectCount | Number of successful PutObject requests | — |
PostObjectCount | Number of successful PostObject requests | — |
AppendObjectCount | Number of successful AppendObject requests | — |
UploadPartCount | Number of successful UploadPart requests | — |
UploadPartCopyCount | Number of successful UploadPartCopy requests | — |
DeleteObjectCount | Number of successful DeleteObject requests | — |
DeleteObjectsCount | Number of successful DeleteObjects requests | — |
Mirroring-based back-to-origin metrics
| Metric | Description | Unit |
|---|---|---|
MirrorTraffic | Inbound traffic from a specific origin for legitimate requests | Bytes |
MirrorTrafficByStatus | Inbound traffic from a specific origin, broken down by HTTP status code | Bytes |
MirrorRequestTransferSpeed | Average transfer speed of legitimate requests to a specific origin | Bytes/s |
MirrorRequestTransferSpeedByStatus | Average transfer speed, broken down by HTTP status code | Bytes/s |
MirrorRequestCount | Total legitimate requests to a specific origin | — |
MirrorRequestCountByStatus | Total legitimate requests, broken down by HTTP status code | — |
MirrorAverageLatency | Average latency of legitimate requests to a specific origin | Milliseconds |
MirrorAverageLatencyByStatus | Average latency, broken down by HTTP status code | Milliseconds |
MirrorRequestStatusRatio | Percentage of requests to a specific origin, broken down by HTTP status group (2xx, 3xx, 4xx, 5xx) | % |
MirrorRequestStatusCount | Total requests to a specific origin, broken down by HTTP status group (2xx, 3xx, 4xx, 5xx) | — |
Metering metrics (Period: 3,600s)
Metering metrics reflect usage for billing purposes and follow different collection rules from non-metering metrics. Set Dimensions to query a specific bucket, or omit it to get account-level data. For collection rules and billing details, see Billable usage metrics.
| Metric | Description | Unit |
|---|---|---|
MeteringStorageUtilization | Storage usage | Bytes |
MeteringGetRequest | Number of GET requests | — |
MeteringPutRequest | Number of PUT requests | — |
MeteringInternetTX | Metered outbound traffic over the Internet | Bytes |
MeteringCdnTX | Metered outbound traffic from Alibaba Cloud CDN | Bytes |
MeteringSyncRX | Metered inbound traffic generated by CRR | Bytes |