diff --git a/collect/language/profile/v3/Profile.pb.go b/collect/language/profile/v3/Profile.pb.go index 4140c78..3698a48 100644 --- a/collect/language/profile/v3/Profile.pb.go +++ b/collect/language/profile/v3/Profile.pb.go @@ -302,6 +302,72 @@ func (x *ProfileTaskFinishReport) GetTaskId() string { return "" } +// profile for go agent +type GoProfileData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` + // the truly profile data + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // check last part true or false + IsLast bool `protobuf:"varint,3,opt,name=isLast,proto3" json:"isLast,omitempty"` +} + +func (x *GoProfileData) Reset() { + *x = GoProfileData{} + if protoimpl.UnsafeEnabled { + mi := &file_profile_Profile_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoProfileData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoProfileData) ProtoMessage() {} + +func (x *GoProfileData) ProtoReflect() protoreflect.Message { + mi := &file_profile_Profile_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GoProfileData.ProtoReflect.Descriptor instead. +func (*GoProfileData) Descriptor() ([]byte, []int) { + return file_profile_Profile_proto_rawDescGZIP(), []int{4} +} + +func (x *GoProfileData) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *GoProfileData) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *GoProfileData) GetIsLast() bool { + if x != nil { + return x.IsLast + } + return false +} + var File_profile_Profile_proto protoreflect.FileDescriptor var file_profile_Profile_proto_rawDesc = []byte{ @@ -339,34 +405,45 @@ var file_profile_Profile_proto_rawDesc = []byte{ 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, 0x90, 0x02, 0x0a, 0x0b, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x5b, 0x0a, 0x16, 0x67, 0x65, 0x74, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x17, 0x2e, 0x73, 0x6b, - 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1d, 0x2e, 0x73, 0x6b, 0x79, 0x77, - 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, - 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x22, 0x00, 0x28, 0x01, 0x12, 0x55, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, - 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x12, 0x26, 0x2e, 0x73, 0x6b, 0x79, 0x77, - 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x00, 0x42, 0x97, 0x01, 0x0a, - 0x35, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, - 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x2e, 0x76, 0x33, 0x50, 0x01, 0x5a, 0x3c, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, - 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x67, 0x6f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x2f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x2f, 0x76, 0x33, 0xaa, 0x02, 0x1d, 0x53, 0x6b, 0x79, 0x57, 0x61, 0x6c, 0x6b, - 0x69, 0x6e, 0x67, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x59, 0x0a, 0x0d, 0x47, 0x6f, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x69, 0x73, 0x4c, 0x61, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, + 0x4c, 0x61, 0x73, 0x74, 0x32, 0xde, 0x02, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x5b, 0x0a, 0x16, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x26, + 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, + 0x00, 0x12, 0x4d, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1d, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x00, 0x28, 0x01, + 0x12, 0x4c, 0x0a, 0x0f, 0x67, 0x6f, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x6f, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x00, 0x28, 0x01, 0x12, 0x55, + 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x12, 0x26, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, + 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x22, 0x00, 0x42, 0x97, 0x01, 0x0a, 0x35, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, + 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x76, 0x33, 0x50, + 0x01, 0x5a, 0x3c, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x67, 0x6f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x76, 0x33, 0xaa, + 0x02, 0x1d, 0x53, 0x6b, 0x79, 0x57, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x33, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -381,24 +458,27 @@ func file_profile_Profile_proto_rawDescGZIP() []byte { return file_profile_Profile_proto_rawDescData } -var file_profile_Profile_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_profile_Profile_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_profile_Profile_proto_goTypes = []interface{}{ (*ProfileTaskCommandQuery)(nil), // 0: skywalking.v3.ProfileTaskCommandQuery (*ThreadSnapshot)(nil), // 1: skywalking.v3.ThreadSnapshot (*ThreadStack)(nil), // 2: skywalking.v3.ThreadStack (*ProfileTaskFinishReport)(nil), // 3: skywalking.v3.ProfileTaskFinishReport - (*v3.Commands)(nil), // 4: skywalking.v3.Commands + (*GoProfileData)(nil), // 4: skywalking.v3.GoProfileData + (*v3.Commands)(nil), // 5: skywalking.v3.Commands } var file_profile_Profile_proto_depIdxs = []int32{ 2, // 0: skywalking.v3.ThreadSnapshot.stack:type_name -> skywalking.v3.ThreadStack 0, // 1: skywalking.v3.ProfileTask.getProfileTaskCommands:input_type -> skywalking.v3.ProfileTaskCommandQuery 1, // 2: skywalking.v3.ProfileTask.collectSnapshot:input_type -> skywalking.v3.ThreadSnapshot - 3, // 3: skywalking.v3.ProfileTask.reportTaskFinish:input_type -> skywalking.v3.ProfileTaskFinishReport - 4, // 4: skywalking.v3.ProfileTask.getProfileTaskCommands:output_type -> skywalking.v3.Commands - 4, // 5: skywalking.v3.ProfileTask.collectSnapshot:output_type -> skywalking.v3.Commands - 4, // 6: skywalking.v3.ProfileTask.reportTaskFinish:output_type -> skywalking.v3.Commands - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] is the sub-list for method input_type + 4, // 3: skywalking.v3.ProfileTask.goProfileReport:input_type -> skywalking.v3.GoProfileData + 3, // 4: skywalking.v3.ProfileTask.reportTaskFinish:input_type -> skywalking.v3.ProfileTaskFinishReport + 5, // 5: skywalking.v3.ProfileTask.getProfileTaskCommands:output_type -> skywalking.v3.Commands + 5, // 6: skywalking.v3.ProfileTask.collectSnapshot:output_type -> skywalking.v3.Commands + 5, // 7: skywalking.v3.ProfileTask.goProfileReport:output_type -> skywalking.v3.Commands + 5, // 8: skywalking.v3.ProfileTask.reportTaskFinish:output_type -> skywalking.v3.Commands + 5, // [5:9] is the sub-list for method output_type + 1, // [1:5] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -458,6 +538,18 @@ func file_profile_Profile_proto_init() { return nil } } + file_profile_Profile_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoProfileData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -465,7 +557,7 @@ func file_profile_Profile_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_profile_Profile_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/collect/language/profile/v3/Profile_grpc.pb.go b/collect/language/profile/v3/Profile_grpc.pb.go index 0e8b7b4..dbb096f 100644 --- a/collect/language/profile/v3/Profile_grpc.pb.go +++ b/collect/language/profile/v3/Profile_grpc.pb.go @@ -27,6 +27,8 @@ type ProfileTaskClient interface { GetProfileTaskCommands(ctx context.Context, in *ProfileTaskCommandQuery, opts ...grpc.CallOption) (*v3.Commands, error) // collect dumped thread snapshot CollectSnapshot(ctx context.Context, opts ...grpc.CallOption) (ProfileTask_CollectSnapshotClient, error) + // collect bytes profile data from go agent + GoProfileReport(ctx context.Context, opts ...grpc.CallOption) (ProfileTask_GoProfileReportClient, error) // report profiling task finished ReportTaskFinish(ctx context.Context, in *ProfileTaskFinishReport, opts ...grpc.CallOption) (*v3.Commands, error) } @@ -82,6 +84,40 @@ func (x *profileTaskCollectSnapshotClient) CloseAndRecv() (*v3.Commands, error) return m, nil } +func (c *profileTaskClient) GoProfileReport(ctx context.Context, opts ...grpc.CallOption) (ProfileTask_GoProfileReportClient, error) { + stream, err := c.cc.NewStream(ctx, &ProfileTask_ServiceDesc.Streams[1], "/skywalking.v3.ProfileTask/goProfileReport", opts...) + if err != nil { + return nil, err + } + x := &profileTaskGoProfileReportClient{stream} + return x, nil +} + +type ProfileTask_GoProfileReportClient interface { + Send(*GoProfileData) error + CloseAndRecv() (*v3.Commands, error) + grpc.ClientStream +} + +type profileTaskGoProfileReportClient struct { + grpc.ClientStream +} + +func (x *profileTaskGoProfileReportClient) Send(m *GoProfileData) error { + return x.ClientStream.SendMsg(m) +} + +func (x *profileTaskGoProfileReportClient) CloseAndRecv() (*v3.Commands, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(v3.Commands) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + func (c *profileTaskClient) ReportTaskFinish(ctx context.Context, in *ProfileTaskFinishReport, opts ...grpc.CallOption) (*v3.Commands, error) { out := new(v3.Commands) err := c.cc.Invoke(ctx, "/skywalking.v3.ProfileTask/reportTaskFinish", in, out, opts...) @@ -99,6 +135,8 @@ type ProfileTaskServer interface { GetProfileTaskCommands(context.Context, *ProfileTaskCommandQuery) (*v3.Commands, error) // collect dumped thread snapshot CollectSnapshot(ProfileTask_CollectSnapshotServer) error + // collect bytes profile data from go agent + GoProfileReport(ProfileTask_GoProfileReportServer) error // report profiling task finished ReportTaskFinish(context.Context, *ProfileTaskFinishReport) (*v3.Commands, error) mustEmbedUnimplementedProfileTaskServer() @@ -114,6 +152,9 @@ func (UnimplementedProfileTaskServer) GetProfileTaskCommands(context.Context, *P func (UnimplementedProfileTaskServer) CollectSnapshot(ProfileTask_CollectSnapshotServer) error { return status.Errorf(codes.Unimplemented, "method CollectSnapshot not implemented") } +func (UnimplementedProfileTaskServer) GoProfileReport(ProfileTask_GoProfileReportServer) error { + return status.Errorf(codes.Unimplemented, "method GoProfileReport not implemented") +} func (UnimplementedProfileTaskServer) ReportTaskFinish(context.Context, *ProfileTaskFinishReport) (*v3.Commands, error) { return nil, status.Errorf(codes.Unimplemented, "method ReportTaskFinish not implemented") } @@ -174,6 +215,32 @@ func (x *profileTaskCollectSnapshotServer) Recv() (*ThreadSnapshot, error) { return m, nil } +func _ProfileTask_GoProfileReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ProfileTaskServer).GoProfileReport(&profileTaskGoProfileReportServer{stream}) +} + +type ProfileTask_GoProfileReportServer interface { + SendAndClose(*v3.Commands) error + Recv() (*GoProfileData, error) + grpc.ServerStream +} + +type profileTaskGoProfileReportServer struct { + grpc.ServerStream +} + +func (x *profileTaskGoProfileReportServer) SendAndClose(m *v3.Commands) error { + return x.ServerStream.SendMsg(m) +} + +func (x *profileTaskGoProfileReportServer) Recv() (*GoProfileData, error) { + m := new(GoProfileData) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + func _ProfileTask_ReportTaskFinish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ProfileTaskFinishReport) if err := dec(in); err != nil { @@ -214,6 +281,11 @@ var ProfileTask_ServiceDesc = grpc.ServiceDesc{ Handler: _ProfileTask_CollectSnapshot_Handler, ClientStreams: true, }, + { + StreamName: "goProfileReport", + Handler: _ProfileTask_GoProfileReport_Handler, + ClientStreams: true, + }, }, Metadata: "profile/Profile.proto", } diff --git a/collect/pprof/v10/Pprof.pb.go b/collect/pprof/v10/Pprof.pb.go new file mode 100644 index 0000000..9fd886e --- /dev/null +++ b/collect/pprof/v10/Pprof.pb.go @@ -0,0 +1,566 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.14.0 +// source: pprof/Pprof.proto + +package v10 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + v3 "skywalking.apache.org/repo/goapi/collect/common/v3" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PprofProfilingStatus int32 + +const ( + // PROFILING_SUCCESS indicates the Go Agent has finished the execution + PprofProfilingStatus_PPROF_PROFILING_SUCCESS PprofProfilingStatus = 0 + // EXECUTION_TASK_ERROR indicates a potential execution error caused by the Go Agent, such as an error in the task parameters that were sent. + PprofProfilingStatus_PPROF_EXECUTION_TASK_ERROR PprofProfilingStatus = 1 + // TERMINATED_BY_OVERSIZE means that the server cannot receive the pprof file because the size of the file is over the limitation. + PprofProfilingStatus_PPROF_TERMINATED_BY_OVERSIZE PprofProfilingStatus = 2 +) + +// Enum value maps for PprofProfilingStatus. +var ( + PprofProfilingStatus_name = map[int32]string{ + 0: "PPROF_PROFILING_SUCCESS", + 1: "PPROF_EXECUTION_TASK_ERROR", + 2: "PPROF_TERMINATED_BY_OVERSIZE", + } + PprofProfilingStatus_value = map[string]int32{ + "PPROF_PROFILING_SUCCESS": 0, + "PPROF_EXECUTION_TASK_ERROR": 1, + "PPROF_TERMINATED_BY_OVERSIZE": 2, + } +) + +func (x PprofProfilingStatus) Enum() *PprofProfilingStatus { + p := new(PprofProfilingStatus) + *p = x + return p +} + +func (x PprofProfilingStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PprofProfilingStatus) Descriptor() protoreflect.EnumDescriptor { + return file_pprof_Pprof_proto_enumTypes[0].Descriptor() +} + +func (PprofProfilingStatus) Type() protoreflect.EnumType { + return &file_pprof_Pprof_proto_enumTypes[0] +} + +func (x PprofProfilingStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PprofProfilingStatus.Descriptor instead. +func (PprofProfilingStatus) EnumDescriptor() ([]byte, []int) { + return file_pprof_Pprof_proto_rawDescGZIP(), []int{0} +} + +type PprofData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // metaData of the pprof task and its result data, only sent in the first request. + Metadata *PprofMetaData `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Types that are assignable to Result: + // + // *PprofData_ErrorMessage + // *PprofData_Content + Result isPprofData_Result `protobuf_oneof:"result"` +} + +func (x *PprofData) Reset() { + *x = PprofData{} + if protoimpl.UnsafeEnabled { + mi := &file_pprof_Pprof_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PprofData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PprofData) ProtoMessage() {} + +func (x *PprofData) ProtoReflect() protoreflect.Message { + mi := &file_pprof_Pprof_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PprofData.ProtoReflect.Descriptor instead. +func (*PprofData) Descriptor() ([]byte, []int) { + return file_pprof_Pprof_proto_rawDescGZIP(), []int{0} +} + +func (x *PprofData) GetMetadata() *PprofMetaData { + if x != nil { + return x.Metadata + } + return nil +} + +func (m *PprofData) GetResult() isPprofData_Result { + if m != nil { + return m.Result + } + return nil +} + +func (x *PprofData) GetErrorMessage() string { + if x, ok := x.GetResult().(*PprofData_ErrorMessage); ok { + return x.ErrorMessage + } + return "" +} + +func (x *PprofData) GetContent() []byte { + if x, ok := x.GetResult().(*PprofData_Content); ok { + return x.Content + } + return nil +} + +type isPprofData_Result interface { + isPprofData_Result() +} + +type PprofData_ErrorMessage struct { + ErrorMessage string `protobuf:"bytes,2,opt,name=errorMessage,proto3,oneof"` +} + +type PprofData_Content struct { + // pprof binary content + Content []byte `protobuf:"bytes,3,opt,name=content,proto3,oneof"` +} + +func (*PprofData_ErrorMessage) isPprofData_Result() {} + +func (*PprofData_Content) isPprofData_Result() {} + +type PprofCollectionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status PprofProfilingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=skywalking.v10.PprofProfilingStatus" json:"status,omitempty"` +} + +func (x *PprofCollectionResponse) Reset() { + *x = PprofCollectionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pprof_Pprof_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PprofCollectionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PprofCollectionResponse) ProtoMessage() {} + +func (x *PprofCollectionResponse) ProtoReflect() protoreflect.Message { + mi := &file_pprof_Pprof_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PprofCollectionResponse.ProtoReflect.Descriptor instead. +func (*PprofCollectionResponse) Descriptor() ([]byte, []int) { + return file_pprof_Pprof_proto_rawDescGZIP(), []int{1} +} + +func (x *PprofCollectionResponse) GetStatus() PprofProfilingStatus { + if x != nil { + return x.Status + } + return PprofProfilingStatus_PPROF_PROFILING_SUCCESS +} + +type PprofMetaData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` + // pprof task id + TaskId string `protobuf:"bytes,3,opt,name=taskId,proto3" json:"taskId,omitempty"` + // PprofProfilingStatus indicates the overall status of the pprof task, i.e. success or failure + Type PprofProfilingStatus `protobuf:"varint,4,opt,name=type,proto3,enum=skywalking.v10.PprofProfilingStatus" json:"type,omitempty"` + // if type is success then it will be the size of the pprof file, otherwise it will be 0 + ContentSize int32 `protobuf:"varint,5,opt,name=contentSize,proto3" json:"contentSize,omitempty"` +} + +func (x *PprofMetaData) Reset() { + *x = PprofMetaData{} + if protoimpl.UnsafeEnabled { + mi := &file_pprof_Pprof_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PprofMetaData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PprofMetaData) ProtoMessage() {} + +func (x *PprofMetaData) ProtoReflect() protoreflect.Message { + mi := &file_pprof_Pprof_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PprofMetaData.ProtoReflect.Descriptor instead. +func (*PprofMetaData) Descriptor() ([]byte, []int) { + return file_pprof_Pprof_proto_rawDescGZIP(), []int{2} +} + +func (x *PprofMetaData) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *PprofMetaData) GetServiceInstance() string { + if x != nil { + return x.ServiceInstance + } + return "" +} + +func (x *PprofMetaData) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *PprofMetaData) GetType() PprofProfilingStatus { + if x != nil { + return x.Type + } + return PprofProfilingStatus_PPROF_PROFILING_SUCCESS +} + +func (x *PprofMetaData) GetContentSize() int32 { + if x != nil { + return x.ContentSize + } + return 0 +} + +type PprofTaskCommandQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // service name of the Go process + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` + // lastCommandTime is the timestamp of the last pprof task received + LastCommandTime int64 `protobuf:"varint,3,opt,name=lastCommandTime,proto3" json:"lastCommandTime,omitempty"` +} + +func (x *PprofTaskCommandQuery) Reset() { + *x = PprofTaskCommandQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_pprof_Pprof_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PprofTaskCommandQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PprofTaskCommandQuery) ProtoMessage() {} + +func (x *PprofTaskCommandQuery) ProtoReflect() protoreflect.Message { + mi := &file_pprof_Pprof_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PprofTaskCommandQuery.ProtoReflect.Descriptor instead. +func (*PprofTaskCommandQuery) Descriptor() ([]byte, []int) { + return file_pprof_Pprof_proto_rawDescGZIP(), []int{3} +} + +func (x *PprofTaskCommandQuery) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *PprofTaskCommandQuery) GetServiceInstance() string { + if x != nil { + return x.ServiceInstance + } + return "" +} + +func (x *PprofTaskCommandQuery) GetLastCommandTime() int64 { + if x != nil { + return x.LastCommandTime + } + return 0 +} + +var File_pprof_Pprof_proto protoreflect.FileDescriptor + +var file_pprof_Pprof_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x30, 0x1a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x09, 0x50, 0x70, + 0x72, 0x6f, 0x66, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6b, 0x79, 0x77, + 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, + 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x24, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x57, + 0x0a, 0x17, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6b, 0x79, 0x77, + 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc7, 0x01, 0x0a, 0x0d, 0x50, 0x70, 0x72, 0x6f, + 0x66, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, + 0x65, 0x22, 0x85, 0x01, 0x0a, 0x15, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x28, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0x75, 0x0a, 0x14, 0x50, 0x70, 0x72, + 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x50, 0x52, 0x4f, 0x46, 0x5f, 0x50, 0x52, 0x4f, 0x46, 0x49, + 0x4c, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x1e, + 0x0a, 0x1a, 0x50, 0x50, 0x52, 0x4f, 0x46, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x20, + 0x0a, 0x1c, 0x50, 0x50, 0x52, 0x4f, 0x46, 0x5f, 0x54, 0x45, 0x52, 0x4d, 0x49, 0x4e, 0x41, 0x54, + 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, + 0x32, 0xb6, 0x01, 0x0a, 0x09, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x51, + 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x19, 0x2e, 0x73, 0x6b, 0x79, 0x77, + 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, + 0x44, 0x61, 0x74, 0x61, 0x1a, 0x27, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, + 0x01, 0x12, 0x56, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x54, 0x61, 0x73, + 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x6b, 0x79, 0x77, + 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x30, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, + 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x1a, 0x17, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x42, 0x84, 0x01, 0x0a, 0x2b, 0x6f, 0x72, + 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, + 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2e, 0x76, 0x31, 0x30, 0x50, 0x01, 0x5a, 0x32, 0x73, 0x6b, 0x79, + 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, + 0x72, 0x67, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x67, 0x6f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x76, 0x31, 0x30, 0xaa, + 0x02, 0x1e, 0x53, 0x6b, 0x79, 0x57, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0x30, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pprof_Pprof_proto_rawDescOnce sync.Once + file_pprof_Pprof_proto_rawDescData = file_pprof_Pprof_proto_rawDesc +) + +func file_pprof_Pprof_proto_rawDescGZIP() []byte { + file_pprof_Pprof_proto_rawDescOnce.Do(func() { + file_pprof_Pprof_proto_rawDescData = protoimpl.X.CompressGZIP(file_pprof_Pprof_proto_rawDescData) + }) + return file_pprof_Pprof_proto_rawDescData +} + +var file_pprof_Pprof_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_pprof_Pprof_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_pprof_Pprof_proto_goTypes = []interface{}{ + (PprofProfilingStatus)(0), // 0: skywalking.v10.PprofProfilingStatus + (*PprofData)(nil), // 1: skywalking.v10.PprofData + (*PprofCollectionResponse)(nil), // 2: skywalking.v10.PprofCollectionResponse + (*PprofMetaData)(nil), // 3: skywalking.v10.PprofMetaData + (*PprofTaskCommandQuery)(nil), // 4: skywalking.v10.PprofTaskCommandQuery + (*v3.Commands)(nil), // 5: skywalking.v3.Commands +} +var file_pprof_Pprof_proto_depIdxs = []int32{ + 3, // 0: skywalking.v10.PprofData.metadata:type_name -> skywalking.v10.PprofMetaData + 0, // 1: skywalking.v10.PprofCollectionResponse.status:type_name -> skywalking.v10.PprofProfilingStatus + 0, // 2: skywalking.v10.PprofMetaData.type:type_name -> skywalking.v10.PprofProfilingStatus + 1, // 3: skywalking.v10.PprofTask.collect:input_type -> skywalking.v10.PprofData + 4, // 4: skywalking.v10.PprofTask.getPprofTaskCommands:input_type -> skywalking.v10.PprofTaskCommandQuery + 2, // 5: skywalking.v10.PprofTask.collect:output_type -> skywalking.v10.PprofCollectionResponse + 5, // 6: skywalking.v10.PprofTask.getPprofTaskCommands:output_type -> skywalking.v3.Commands + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_pprof_Pprof_proto_init() } +func file_pprof_Pprof_proto_init() { + if File_pprof_Pprof_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pprof_Pprof_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PprofData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pprof_Pprof_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PprofCollectionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pprof_Pprof_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PprofMetaData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pprof_Pprof_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PprofTaskCommandQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_pprof_Pprof_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*PprofData_ErrorMessage)(nil), + (*PprofData_Content)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pprof_Pprof_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pprof_Pprof_proto_goTypes, + DependencyIndexes: file_pprof_Pprof_proto_depIdxs, + EnumInfos: file_pprof_Pprof_proto_enumTypes, + MessageInfos: file_pprof_Pprof_proto_msgTypes, + }.Build() + File_pprof_Pprof_proto = out.File + file_pprof_Pprof_proto_rawDesc = nil + file_pprof_Pprof_proto_goTypes = nil + file_pprof_Pprof_proto_depIdxs = nil +} diff --git a/collect/pprof/v10/Pprof_grpc.pb.go b/collect/pprof/v10/Pprof_grpc.pb.go new file mode 100644 index 0000000..b305e56 --- /dev/null +++ b/collect/pprof/v10/Pprof_grpc.pb.go @@ -0,0 +1,179 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.14.0 +// source: pprof/Pprof.proto + +package v10 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + v3 "skywalking.apache.org/repo/goapi/collect/common/v3" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PprofTaskClient is the client API for PprofTask service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PprofTaskClient interface { + // collect pprof data to the OAP server. + Collect(ctx context.Context, opts ...grpc.CallOption) (PprofTask_CollectClient, error) + // getPprofTaskCommands sends query to the OAP server for all pprof tasks to be executed for the given Go Agent instance + GetPprofTaskCommands(ctx context.Context, in *PprofTaskCommandQuery, opts ...grpc.CallOption) (*v3.Commands, error) +} + +type pprofTaskClient struct { + cc grpc.ClientConnInterface +} + +func NewPprofTaskClient(cc grpc.ClientConnInterface) PprofTaskClient { + return &pprofTaskClient{cc} +} + +func (c *pprofTaskClient) Collect(ctx context.Context, opts ...grpc.CallOption) (PprofTask_CollectClient, error) { + stream, err := c.cc.NewStream(ctx, &PprofTask_ServiceDesc.Streams[0], "/skywalking.v10.PprofTask/collect", opts...) + if err != nil { + return nil, err + } + x := &pprofTaskCollectClient{stream} + return x, nil +} + +type PprofTask_CollectClient interface { + Send(*PprofData) error + Recv() (*PprofCollectionResponse, error) + grpc.ClientStream +} + +type pprofTaskCollectClient struct { + grpc.ClientStream +} + +func (x *pprofTaskCollectClient) Send(m *PprofData) error { + return x.ClientStream.SendMsg(m) +} + +func (x *pprofTaskCollectClient) Recv() (*PprofCollectionResponse, error) { + m := new(PprofCollectionResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *pprofTaskClient) GetPprofTaskCommands(ctx context.Context, in *PprofTaskCommandQuery, opts ...grpc.CallOption) (*v3.Commands, error) { + out := new(v3.Commands) + err := c.cc.Invoke(ctx, "/skywalking.v10.PprofTask/getPprofTaskCommands", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PprofTaskServer is the server API for PprofTask service. +// All implementations must embed UnimplementedPprofTaskServer +// for forward compatibility +type PprofTaskServer interface { + // collect pprof data to the OAP server. + Collect(PprofTask_CollectServer) error + // getPprofTaskCommands sends query to the OAP server for all pprof tasks to be executed for the given Go Agent instance + GetPprofTaskCommands(context.Context, *PprofTaskCommandQuery) (*v3.Commands, error) + mustEmbedUnimplementedPprofTaskServer() +} + +// UnimplementedPprofTaskServer must be embedded to have forward compatible implementations. +type UnimplementedPprofTaskServer struct { +} + +func (UnimplementedPprofTaskServer) Collect(PprofTask_CollectServer) error { + return status.Errorf(codes.Unimplemented, "method Collect not implemented") +} +func (UnimplementedPprofTaskServer) GetPprofTaskCommands(context.Context, *PprofTaskCommandQuery) (*v3.Commands, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofTaskCommands not implemented") +} +func (UnimplementedPprofTaskServer) mustEmbedUnimplementedPprofTaskServer() {} + +// UnsafePprofTaskServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PprofTaskServer will +// result in compilation errors. +type UnsafePprofTaskServer interface { + mustEmbedUnimplementedPprofTaskServer() +} + +func RegisterPprofTaskServer(s grpc.ServiceRegistrar, srv PprofTaskServer) { + s.RegisterService(&PprofTask_ServiceDesc, srv) +} + +func _PprofTask_Collect_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PprofTaskServer).Collect(&pprofTaskCollectServer{stream}) +} + +type PprofTask_CollectServer interface { + Send(*PprofCollectionResponse) error + Recv() (*PprofData, error) + grpc.ServerStream +} + +type pprofTaskCollectServer struct { + grpc.ServerStream +} + +func (x *pprofTaskCollectServer) Send(m *PprofCollectionResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *pprofTaskCollectServer) Recv() (*PprofData, error) { + m := new(PprofData) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _PprofTask_GetPprofTaskCommands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PprofTaskCommandQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PprofTaskServer).GetPprofTaskCommands(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/skywalking.v10.PprofTask/getPprofTaskCommands", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PprofTaskServer).GetPprofTaskCommands(ctx, req.(*PprofTaskCommandQuery)) + } + return interceptor(ctx, in, info, handler) +} + +// PprofTask_ServiceDesc is the grpc.ServiceDesc for PprofTask service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PprofTask_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "skywalking.v10.PprofTask", + HandlerType: (*PprofTaskServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "getPprofTaskCommands", + Handler: _PprofTask_GetPprofTaskCommands_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "collect", + Handler: _PprofTask_Collect_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "pprof/Pprof.proto", +} diff --git a/dependencies.sh b/dependencies.sh index 095ae3e..863457b 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -export COLLECT_PROTOCOL_SHA=157baf3e7a9710d3041e9caec39eecab7e0c5a82 +export COLLECT_PROTOCOL_SHA=16c51358ebcf42629bf4ffdf952253971f20eb25 export QUERY_PROTOCOL_SHA=23baed2234e4bbc18cd7ec7d47bfe7d4bc8ef363 export ENVOY_SERVICE_PROTOCOL_SHA=533b32f1b390a3a88ec2008d0561e07c926d879a export XDS_SERVICE_PROTOCOL_SHA=25de7278fc844d392d607214f36dbedf50f167ee diff --git a/go.mod b/go.mod index 41a2d3d..07455a3 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module skywalking.apache.org/repo/goapi go 1.24 require ( - google.golang.org/grpc v1.72.0 + google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 ) require ( - github.com/google/go-cmp v0.7.0 // indirect golang.org/x/net v0.40.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.25.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect + ) diff --git a/go.sum b/go.sum index 7893873..4c7396c 100644 --- a/go.sum +++ b/go.sum @@ -10,25 +10,25 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= +go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= +go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= +go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= +go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= +go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 h1:IqsN8hx+lWLqlN+Sc3DoMy/watjofWiU8sRFgQ8fhKM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= -google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= +google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=