You can call the UpdateTimeseriesMeta operation to update the metadata of multiple time series at the same time.


  • Time series data is written to the time series table. For more information, see Write time series data.
  • The TimeseriesClient is initialized. For more information, see Initialization.


The timeseriesMeta parameter specifies the metadata of a time series. Each timeseriesMeta parameter consists of the timeseriesKey and attributes parameters. The following table describes the parameters.

Parameter Description
timeseriesKey The identifier of the time series.
attributes The properties of the time series. The value is a key-value pair of the string type.


 * Use UpdateTimeseriesMetaSample to update the properties of time series. 
func UpdateTimeseriesMetaSample(tsClient *tablestore.TimeseriesClient, timeseriesTableName string) {
    fmt.Println("[Info]: Begin to update timeseries meta!")

    PutTimeseriesDataSample(tsClient , timeseriesTableName)

    updateTimeseriesMetaRequest := tablestore.NewUpdateTimeseriesMetaRequest(timeseriesTableName)

    timeseriesKey := tablestore.NewTimeseriesKey()
    timeseriesKey.AddTag("City" , "Hangzhou")
    timeseriesKey.AddTag("Region" , "Xihu")

    timeseriesMeta := tablestore.NewTimeseriesMeta(timeseriesKey)
    timeseriesMeta.AddAttribute("NewRegion" , "Yuhang")
    timeseriesMeta.AddAttribute("NewCity" , "Shanghai")


    updateTimeseriesMetaResponse , err := tsClient.UpdateTimeseriesMeta(updateTimeseriesMetaRequest)
    if err != nil {
        fmt.Println("[Error]: Update timeseries meta failed with error: " , err)

    if len(updateTimeseriesMetaResponse.GetFailedRowResults()) > 0 {
        fmt.Println("[Error]: Update timeseries meta failed row: ")
        for i := 0; i < len(updateTimeseriesMetaResponse.GetFailedRowResults()); i++ {
            fmt.Println("[Error]: " , updateTimeseriesMetaResponse.GetFailedRowResults()[i].Index , updateTimeseriesMetaResponse.GetFailedRowResults()[i].Error)

    QueryTimeseriesMetaSample(tsClient , timeseriesTableName)

    fmt.Println("[Info]: UpdateTimeseriesMetaSample finished!")