All Products
Search
Document Center

Simple Log Service:Manage a Metricstore

Last Updated:Jan 16, 2024

This topic describes how to create, modify, and delete a Metricstore in the Simple Log Service console. This topic also describes how to delete metrics. Before you can delete a Metricstore, you must delete all related Logtail configurations. If you want to delete metrics, you can reduce the retention period for the metrics.

Term

A Metricstore is used to collect, store, and query metrics in Simple Log Service. Each Metricstore belongs to a project. You can create multiple Metricstores in a project. For more information, see Metricstore.

Prerequisites

A project is created. For more information, see Create a project.

Create a Metricstore

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the project that you want to manage.

  3. On the Time Series Storage > Metricstore tab, click the + icon.

  4. In the Create Metricstore panel, configure the following parameters and click OK.

    Parameter

    Description

    Metricstore Name

    The name of the Metricstore. The name must be unique in the project to which the Metricstore belongs. After the Metricstore is created, you cannot change the name of the Metricstore.

    Data Retention Period

    The retention period of the collected metrics in the Metricstore.

    • If you select Specified Days for Data Retention Period, you can specify how many days you want to store metrics based on your business requirements. Valid values: 1 to 3000. Unit: days.

      Warning
      • After the retention period ends, metrics are automatically deleted.

      • If you shorten the data retention period, Simple Log Service deletes all expired metrics within 1 hour. The data volume that is displayed for Usage Details on the homepage of the Simple Log Service console is updated the next day. For example, if you change the data retention period from 5 days to 1 day, Simple Log Service deletes the metrics of the previous four days within 1 hour.

    • If you select Permanent Storage for Data Retention Period, Simple Log Service permanently stores the collected metrics in the Metricstore.

      Note

      If you query the data retention period by calling an SDK and the returned result is 3650, metrics are permanently stored.

    Shards

    The number of shards. Simple Log Service provides shards that allow you to read and write data. Each shard supports a write capacity of 5 MB/s and 500 writes/s and a read capacity of 10 MB/s and 100 reads/s. You can create up to 10 shards in each Metricstore. You can create up to 200 shards in each project. For more information, see Shard.

    Automatic Sharding

    If you turn on Automatic Sharding, Simple Log Service increases the number of shards when the existing shards cannot accommodate the data that is written. For more information, see Manage shards.

    Maximum Shards

    If you turn on Automatic Sharding, you must configure this parameter to specify the maximum number of readwrite shards that can be created. Maximum value: 256.

Modify the configurations of a Metricstore

  1. On the Time Series Storage > Metricstore tab, move the pointer over the Metricstore whose configurations you want to modify and choose 修改日志库 > Modify.

  2. On the Metricstore Attribute page, click Modify.

    • Change the data retention period. For more information, see Create a Metricstore.

    • Manage shards.

      By default, two shards are created in a Metricstore. You can split a shard or merge shards based on your business requirements. For more information, see Manage shards.

  3. Click Save.

Delete a Metricstore

Important
  • Before you can delete a Metricstore, you must delete all Logtail configurations that are associated with the Metricstore. For more information, see Delete a Logtail configuration.

  • If the data shipping feature is enabled for the Metricstore, we recommend that you stop writing data to the Metricstore and make sure that all data in the Metricstore is shipped before you delete the Metricstore.

  • If you delete all Metricstores, you are still charged for data storage on the day that you delete the Metricstores, but you are no longer charged from the following day. As a result, from the third day after you delete all Metricstores, you no longer receive a Simple Log Service bill.

  1. On the Time Series Storage > Metricstore tab, move the pointer over the Metricstore that you want to delete and choose 修改日志库 > Delete.

    Warning

    After you delete a Metricstore, all metrics in the Metricstore are deleted and cannot be restored. Proceed with caution.

  2. In the message that appears, click OK.

Delete metrics

After the retention period of metrics ends, the metrics are automatically deleted. You can also modify Data Retention Period to delete metrics.

Important

If you shorten the data retention period, Simple Log Service deletes all expired metrics within 1 hour. The data volume that is displayed for Usage Details on the homepage of the Simple Log Service console is updated the next day. For example, if you change the data retention period from 5 days to 1 day, Simple Log Service deletes the metrics of the previous four days within 1 hour.