Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/main/proto/banyandb/v1/banyandb-measure.proto
Original file line number Diff line number Diff line change
Expand Up @@ -156,26 +156,46 @@ message TopNRequest {
repeated string stages = 9;
}

// TagFamilySpec defines the specification of a tag family.
message TagFamilySpec {
// name of the tag family
string name = 1;
// names of tags in the tag family
repeated string tag_names = 2;
}

// DataPointSpec defines the specification of a data point.
message DataPointSpec {
// the tag family specification
repeated TagFamilySpec tag_family_spec = 1;
// the field names
repeated string field_names = 2;
}

// DataPointValue is the data point for writing. It only contains values.
message DataPointValue {
// timestamp is in the timeunit of milliseconds.
google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true];
// the order of tag_families' items match the measure schema
// the order of tag_families' items match DataPointSpec
repeated model.v1.TagFamilyForWrite tag_families = 2 [(validate.rules).repeated.min_items = 1];
// the order of fields match the measure schema
// the order of fields match DataPointSpec
repeated model.v1.FieldValue fields = 3;
// the version of the data point
int64 version = 4;
}

// WriteRequest is the request contract for write
message WriteRequest {
// the metadata is required.
common.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
// the metadata is required only for the first request of gRPC stream.
common.v1.Metadata metadata = 1;
// the data_point is required.
DataPointValue data_point = 2 [(validate.rules).message.required = true];
// the message_id is required.
uint64 message_id = 3 [(validate.rules).uint64.gt = 0];
// the data point specification.
// If this is not set with the indicated metadata, use the schema definition.
// If this is not set, use the existing spec declaration from previous requests in the current gRPC stream.
DataPointSpec data_point_spec = 4;
}

// WriteResponse is the response contract for write
Expand Down
18 changes: 15 additions & 3 deletions src/main/proto/banyandb/v1/banyandb-stream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,36 @@ message QueryRequest {
repeated string stages = 10;
}

// TagFamilySpec defines the specification of a tag family.
message TagFamilySpec {
// name of the tag family
string name = 1;
// names of tags in the tag family
repeated string tag_names = 2;
}

message ElementValue {
// element_id could be span_id of a Span or segment_id of a Segment in the context of stream
string element_id = 1;
// timestamp is in the timeunit of milliseconds. It represents
// 1) either the start time of a Span/Segment,
// 2) or the timestamp of a log
google.protobuf.Timestamp timestamp = 2;
// the order of tag_families' items match the stream schema
// the order of tag_families' items match TagFamilySpec
repeated model.v1.TagFamilyForWrite tag_families = 3;
}

message WriteRequest {
// the metadata is required.
common.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
// the metadata is required only for the first request of gRPC stream.
common.v1.Metadata metadata = 1;
// the element is required.
ElementValue element = 2 [(validate.rules).message.required = true];
// the message_id is required.
uint64 message_id = 3 [(validate.rules).uint64.gt = 0];
// the tag family specification.
// If this is not set with the indicated metadata, use the schema definition.
// If this is not set, use the existing spec declaration from previous requests in the current gRPC stream.
repeated TagFamilySpec tag_family_spec = 4;
}

message WriteResponse {
Expand Down
11 changes: 8 additions & 3 deletions src/main/proto/banyandb/v1/banyandb-trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ package banyandb.trace.v1;

import "banyandb/v1/banyandb-common.proto";
import "banyandb/v1/banyandb-model.proto";
import "validate/validate.proto";

option go_package = "github.com/apache/skywalking-banyandb/api/proto/banyandb/trace/v1";
option java_package = "org.apache.skywalking.banyandb.trace.v1";

// Write messages
message TagSpec {
repeated string tag_names = 1;
}

message WriteRequest {
common.v1.Metadata metadata = 1;
repeated model.v1.TagValue tags = 2;
repeated model.v1.TagValue tags = 2 [(validate.rules).repeated.min_items = 1];
bytes span = 3;
uint64 version = 4;
uint64 version = 4 [(validate.rules).uint64.gt = 0];
Comment on lines +35 to +37
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import for validation. The WriteRequest uses validation rules like [(validate.rules).repeated.min_items = 1] and [(validate.rules).uint64.gt = 0], but the file doesn't import "validate/validate.proto". Add import "validate/validate.proto"; after the other imports to enable validation rules.

Copilot uses AI. Check for mistakes.
TagSpec tag_spec = 5;
}

message WriteResponse {
Expand Down
Loading