You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Metric monitoring
Accessing monitoring data
Copy page
Download PDF
Accessing monitoring data
This topic explains how to access TOS-related monitoring data via tools offered by Cloud Monitor.​
Access methods​
You can access TOS-related monitoring data via the API or SDKs offered by Cloud Monitor. Learn more in the following documents:​
Key parameters​
​
Parameter​
Description​
StartTime​
Indicates the start time of the query time range, using second timestamps (e.g., 1632904500).​
EndTime​
Indicates the end time of the query time range, using second timestamps (e.g., 1632904801).​
  • EndTime > StartTime.​
  • EndTime cannot be a future time.​
  • EndTime < The maximum query time range + StartTime.​
Instances​
Indicates the information about the instances to be queried.​
  • When multiple instances exist, the logical relationship between instances is OR.​
  • If this parameter is not specified, monitoring data for all instances in the region will be returned. Retrieving a large volume of data may impact business performance. Use with caution.​
MetricName​
Indicates the name of the monitoring metric to be queried. For further details, see MetricName in the Monitoring metrics documents.​
Namespace​
Indicates the product namespace to which the monitoring metric belongs. For TOS, this is VCM_TOS.​
SubNamespace​
Indicates the dimension to which the metric belongs. For more information, see SubNamespace in the Monitoring metrics documents.​
Period​
Indicates the granularity of the query interval. It supports the following units of time: seconds (s), minutes (m), hours (h), days (d), and weeks (w). For a detailed explanation, see GetMetricData.​
​
API example​
The following example queries the total number of objects in bucket 210015**** for the time range [1648048800, 1648049400) with an hourly query interval.​
​
POST https://open.volcengineapi.com?Action=GetMetricData&Version=2018-01-01​
ServiceName: Volc_Observe​
Region: cn-beijing​
AccessKey: xxx​
SecretKey: xxx​
​
{​
"MetricName": "BucketObjectCount",​
"StartTime": 1648048800,​
"EndTime": 1648049400,​
"Period": "1h",​
"Namespace": "VCM_TOS",​
"Instances": [​
{​
"Dimensions": [​
{​
"Name": "ResourceID",​
"Value": "210015****"​
}​
]​
}​
],​
"SubNamespace": "bucket_overview"​
}​
​
SDK example​
The following example queries the total number of objects in bucket 210015**** for the time range [1648048800, 1648049400) with an hourly query interval.​
​
import com.volcengine.ApiClient;​
import com.volcengine.ApiException;​
import com.volcengine.sign.Credentials;​
import com.volcengine.volcobserve.VolcObserveApi;​
import com.volcengine.volcobserve.model.*;​
​
import java.util.ArrayList;​
import java.util.List;​
​
public class GetMetricData {​
public static void main(String[] args)throws Exception {​
//Enter your AK​
String ak = "Your AK";​
//Enter your SK​
String sk = "Your SK";​
//Enter the region you want to access​
String region = "cn-beijing";​
//Initialize the API Client​
ApiClient apiClient = new ApiClient()​
.setCredentials(Credentials.getCredentials(ak,sk))​
.setRegion(region);​
VolcObserveApi api = new VolcObserveApi(apiClient);​
//Create an API request parameter​
GetMetricDataRequest request = new GetMetricDataRequest();​
//Set API parameters​
request.setStartTime(1671783***);​
request.setEndTime(1671786***);​
request.setNamespace("VCM_TOS");​
request.setSubNamespace("bucket_overview");​
request.setMetricName("BucketObjectCount");​
request.setPeriod("1h");​
DimensionForGetMetricDataInput dimension = new DimensionForGetMetricDataInput();​
dimension.setName("ResourceID");​
dimension.setValue("210015****");​
InstanceForGetMetricDataInput instance = new InstanceForGetMetricDataInput();​
List<DimensionForGetMetricDataInput> dimensionList = new ArrayList<>();​
dimensionList.add(dimension);​
instance.setDimensions(dimensionList);​
List<InstanceForGetMetricDataInput> instanceList = new ArrayList<>();​
instanceList.add(instance);​
request.setInstances(instanceList);​
​
try {​
//Call API​
GetMetricDataResponse response = api.getMetricData(request);​
System.out.println(response);​
} catch (ApiException e) {​
System.out.println(e.getResponseBody());​
}​
}​
}​
​
​
Last updated: 2026.08.18 18:07:13