Time series data consists of metadata that identifies and describes each series and data points that record timestamps and values. You can write time series data using the console, an SDK, or the CLI.
Overview
Write time series data using the Tablestore console, an SDK, or the CLI. If a row already exists, Tablestore overwrites it.
You must specify metadata and data for each time series. If the time series does not exist, Tablestore automatically creates it from the metadata in your request.
Usage notes
Plan your table design and monitor the total number of time series. Short-lived time series with few data points increase metadata storage costs because Tablestore indexes each series with a minimum allocation of 4 KB per index.
Procedure
Use the Tablestore console to predefine a time series and write data to a time series table.
-
Navigate to the Instance Management page.
-
Log on to the Tablestore console.
-
In the top navigation bar, select a resource group and a region.
-
On the Overview page, click the instance alias or click Manage Instance in the Actions column for the instance.
-
-
On the Instance Details tab, click the Time Series Tables tab.
-
On the Time Series Tables tab, click the name of a time series table and then click the Query Data tab. Alternatively, find the time series table and click Manage Data in the Actions column.
-
(Optional) Create a time series.
-
On the Query Data tab, click Add Time Series.
-
In the Add Time Series dialog box, add the time series metadata.
Set the Metric name (for example,
cpu) and Data source (for example,host_001). Under Tags, add key-value pairs such asregion = hangzhouandos = Ubuntu. Under Properties, add entries such ascpu_user = 10,cpu_sys = 5, andcpu_io = 2. Click Add.The following table describes the parameters.
Parameter
Description
Metric Name
The measurement metric. Examples:
cpufor CPU utilization,netfor network throughput.Data Source
The data source identifier.
Tag
Custom string-based key-value pairs used to identify the time series.
Property
Additional time series attributes, stored as property columns.
-
Click Add.
A new time series is typically queryable about one minute after its creation.
-
-
Insert data.
-
Click Insert Data.
-
In the Insert Data dialog box, set the time and attribute columns.
In this example, set the Metric name to
cpuand the Data source tohost_001. Add the tagsos = Ubuntuandregion = hangzhou. For the Attribute columns, add three rows:cpu_user(integer, value: 20),cpu_sys(integer, value: 5), andcpu_io(integer, value: 2). Then, click OK. -
Click OK.
-
SDK and CLI integration
Write time series data using an SDK or the CLI.
Billing
FAQ
Related documents
To batch write time series data, write to multiple tables, or collect write status statistics, use the time series Writer. Use the time series Writer to write time series data.