Log Service stores all the data in Metricstores as time series. Log Service uses the model of time series data defined by Prometheus. For more information about the model, see DATA MODEL in the Prometheus documentation. Each time series consists of samples with the same metric identifier.

Metric identifier

Each time series has a unique metric identifier that consists of a metric name and a label.

Metric names are strings and must match the [a-zA-Z_:][a-zA-Z0-9_:]* regular expression. In most cases, a metric name indicates a description of a time series. For example, http_request_total indicates that each sample of a time series represents the total number of received HTTP requests.

Labels are key-value pairs. Label keys must match the [a-zA-Z_][a-zA-Z0-9_]* regular expression. Label values can contain all characters except vertical bars (|). In most cases, a label indicates an attribute of a time series. For example, the value of the method key may be POST, and the value of the URL key may be /api/v1/get.


A sample indicates the value of a metric at a point in time. Each sample consists of a timestamp and a value. Timestamps are accurate to the nanosecond, and values are of the DOUBLE type.

Encoding format

When time series data is written to Log Service, the Protocol Buffer (Protobuf) format must be used. This format is also used to write log data. For more information, see Data encoding. The metric identifier and samples are contained in the content field. The following table describes the related subfields.
Key Limit Example
__name__ The metric name of the time series. nginx_ingress_controller_response_size
__labels__ The labels of the time series. Format: {key}#$#{value}|{key}#$#{value}|{key}#$#{value}.
Note The labels must be sorted by key in alphabetical order.
__time_nano__ The timestamp of a sample. It is accurate to the nanosecond. 1585727297293000000
__value__ The value of a sample. 36.0