Queries a Metricstore.
Operation description
A Metricstore is used to store metrics. This operation queries only the configuration of a Metricstore. To query the metric data, see Query and analyze data and GetLogsV2.
-
You must specify an existing Metricstore.
-
The Host in the request syntax consists of a project name and a Simple Log Service endpoint. You must specify the project in the Host.
-
You must have an AccessKey pair. For more information, see AccessKey pair.
An AccessKey pair for an Alibaba Cloud account has full access permissions to all API operations. This poses a high security threat. For security, we recommend that you use a RAM user for API access or routine O&M. Grant the RAM user the required permissions to operate Simple Log Service resources. For more information, see Create a RAM user and grant permissions.
-
Obtain the name and region of the project that contains the Metricstore. For more information, see Manage projects.
-
You can create a maximum of 200 Logstores or Metricstores in a project.
-
Metrics are deleted after their retention period expires.
Try it now
Test
RAM authorization
Request syntax
GET /metricstores/{name} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| name |
string |
Yes |
The name of the Metricstore. |
my_metric_store |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
The name of the project. |
my-project |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| name |
string |
The name of the Metricstore. |
my_metric_store |
| ttl |
integer |
The retention period of data. Unit: days. |
7 |
| shardCount |
integer |
The number of shards. |
2 |
| autoSplit |
boolean |
Indicates whether automatic sharding is enabled. |
true |
| maxSplitShard |
integer |
The maximum number of shards that can be generated by automatic sharding. |
64 |
| mode |
string |
The type of the Metricstore. Example: standard. |
standard |
| metricType |
string |
The type of metrics in the Metricstore. Example: prometheus. |
prometheus |
| createTime |
integer |
The time when the Metricstore was created. The value is a UNIX timestamp. |
1698933894 |
| lastModifyTime |
integer |
The time when the Metricstore was last modified. The value is a UNIX timestamp. |
1712023974 |
| hot_ttl |
integer |
The retention period of data in the hot storage layer. Unit: days. |
|
| infrequentAccessTTL |
integer |
The retention period for the Infrequent Access (IA) storage class. Unit: days. |
|
| appendMeta |
boolean |
||
| shardingPolicy | ShardingPolicy |
Examples
Success response
JSON format
{
"name": "my_metric_store",
"ttl": 7,
"shardCount": 2,
"autoSplit": true,
"maxSplitShard": 64,
"mode": "standard",
"metricType": "prometheus",
"createTime": 1698933894,
"lastModifyTime": 1712023974,
"hot_ttl": 0,
"infrequentAccessTTL": 0,
"appendMeta": false,
"shardingPolicy": {
"shardGroup": {
"keys": [
"userId"
],
"groupCount": 8
},
"shardHash": {
"keys": [
"instanceId"
],
"maxHashCount": 2
},
"queryActiveTime": 1764659409
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | MetricStoreNotExist | The specified metricstore xxx does not exist. | The specified metricstore xxx does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.