@@ -156,13 +156,31 @@ message TopNRequest {
156156 repeated string stages = 9 ;
157157}
158158
159+ // TagFamilySpec defines the specification of a tag family.
160+ message TagFamilySpec {
161+ // name of the tag family
162+ string name = 1 ;
163+ // names of tags in the tag family
164+ repeated string tag_names = 2 ;
165+ }
166+
167+ // DataPointSpec defines the specification of a data point.
168+ message DataPointSpec {
169+ // the tag family specification
170+ repeated TagFamilySpec tag_family_spec = 1 ;
171+ // the field names
172+ repeated string field_names = 2 ;
173+ }
174+
159175// DataPointValue is the data point for writing. It only contains values.
160176message DataPointValue {
161177 // timestamp is in the timeunit of milliseconds.
162178 google.protobuf.Timestamp timestamp = 1 [(validate.rules ) .timestamp.required = true ];
163179 // the order of tag_families' items match the measure schema
180+ // the order of tag_families' items match DataPointSpec
164181 repeated model.v1.TagFamilyForWrite tag_families = 2 [(validate.rules ) .repeated.min_items = 1 ];
165182 // the order of fields match the measure schema
183+ // the order of fields match DataPointSpec
166184 repeated model.v1.FieldValue fields = 3 ;
167185 // the version of the data point
168186 int64 version = 4 ;
@@ -172,10 +190,16 @@ message DataPointValue {
172190message WriteRequest {
173191 // the metadata is required.
174192 common.v1.Metadata metadata = 1 [(validate.rules ) .message.required = true ];
193+ // the metadata is required only for the first request of gRPC stream.
194+ common.v1.Metadata metadata = 1 ;
175195 // the data_point is required.
176196 DataPointValue data_point = 2 [(validate.rules ) .message.required = true ];
177197 // the message_id is required.
178198 uint64 message_id = 3 [(validate.rules ) .uint64.gt = 0 ];
199+ // the data point specification.
200+ // If this is not set with the indicated metadata, use the schema definition.
201+ // If this is not set, use the existing spec declaration from previous requests in the current gRPC stream.
202+ DataPointSpec data_point_spec = 4 ;
179203}
180204
181205// WriteResponse is the response contract for write
0 commit comments