From 9abf594c16cc87a91890da7d360a9b566082fb50 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Sun, 20 Jul 2025 09:55:59 +0800 Subject: [PATCH 1/9] feat(add go profile method) --- collect/language/profile/v3/Profile.pb.go | 340 +++++++++--------- .../language/profile/v3/Profile_grpc.pb.go | 143 +++++--- go.mod | 6 +- go.sum | 28 +- main.go | 7 + 5 files changed, 278 insertions(+), 246 deletions(-) create mode 100644 main.go diff --git a/collect/language/profile/v3/Profile.pb.go b/collect/language/profile/v3/Profile.pb.go index 4140c78..9b93696 100644 --- a/collect/language/profile/v3/Profile.pb.go +++ b/collect/language/profile/v3/Profile.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.14.0 +// protoc-gen-go v1.36.6 +// protoc v3.6.1 // source: profile/Profile.proto package v3 @@ -29,6 +29,7 @@ import ( reflect "reflect" v3 "skywalking.apache.org/repo/goapi/collect/common/v3" sync "sync" + unsafe "unsafe" ) const ( @@ -39,24 +40,21 @@ const ( ) type ProfileTaskCommandQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // current sniffer information Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` // last command timestamp LastCommandTime int64 `protobuf:"varint,3,opt,name=lastCommandTime,proto3" json:"lastCommandTime,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ProfileTaskCommandQuery) Reset() { *x = ProfileTaskCommandQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_profile_Profile_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_profile_Profile_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProfileTaskCommandQuery) String() string { @@ -67,7 +65,7 @@ func (*ProfileTaskCommandQuery) ProtoMessage() {} func (x *ProfileTaskCommandQuery) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -105,10 +103,7 @@ func (x *ProfileTaskCommandQuery) GetLastCommandTime() int64 { // dumped thread snapshot type ThreadSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // profile task id TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` // dumped segment id @@ -118,16 +113,16 @@ type ThreadSnapshot struct { // snapshot dump sequence, start with zero Sequence int32 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` // snapshot stack - Stack *ThreadStack `protobuf:"bytes,5,opt,name=stack,proto3" json:"stack,omitempty"` + Stack *ThreadStack `protobuf:"bytes,5,opt,name=stack,proto3" json:"stack,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ThreadSnapshot) Reset() { *x = ThreadSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_profile_Profile_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_profile_Profile_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ThreadSnapshot) String() string { @@ -138,7 +133,7 @@ func (*ThreadSnapshot) ProtoMessage() {} func (x *ThreadSnapshot) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -189,21 +184,18 @@ func (x *ThreadSnapshot) GetStack() *ThreadStack { } type ThreadStack struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // stack code signature list CodeSignatures []string `protobuf:"bytes,1,rep,name=codeSignatures,proto3" json:"codeSignatures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ThreadStack) Reset() { *x = ThreadStack{} - if protoimpl.UnsafeEnabled { - mi := &file_profile_Profile_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_profile_Profile_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ThreadStack) String() string { @@ -214,7 +206,7 @@ func (*ThreadStack) ProtoMessage() {} func (x *ThreadStack) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -238,24 +230,21 @@ func (x *ThreadStack) GetCodeSignatures() []string { // profile task finished report type ProfileTaskFinishReport struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // current sniffer information Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` // profile task - TaskId string `protobuf:"bytes,3,opt,name=taskId,proto3" json:"taskId,omitempty"` + TaskId string `protobuf:"bytes,3,opt,name=taskId,proto3" json:"taskId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ProfileTaskFinishReport) Reset() { *x = ProfileTaskFinishReport{} - if protoimpl.UnsafeEnabled { - mi := &file_profile_Profile_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_profile_Profile_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProfileTaskFinishReport) String() string { @@ -266,7 +255,7 @@ func (*ProfileTaskFinishReport) ProtoMessage() {} func (x *ProfileTaskFinishReport) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -302,103 +291,161 @@ func (x *ProfileTaskFinishReport) GetTaskId() string { return "" } -var File_profile_Profile_proto protoreflect.FileDescriptor +// profile for go agent +type GoProfileData struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` + TraceId string `protobuf:"bytes,2,opt,name=traceId,proto3" json:"traceId,omitempty"` + EndPointName string `protobuf:"bytes,3,opt,name=endPointName,proto3" json:"endPointName,omitempty"` + MinDurationThreshold int64 `protobuf:"varint,4,opt,name=minDurationThreshold,proto3" json:"minDurationThreshold,omitempty"` + // the truly profile data + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` + // check last part true or false + IsLast bool `protobuf:"varint,6,opt,name=isLast,proto3" json:"isLast,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GoProfileData) Reset() { + *x = GoProfileData{} + 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 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} +} -var file_profile_Profile_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, - 0x17, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 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, 0x22, 0xb2, 0x01, 0x0a, 0x0e, 0x54, 0x68, 0x72, 0x65, 0x61, - 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 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, 0x26, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x65, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6b, 0x79, 0x77, 0x61, - 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x53, - 0x74, 0x61, 0x63, 0x6b, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x35, 0x0a, 0x0b, 0x54, - 0x68, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, - 0x64, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x22, 0x75, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x61, 0x73, - 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 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, 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, +func (x *GoProfileData) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *GoProfileData) GetTraceId() string { + if x != nil { + return x.TraceId + } + return "" +} + +func (x *GoProfileData) GetEndPointName() string { + if x != nil { + return x.EndPointName + } + return "" } +func (x *GoProfileData) GetMinDurationThreshold() int64 { + if x != nil { + return x.MinDurationThreshold + } + return 0 +} + +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 + +const file_profile_Profile_proto_rawDesc = "" + + "\n" + + "\x15profile/Profile.proto\x12\rskywalking.v3\x1a\x14common/Command.proto\"\x87\x01\n" + + "\x17ProfileTaskCommandQuery\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + + "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12(\n" + + "\x0flastCommandTime\x18\x03 \x01(\x03R\x0flastCommandTime\"\xb2\x01\n" + + "\x0eThreadSnapshot\x12\x16\n" + + "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12&\n" + + "\x0etraceSegmentId\x18\x02 \x01(\tR\x0etraceSegmentId\x12\x12\n" + + "\x04time\x18\x03 \x01(\x03R\x04time\x12\x1a\n" + + "\bsequence\x18\x04 \x01(\x05R\bsequence\x120\n" + + "\x05stack\x18\x05 \x01(\v2\x1a.skywalking.v3.ThreadStackR\x05stack\"5\n" + + "\vThreadStack\x12&\n" + + "\x0ecodeSignatures\x18\x01 \x03(\tR\x0ecodeSignatures\"u\n" + + "\x17ProfileTaskFinishReport\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + + "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12\x16\n" + + "\x06taskId\x18\x03 \x01(\tR\x06taskId\"\xcb\x01\n" + + "\rGoProfileData\x12\x16\n" + + "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12\x18\n" + + "\atraceId\x18\x02 \x01(\tR\atraceId\x12\"\n" + + "\fendPointName\x18\x03 \x01(\tR\fendPointName\x122\n" + + "\x14minDurationThreshold\x18\x04 \x01(\x03R\x14minDurationThreshold\x12\x18\n" + + "\apayload\x18\x05 \x01(\fR\apayload\x12\x16\n" + + "\x06isLast\x18\x06 \x01(\bR\x06isLast2\xde\x02\n" + + "\vProfileTask\x12[\n" + + "\x16getProfileTaskCommands\x12&.skywalking.v3.ProfileTaskCommandQuery\x1a\x17.skywalking.v3.Commands\"\x00\x12M\n" + + "\x0fcollectSnapshot\x12\x1d.skywalking.v3.ThreadSnapshot\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12L\n" + + "\x0fgoProfileReport\x12\x1c.skywalking.v3.GoProfileData\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12U\n" + + "\x10reportTaskFinish\x12&.skywalking.v3.ProfileTaskFinishReport\x1a\x17.skywalking.v3.Commands\"\x00B\x97\x01\n" + + "5org.apache.skywalking.apm.network.language.profile.v3P\x01Z 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 @@ -409,63 +456,13 @@ func file_profile_Profile_proto_init() { if File_profile_Profile_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_profile_Profile_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProfileTaskCommandQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_profile_Profile_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ThreadSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_profile_Profile_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ThreadStack); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_profile_Profile_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProfileTaskFinishReport); 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{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_profile_Profile_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_profile_Profile_proto_rawDesc), len(file_profile_Profile_proto_rawDesc)), NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, @@ -474,7 +471,6 @@ func file_profile_Profile_proto_init() { MessageInfos: file_profile_Profile_proto_msgTypes, }.Build() File_profile_Profile_proto = out.File - file_profile_Profile_proto_rawDesc = nil file_profile_Profile_proto_goTypes = nil file_profile_Profile_proto_depIdxs = nil } diff --git a/collect/language/profile/v3/Profile_grpc.pb.go b/collect/language/profile/v3/Profile_grpc.pb.go index 0e8b7b4..736a595 100644 --- a/collect/language/profile/v3/Profile_grpc.pb.go +++ b/collect/language/profile/v3/Profile_grpc.pb.go @@ -1,7 +1,24 @@ +// +// 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-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.14.0 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.6.1 // source: profile/Profile.proto package v3 @@ -16,8 +33,15 @@ import ( // 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 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ProfileTask_GetProfileTaskCommands_FullMethodName = "/skywalking.v3.ProfileTask/getProfileTaskCommands" + ProfileTask_CollectSnapshot_FullMethodName = "/skywalking.v3.ProfileTask/collectSnapshot" + ProfileTask_GoProfileReport_FullMethodName = "/skywalking.v3.ProfileTask/goProfileReport" + ProfileTask_ReportTaskFinish_FullMethodName = "/skywalking.v3.ProfileTask/reportTaskFinish" +) // ProfileTaskClient is the client API for ProfileTask service. // @@ -26,7 +50,9 @@ type ProfileTaskClient interface { // query all sniffer need to execute profile task commands 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) + CollectSnapshot(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ThreadSnapshot, v3.Commands], error) + // collect bytes profile data from go agent + GoProfileReport(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[GoProfileData, v3.Commands], error) // report profiling task finished ReportTaskFinish(ctx context.Context, in *ProfileTaskFinishReport, opts ...grpc.CallOption) (*v3.Commands, error) } @@ -40,51 +66,45 @@ func NewProfileTaskClient(cc grpc.ClientConnInterface) ProfileTaskClient { } func (c *profileTaskClient) GetProfileTaskCommands(ctx context.Context, in *ProfileTaskCommandQuery, opts ...grpc.CallOption) (*v3.Commands, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v3.Commands) - err := c.cc.Invoke(ctx, "/skywalking.v3.ProfileTask/getProfileTaskCommands", in, out, opts...) + err := c.cc.Invoke(ctx, ProfileTask_GetProfileTaskCommands_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *profileTaskClient) CollectSnapshot(ctx context.Context, opts ...grpc.CallOption) (ProfileTask_CollectSnapshotClient, error) { - stream, err := c.cc.NewStream(ctx, &ProfileTask_ServiceDesc.Streams[0], "/skywalking.v3.ProfileTask/collectSnapshot", opts...) +func (c *profileTaskClient) CollectSnapshot(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ThreadSnapshot, v3.Commands], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ProfileTask_ServiceDesc.Streams[0], ProfileTask_CollectSnapshot_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &profileTaskCollectSnapshotClient{stream} + x := &grpc.GenericClientStream[ThreadSnapshot, v3.Commands]{ClientStream: stream} return x, nil } -type ProfileTask_CollectSnapshotClient interface { - Send(*ThreadSnapshot) error - CloseAndRecv() (*v3.Commands, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProfileTask_CollectSnapshotClient = grpc.ClientStreamingClient[ThreadSnapshot, v3.Commands] -type profileTaskCollectSnapshotClient struct { - grpc.ClientStream -} - -func (x *profileTaskCollectSnapshotClient) Send(m *ThreadSnapshot) error { - return x.ClientStream.SendMsg(m) -} - -func (x *profileTaskCollectSnapshotClient) 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 { +func (c *profileTaskClient) GoProfileReport(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[GoProfileData, v3.Commands], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ProfileTask_ServiceDesc.Streams[1], ProfileTask_GoProfileReport_FullMethodName, cOpts...) + if err != nil { return nil, err } - return m, nil + x := &grpc.GenericClientStream[GoProfileData, v3.Commands]{ClientStream: stream} + return x, nil } +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProfileTask_GoProfileReportClient = grpc.ClientStreamingClient[GoProfileData, v3.Commands] + func (c *profileTaskClient) ReportTaskFinish(ctx context.Context, in *ProfileTaskFinishReport, opts ...grpc.CallOption) (*v3.Commands, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v3.Commands) - err := c.cc.Invoke(ctx, "/skywalking.v3.ProfileTask/reportTaskFinish", in, out, opts...) + err := c.cc.Invoke(ctx, ProfileTask_ReportTaskFinish_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,31 +113,40 @@ func (c *profileTaskClient) ReportTaskFinish(ctx context.Context, in *ProfileTas // ProfileTaskServer is the server API for ProfileTask service. // All implementations must embed UnimplementedProfileTaskServer -// for forward compatibility +// for forward compatibility. type ProfileTaskServer interface { // query all sniffer need to execute profile task commands GetProfileTaskCommands(context.Context, *ProfileTaskCommandQuery) (*v3.Commands, error) // collect dumped thread snapshot - CollectSnapshot(ProfileTask_CollectSnapshotServer) error + CollectSnapshot(grpc.ClientStreamingServer[ThreadSnapshot, v3.Commands]) error + // collect bytes profile data from go agent + GoProfileReport(grpc.ClientStreamingServer[GoProfileData, v3.Commands]) error // report profiling task finished ReportTaskFinish(context.Context, *ProfileTaskFinishReport) (*v3.Commands, error) mustEmbedUnimplementedProfileTaskServer() } -// UnimplementedProfileTaskServer must be embedded to have forward compatible implementations. -type UnimplementedProfileTaskServer struct { -} +// UnimplementedProfileTaskServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedProfileTaskServer struct{} func (UnimplementedProfileTaskServer) GetProfileTaskCommands(context.Context, *ProfileTaskCommandQuery) (*v3.Commands, error) { return nil, status.Errorf(codes.Unimplemented, "method GetProfileTaskCommands not implemented") } -func (UnimplementedProfileTaskServer) CollectSnapshot(ProfileTask_CollectSnapshotServer) error { +func (UnimplementedProfileTaskServer) CollectSnapshot(grpc.ClientStreamingServer[ThreadSnapshot, v3.Commands]) error { return status.Errorf(codes.Unimplemented, "method CollectSnapshot not implemented") } +func (UnimplementedProfileTaskServer) GoProfileReport(grpc.ClientStreamingServer[GoProfileData, v3.Commands]) 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") } func (UnimplementedProfileTaskServer) mustEmbedUnimplementedProfileTaskServer() {} +func (UnimplementedProfileTaskServer) testEmbeddedByValue() {} // UnsafeProfileTaskServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ProfileTaskServer will @@ -127,6 +156,13 @@ type UnsafeProfileTaskServer interface { } func RegisterProfileTaskServer(s grpc.ServiceRegistrar, srv ProfileTaskServer) { + // If the following call pancis, it indicates UnimplementedProfileTaskServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ProfileTask_ServiceDesc, srv) } @@ -140,7 +176,7 @@ func _ProfileTask_GetProfileTaskCommands_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/skywalking.v3.ProfileTask/getProfileTaskCommands", + FullMethod: ProfileTask_GetProfileTaskCommands_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProfileTaskServer).GetProfileTaskCommands(ctx, req.(*ProfileTaskCommandQuery)) @@ -149,30 +185,18 @@ func _ProfileTask_GetProfileTaskCommands_Handler(srv interface{}, ctx context.Co } func _ProfileTask_CollectSnapshot_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ProfileTaskServer).CollectSnapshot(&profileTaskCollectSnapshotServer{stream}) -} - -type ProfileTask_CollectSnapshotServer interface { - SendAndClose(*v3.Commands) error - Recv() (*ThreadSnapshot, error) - grpc.ServerStream + return srv.(ProfileTaskServer).CollectSnapshot(&grpc.GenericServerStream[ThreadSnapshot, v3.Commands]{ServerStream: stream}) } -type profileTaskCollectSnapshotServer struct { - grpc.ServerStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProfileTask_CollectSnapshotServer = grpc.ClientStreamingServer[ThreadSnapshot, v3.Commands] -func (x *profileTaskCollectSnapshotServer) SendAndClose(m *v3.Commands) error { - return x.ServerStream.SendMsg(m) +func _ProfileTask_GoProfileReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ProfileTaskServer).GoProfileReport(&grpc.GenericServerStream[GoProfileData, v3.Commands]{ServerStream: stream}) } -func (x *profileTaskCollectSnapshotServer) Recv() (*ThreadSnapshot, error) { - m := new(ThreadSnapshot) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProfileTask_GoProfileReportServer = grpc.ClientStreamingServer[GoProfileData, v3.Commands] func _ProfileTask_ReportTaskFinish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ProfileTaskFinishReport) @@ -184,7 +208,7 @@ func _ProfileTask_ReportTaskFinish_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/skywalking.v3.ProfileTask/reportTaskFinish", + FullMethod: ProfileTask_ReportTaskFinish_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProfileTaskServer).ReportTaskFinish(ctx, req.(*ProfileTaskFinishReport)) @@ -214,6 +238,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/go.mod b/go.mod index 41a2d3d..c878a62 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 v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + ) diff --git a/go.sum b/go.sum index 7893873..b61c92f 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 v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +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= diff --git a/main.go b/main.go new file mode 100644 index 0000000..c048119 --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("hello world") +} From c55ad7377ff67955946310b43b5cf7c16d6c1fa2 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 1 Aug 2025 10:40:06 +0800 Subject: [PATCH 2/9] fix(profile proto delete some thing) --- collect/language/profile/v3/Profile.pb.go | 42 +++++++---------------- scripts/generate-profile.sh | 1 + 2 files changed, 13 insertions(+), 30 deletions(-) create mode 100644 scripts/generate-profile.sh diff --git a/collect/language/profile/v3/Profile.pb.go b/collect/language/profile/v3/Profile.pb.go index 9b93696..8538d1d 100644 --- a/collect/language/profile/v3/Profile.pb.go +++ b/collect/language/profile/v3/Profile.pb.go @@ -293,15 +293,13 @@ func (x *ProfileTaskFinishReport) GetTaskId() string { // profile for go agent type GoProfileData struct { - state protoimpl.MessageState `protogen:"open.v1"` - TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` - TraceId string `protobuf:"bytes,2,opt,name=traceId,proto3" json:"traceId,omitempty"` - EndPointName string `protobuf:"bytes,3,opt,name=endPointName,proto3" json:"endPointName,omitempty"` - MinDurationThreshold int64 `protobuf:"varint,4,opt,name=minDurationThreshold,proto3" json:"minDurationThreshold,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` + TraceSegmentId string `protobuf:"bytes,2,opt,name=traceSegmentId,proto3" json:"traceSegmentId,omitempty"` // the truly profile data - Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // check last part true or false - IsLast bool `protobuf:"varint,6,opt,name=isLast,proto3" json:"isLast,omitempty"` + IsLast bool `protobuf:"varint,4,opt,name=isLast,proto3" json:"isLast,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -343,27 +341,13 @@ func (x *GoProfileData) GetTaskId() string { return "" } -func (x *GoProfileData) GetTraceId() string { +func (x *GoProfileData) GetTraceSegmentId() string { if x != nil { - return x.TraceId - } - return "" -} - -func (x *GoProfileData) GetEndPointName() string { - if x != nil { - return x.EndPointName + return x.TraceSegmentId } return "" } -func (x *GoProfileData) GetMinDurationThreshold() int64 { - if x != nil { - return x.MinDurationThreshold - } - return 0 -} - func (x *GoProfileData) GetPayload() []byte { if x != nil { return x.Payload @@ -398,14 +382,12 @@ const file_profile_Profile_proto_rawDesc = "" + "\x17ProfileTaskFinishReport\x12\x18\n" + "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12\x16\n" + - "\x06taskId\x18\x03 \x01(\tR\x06taskId\"\xcb\x01\n" + + "\x06taskId\x18\x03 \x01(\tR\x06taskId\"\x81\x01\n" + "\rGoProfileData\x12\x16\n" + - "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12\x18\n" + - "\atraceId\x18\x02 \x01(\tR\atraceId\x12\"\n" + - "\fendPointName\x18\x03 \x01(\tR\fendPointName\x122\n" + - "\x14minDurationThreshold\x18\x04 \x01(\x03R\x14minDurationThreshold\x12\x18\n" + - "\apayload\x18\x05 \x01(\fR\apayload\x12\x16\n" + - "\x06isLast\x18\x06 \x01(\bR\x06isLast2\xde\x02\n" + + "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12&\n" + + "\x0etraceSegmentId\x18\x02 \x01(\tR\x0etraceSegmentId\x12\x18\n" + + "\apayload\x18\x03 \x01(\fR\apayload\x12\x16\n" + + "\x06isLast\x18\x04 \x01(\bR\x06isLast2\xde\x02\n" + "\vProfileTask\x12[\n" + "\x16getProfileTaskCommands\x12&.skywalking.v3.ProfileTaskCommandQuery\x1a\x17.skywalking.v3.Commands\"\x00\x12M\n" + "\x0fcollectSnapshot\x12\x1d.skywalking.v3.ThreadSnapshot\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12L\n" + diff --git a/scripts/generate-profile.sh b/scripts/generate-profile.sh new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/scripts/generate-profile.sh @@ -0,0 +1 @@ + \ No newline at end of file From 79e52ad43d642bd62e6b51dce24b0f1312b3c854 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 29 Aug 2025 09:21:17 +0800 Subject: [PATCH 3/9] feat(add profile logic for go agent) --- collect/language/profile/v3/Profile.pb.go | 25 ++++++++--------------- go.mod | 1 + go.sum | 4 ++-- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/collect/language/profile/v3/Profile.pb.go b/collect/language/profile/v3/Profile.pb.go index 8538d1d..ec9b9db 100644 --- a/collect/language/profile/v3/Profile.pb.go +++ b/collect/language/profile/v3/Profile.pb.go @@ -293,13 +293,12 @@ func (x *ProfileTaskFinishReport) GetTaskId() string { // profile for go agent type GoProfileData struct { - state protoimpl.MessageState `protogen:"open.v1"` - TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` - TraceSegmentId string `protobuf:"bytes,2,opt,name=traceSegmentId,proto3" json:"traceSegmentId,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` // the truly profile data - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // check last part true or false - IsLast bool `protobuf:"varint,4,opt,name=isLast,proto3" json:"isLast,omitempty"` + IsLast bool `protobuf:"varint,3,opt,name=isLast,proto3" json:"isLast,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -341,13 +340,6 @@ func (x *GoProfileData) GetTaskId() string { return "" } -func (x *GoProfileData) GetTraceSegmentId() string { - if x != nil { - return x.TraceSegmentId - } - return "" -} - func (x *GoProfileData) GetPayload() []byte { if x != nil { return x.Payload @@ -382,12 +374,11 @@ const file_profile_Profile_proto_rawDesc = "" + "\x17ProfileTaskFinishReport\x12\x18\n" + "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12\x16\n" + - "\x06taskId\x18\x03 \x01(\tR\x06taskId\"\x81\x01\n" + + "\x06taskId\x18\x03 \x01(\tR\x06taskId\"Y\n" + "\rGoProfileData\x12\x16\n" + - "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12&\n" + - "\x0etraceSegmentId\x18\x02 \x01(\tR\x0etraceSegmentId\x12\x18\n" + - "\apayload\x18\x03 \x01(\fR\apayload\x12\x16\n" + - "\x06isLast\x18\x04 \x01(\bR\x06isLast2\xde\x02\n" + + "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12\x18\n" + + "\apayload\x18\x02 \x01(\fR\apayload\x12\x16\n" + + "\x06isLast\x18\x03 \x01(\bR\x06isLast2\xde\x02\n" + "\vProfileTask\x12[\n" + "\x16getProfileTaskCommands\x12&.skywalking.v3.ProfileTaskCommandQuery\x1a\x17.skywalking.v3.Commands\"\x00\x12M\n" + "\x0fcollectSnapshot\x12\x1d.skywalking.v3.ThreadSnapshot\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12L\n" + diff --git a/go.mod b/go.mod index c878a62..ab5a813 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( 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-20250324211829-b45e905df463 // indirect //google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect ) diff --git a/go.sum b/go.sum index b61c92f..4c7396c 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ 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 v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +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= From 8c56baf19a55a34e98111c1670d967885ca73144 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 29 Aug 2025 09:53:36 +0800 Subject: [PATCH 4/9] fix(delete main.go) --- main.go | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 main.go diff --git a/main.go b/main.go deleted file mode 100644 index c048119..0000000 --- a/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("hello world") -} From 961fabb0baa18eab91320142b1db6513d5936787 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 29 Aug 2025 09:57:47 +0800 Subject: [PATCH 5/9] fix(delete profile.sh) --- scripts/generate-profile.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 scripts/generate-profile.sh diff --git a/scripts/generate-profile.sh b/scripts/generate-profile.sh deleted file mode 100644 index 0519ecb..0000000 --- a/scripts/generate-profile.sh +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From e853d6953685e5e6f42b21468b1fd4580038fd6b Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 29 Aug 2025 10:31:10 +0800 Subject: [PATCH 6/9] chore(update COLLECT_PROTOCOL_SHA) --- dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From d458ac59828c06a0c56d79b7cef1eefb243903c1 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Fri, 29 Aug 2025 10:43:29 +0800 Subject: [PATCH 7/9] fix(delete no use dependency) --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index ab5a813..07455a3 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,5 @@ require ( 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-20250324211829-b45e905df463 // indirect - //google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect ) From 59469375fc12f9694642af325ff7364c97a42846 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Sun, 31 Aug 2025 15:10:58 +0800 Subject: [PATCH 8/9] fix(fix the protoc version error) --- collect/language/profile/v3/Profile.pb.go | 273 ++++++--- .../language/profile/v3/Profile_grpc.pb.go | 189 +++--- collect/pprof/v10/Pprof.pb.go | 566 ++++++++++++++++++ collect/pprof/v10/Pprof_grpc.pb.go | 179 ++++++ go.mod | 5 + go.sum | 24 + 6 files changed, 1088 insertions(+), 148 deletions(-) create mode 100644 collect/pprof/v10/Pprof.pb.go create mode 100644 collect/pprof/v10/Pprof_grpc.pb.go diff --git a/collect/language/profile/v3/Profile.pb.go b/collect/language/profile/v3/Profile.pb.go index ec9b9db..3698a48 100644 --- a/collect/language/profile/v3/Profile.pb.go +++ b/collect/language/profile/v3/Profile.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 -// protoc v3.6.1 +// protoc-gen-go v1.28.1 +// protoc v3.14.0 // source: profile/Profile.proto package v3 @@ -29,7 +29,6 @@ import ( reflect "reflect" v3 "skywalking.apache.org/repo/goapi/collect/common/v3" sync "sync" - unsafe "unsafe" ) const ( @@ -40,21 +39,24 @@ const ( ) type ProfileTaskCommandQuery struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // current sniffer information Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` // last command timestamp LastCommandTime int64 `protobuf:"varint,3,opt,name=lastCommandTime,proto3" json:"lastCommandTime,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *ProfileTaskCommandQuery) Reset() { *x = ProfileTaskCommandQuery{} - mi := &file_profile_Profile_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_profile_Profile_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ProfileTaskCommandQuery) String() string { @@ -65,7 +67,7 @@ func (*ProfileTaskCommandQuery) ProtoMessage() {} func (x *ProfileTaskCommandQuery) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -103,7 +105,10 @@ func (x *ProfileTaskCommandQuery) GetLastCommandTime() int64 { // dumped thread snapshot type ThreadSnapshot struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // profile task id TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` // dumped segment id @@ -113,16 +118,16 @@ type ThreadSnapshot struct { // snapshot dump sequence, start with zero Sequence int32 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` // snapshot stack - Stack *ThreadStack `protobuf:"bytes,5,opt,name=stack,proto3" json:"stack,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Stack *ThreadStack `protobuf:"bytes,5,opt,name=stack,proto3" json:"stack,omitempty"` } func (x *ThreadSnapshot) Reset() { *x = ThreadSnapshot{} - mi := &file_profile_Profile_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_profile_Profile_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ThreadSnapshot) String() string { @@ -133,7 +138,7 @@ func (*ThreadSnapshot) ProtoMessage() {} func (x *ThreadSnapshot) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -184,18 +189,21 @@ func (x *ThreadSnapshot) GetStack() *ThreadStack { } type ThreadStack struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // stack code signature list CodeSignatures []string `protobuf:"bytes,1,rep,name=codeSignatures,proto3" json:"codeSignatures,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *ThreadStack) Reset() { *x = ThreadStack{} - mi := &file_profile_Profile_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_profile_Profile_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ThreadStack) String() string { @@ -206,7 +214,7 @@ func (*ThreadStack) ProtoMessage() {} func (x *ThreadStack) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -230,21 +238,24 @@ func (x *ThreadStack) GetCodeSignatures() []string { // profile task finished report type ProfileTaskFinishReport struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // current sniffer information Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` ServiceInstance string `protobuf:"bytes,2,opt,name=serviceInstance,proto3" json:"serviceInstance,omitempty"` // profile task - TaskId string `protobuf:"bytes,3,opt,name=taskId,proto3" json:"taskId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + TaskId string `protobuf:"bytes,3,opt,name=taskId,proto3" json:"taskId,omitempty"` } func (x *ProfileTaskFinishReport) Reset() { *x = ProfileTaskFinishReport{} - mi := &file_profile_Profile_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_profile_Profile_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ProfileTaskFinishReport) String() string { @@ -255,7 +266,7 @@ func (*ProfileTaskFinishReport) ProtoMessage() {} func (x *ProfileTaskFinishReport) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -293,21 +304,24 @@ func (x *ProfileTaskFinishReport) GetTaskId() string { // profile for go agent type GoProfileData struct { - state protoimpl.MessageState `protogen:"open.v1"` - TaskId string `protobuf:"bytes,1,opt,name=taskId,proto3" json:"taskId,omitempty"` + 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + IsLast bool `protobuf:"varint,3,opt,name=isLast,proto3" json:"isLast,omitempty"` } func (x *GoProfileData) Reset() { *x = GoProfileData{} - mi := &file_profile_Profile_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + 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 { @@ -318,7 +332,7 @@ func (*GoProfileData) ProtoMessage() {} func (x *GoProfileData) ProtoReflect() protoreflect.Message { mi := &file_profile_Profile_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -356,50 +370,96 @@ func (x *GoProfileData) GetIsLast() bool { var File_profile_Profile_proto protoreflect.FileDescriptor -const file_profile_Profile_proto_rawDesc = "" + - "\n" + - "\x15profile/Profile.proto\x12\rskywalking.v3\x1a\x14common/Command.proto\"\x87\x01\n" + - "\x17ProfileTaskCommandQuery\x12\x18\n" + - "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + - "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12(\n" + - "\x0flastCommandTime\x18\x03 \x01(\x03R\x0flastCommandTime\"\xb2\x01\n" + - "\x0eThreadSnapshot\x12\x16\n" + - "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12&\n" + - "\x0etraceSegmentId\x18\x02 \x01(\tR\x0etraceSegmentId\x12\x12\n" + - "\x04time\x18\x03 \x01(\x03R\x04time\x12\x1a\n" + - "\bsequence\x18\x04 \x01(\x05R\bsequence\x120\n" + - "\x05stack\x18\x05 \x01(\v2\x1a.skywalking.v3.ThreadStackR\x05stack\"5\n" + - "\vThreadStack\x12&\n" + - "\x0ecodeSignatures\x18\x01 \x03(\tR\x0ecodeSignatures\"u\n" + - "\x17ProfileTaskFinishReport\x12\x18\n" + - "\aservice\x18\x01 \x01(\tR\aservice\x12(\n" + - "\x0fserviceInstance\x18\x02 \x01(\tR\x0fserviceInstance\x12\x16\n" + - "\x06taskId\x18\x03 \x01(\tR\x06taskId\"Y\n" + - "\rGoProfileData\x12\x16\n" + - "\x06taskId\x18\x01 \x01(\tR\x06taskId\x12\x18\n" + - "\apayload\x18\x02 \x01(\fR\apayload\x12\x16\n" + - "\x06isLast\x18\x03 \x01(\bR\x06isLast2\xde\x02\n" + - "\vProfileTask\x12[\n" + - "\x16getProfileTaskCommands\x12&.skywalking.v3.ProfileTaskCommandQuery\x1a\x17.skywalking.v3.Commands\"\x00\x12M\n" + - "\x0fcollectSnapshot\x12\x1d.skywalking.v3.ThreadSnapshot\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12L\n" + - "\x0fgoProfileReport\x12\x1c.skywalking.v3.GoProfileData\x1a\x17.skywalking.v3.Commands\"\x00(\x01\x12U\n" + - "\x10reportTaskFinish\x12&.skywalking.v3.ProfileTaskFinishReport\x1a\x17.skywalking.v3.Commands\"\x00B\x97\x01\n" + - "5org.apache.skywalking.apm.network.language.profile.v3P\x01Z 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/go.mod b/go.mod index 07455a3..48e18d7 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,16 @@ module skywalking.apache.org/repo/goapi go 1.24 require ( + github.com/99designs/gqlgen v0.17.73 + github.com/vektah/gqlparser/v2 v2.5.26 google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 ) require ( + github.com/agnivade/levenshtein v1.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/sosodev/duration v1.3.1 // 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 diff --git a/go.sum b/go.sum index 4c7396c..2605549 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,15 @@ +github.com/99designs/gqlgen v0.17.73 h1:A3Ki+rHWqKbAOlg5fxiZBnz6OjW3nwupDHEG15gEsrg= +github.com/99designs/gqlgen v0.17.73/go.mod h1:2RyGWjy2k7W9jxrs8MOQthXGkD3L3oGr0jXW3Pu8lGg= +github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM= +github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo= +github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -8,6 +20,16 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 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= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/vektah/gqlparser/v2 v2.5.26 h1:REqqFkO8+SOEgZHR/eHScjjVjGS8Nk3RMO/juiTobN4= +github.com/vektah/gqlparser/v2 v2.5.26/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo= 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.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= @@ -32,3 +54,5 @@ 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= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 74d0895779cf7cbe6f3ed84c0e4f6c6ab375ddf9 Mon Sep 17 00:00:00 2001 From: cqhasy <3181940782@qq.com> Date: Sun, 31 Aug 2025 15:21:04 +0800 Subject: [PATCH 9/9] Update dependencies to match go mod tidy --- go.mod | 5 ----- go.sum | 24 ------------------------ 2 files changed, 29 deletions(-) diff --git a/go.mod b/go.mod index 48e18d7..07455a3 100644 --- a/go.mod +++ b/go.mod @@ -3,16 +3,11 @@ module skywalking.apache.org/repo/goapi go 1.24 require ( - github.com/99designs/gqlgen v0.17.73 - github.com/vektah/gqlparser/v2 v2.5.26 google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 ) require ( - github.com/agnivade/levenshtein v1.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/sosodev/duration v1.3.1 // 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 diff --git a/go.sum b/go.sum index 2605549..4c7396c 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,3 @@ -github.com/99designs/gqlgen v0.17.73 h1:A3Ki+rHWqKbAOlg5fxiZBnz6OjW3nwupDHEG15gEsrg= -github.com/99designs/gqlgen v0.17.73/go.mod h1:2RyGWjy2k7W9jxrs8MOQthXGkD3L3oGr0jXW3Pu8lGg= -github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM= -github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo= -github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -20,16 +8,6 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 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= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= -github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/vektah/gqlparser/v2 v2.5.26 h1:REqqFkO8+SOEgZHR/eHScjjVjGS8Nk3RMO/juiTobN4= -github.com/vektah/gqlparser/v2 v2.5.26/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo= 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.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= @@ -54,5 +32,3 @@ 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= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=