All Products
Search
Document Center

Simple Log Service:GetMetricStore

Last Updated:Jun 11, 2026

Mengkueri penyimpanan metrik.

Deskripsi operasi

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.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Sintaks permintaan

GET /metricstores/{name} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

name

string

Yes

Nama penyimpanan metrik.

my_metric_store

Parameter permintaan

Parameter

Type

Required

Description

Example

project

string

Yes

Nama proyek.

my-project

Elemen respons

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

Contoh

Respons sukses

JSONformat

{
  "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
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

404 MetricStoreNotExist The specified metricstore xxx does not exist. The specified metricstore xxx does not exist.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.