From c5e479d8567187a8897464b18c6c0afa19b50056 Mon Sep 17 00:00:00 2001 From: Alberto Soto Date: Tue, 26 Nov 2024 09:02:04 +0100 Subject: [PATCH] feat(PoC): export profile metrics at compaction time --- api/gen/proto/go/query/v1/query.pb.go | 607 +++++++--- api/gen/proto/go/query/v1/query_vtproto.pb.go | 1024 ++++++++++++++++- api/openapiv2/gen/phlare.swagger.json | 51 +- api/query/v1/query.proto | 17 + pkg/distributor/distributor.go | 165 +++ pkg/experiment/compactor/compaction_worker.go | 82 +- pkg/experiment/compactor/exporter.go | 87 ++ pkg/experiment/query_backend/query_metrics.go | 238 ++++ .../query_backend/query_profile_entry.go | 8 +- 9 files changed, 2034 insertions(+), 245 deletions(-) create mode 100644 pkg/experiment/compactor/exporter.go create mode 100644 pkg/experiment/query_backend/query_metrics.go diff --git a/api/gen/proto/go/query/v1/query.pb.go b/api/gen/proto/go/query/v1/query.pb.go index 26ed1e64a4..03a1923dd6 100644 --- a/api/gen/proto/go/query/v1/query.pb.go +++ b/api/gen/proto/go/query/v1/query.pb.go @@ -33,6 +33,7 @@ const ( QueryType_QUERY_TIME_SERIES QueryType = 4 QueryType_QUERY_TREE QueryType = 5 QueryType_QUERY_PPROF QueryType = 6 + QueryType_QUERY_METRICS QueryType = 7 ) // Enum value maps for QueryType. @@ -45,6 +46,7 @@ var ( 4: "QUERY_TIME_SERIES", 5: "QUERY_TREE", 6: "QUERY_PPROF", + 7: "QUERY_METRICS", } QueryType_value = map[string]int32{ "QUERY_UNSPECIFIED": 0, @@ -54,6 +56,7 @@ var ( "QUERY_TIME_SERIES": 4, "QUERY_TREE": 5, "QUERY_PPROF": 6, + "QUERY_METRICS": 7, } ) @@ -94,6 +97,7 @@ const ( ReportType_REPORT_TIME_SERIES ReportType = 4 ReportType_REPORT_TREE ReportType = 5 ReportType_REPORT_PPROF ReportType = 6 + ReportType_REPORT_METRICS ReportType = 7 ) // Enum value maps for ReportType. @@ -106,6 +110,7 @@ var ( 4: "REPORT_TIME_SERIES", 5: "REPORT_TREE", 6: "REPORT_PPROF", + 7: "REPORT_METRICS", } ReportType_value = map[string]int32{ "REPORT_UNSPECIFIED": 0, @@ -115,6 +120,7 @@ var ( "REPORT_TIME_SERIES": 4, "REPORT_TREE": 5, "REPORT_PPROF": 6, + "REPORT_METRICS": 7, } ) @@ -574,6 +580,7 @@ type Query struct { TimeSeries *TimeSeriesQuery `protobuf:"bytes,5,opt,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` Tree *TreeQuery `protobuf:"bytes,6,opt,name=tree,proto3" json:"tree,omitempty"` Pprof *PprofQuery `protobuf:"bytes,7,opt,name=pprof,proto3" json:"pprof,omitempty"` + Metrics *MetricsQuery `protobuf:"bytes,8,opt,name=metrics,proto3" json:"metrics,omitempty"` } func (x *Query) Reset() { @@ -657,6 +664,13 @@ func (x *Query) GetPprof() *PprofQuery { return nil } +func (x *Query) GetMetrics() *MetricsQuery { + if x != nil { + return x.Metrics + } + return nil +} + type InvokeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -774,6 +788,7 @@ type Report struct { TimeSeries *TimeSeriesReport `protobuf:"bytes,5,opt,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` Tree *TreeReport `protobuf:"bytes,6,opt,name=tree,proto3" json:"tree,omitempty"` Pprof *PprofReport `protobuf:"bytes,7,opt,name=pprof,proto3" json:"pprof,omitempty"` + Metrics *MetricsReport `protobuf:"bytes,8,opt,name=metrics,proto3" json:"metrics,omitempty"` } func (x *Report) Reset() { @@ -857,6 +872,13 @@ func (x *Report) GetPprof() *PprofReport { return nil } +func (x *Report) GetMetrics() *MetricsReport { + if x != nil { + return x.Metrics + } + return nil +} + type LabelNamesQuery struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1484,6 +1506,155 @@ func (x *PprofReport) GetPprof() []byte { return nil } +type MetricsQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FunctionsByServiceName map[string]*FunctionList `protobuf:"bytes,1,rep,name=functionsByServiceName,proto3" json:"functionsByServiceName,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MetricsQuery) Reset() { + *x = MetricsQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_query_v1_query_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricsQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricsQuery) ProtoMessage() {} + +func (x *MetricsQuery) ProtoReflect() protoreflect.Message { + mi := &file_query_v1_query_proto_msgTypes[22] + 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 MetricsQuery.ProtoReflect.Descriptor instead. +func (*MetricsQuery) Descriptor() ([]byte, []int) { + return file_query_v1_query_proto_rawDescGZIP(), []int{22} +} + +func (x *MetricsQuery) GetFunctionsByServiceName() map[string]*FunctionList { + if x != nil { + return x.FunctionsByServiceName + } + return nil +} + +type MetricsReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query *MetricsQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + TimeSeries []*v11.Series `protobuf:"bytes,2,rep,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` +} + +func (x *MetricsReport) Reset() { + *x = MetricsReport{} + if protoimpl.UnsafeEnabled { + mi := &file_query_v1_query_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricsReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricsReport) ProtoMessage() {} + +func (x *MetricsReport) ProtoReflect() protoreflect.Message { + mi := &file_query_v1_query_proto_msgTypes[23] + 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 MetricsReport.ProtoReflect.Descriptor instead. +func (*MetricsReport) Descriptor() ([]byte, []int) { + return file_query_v1_query_proto_rawDescGZIP(), []int{23} +} + +func (x *MetricsReport) GetQuery() *MetricsQuery { + if x != nil { + return x.Query + } + return nil +} + +func (x *MetricsReport) GetTimeSeries() []*v11.Series { + if x != nil { + return x.TimeSeries + } + return nil +} + +type FunctionList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Functions []string `protobuf:"bytes,1,rep,name=functions,proto3" json:"functions,omitempty"` +} + +func (x *FunctionList) Reset() { + *x = FunctionList{} + if protoimpl.UnsafeEnabled { + mi := &file_query_v1_query_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FunctionList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FunctionList) ProtoMessage() {} + +func (x *FunctionList) ProtoReflect() protoreflect.Message { + mi := &file_query_v1_query_proto_msgTypes[24] + 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 FunctionList.ProtoReflect.Descriptor instead. +func (*FunctionList) Descriptor() ([]byte, []int) { + return file_query_v1_query_proto_rawDescGZIP(), []int{24} +} + +func (x *FunctionList) GetFunctions() []string { + if x != nil { + return x.Functions + } + return nil +} + var File_query_v1_query_proto protoreflect.FileDescriptor var file_query_v1_query_proto_rawDesc = []byte{ @@ -1541,7 +1712,7 @@ var file_query_v1_query_proto_rawDesc = []byte{ 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, - 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x22, 0x89, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x22, 0xbb, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x32, 0x0a, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, @@ -1566,150 +1737,182 @@ var file_query_v1_query_proto_rawDesc = []byte{ 0x79, 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x70, 0x70, - 0x72, 0x6f, 0x66, 0x22, 0x75, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x0b, 0x64, - 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x41, 0x0a, 0x0b, 0x44, 0x69, - 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, - 0x61, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x22, 0x93, 0x03, - 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0c, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x0d, - 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, - 0x3b, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x04, - 0x74, 0x72, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x70, 0x70, - 0x72, 0x6f, 0x66, 0x22, 0x11, 0x0a, 0x0f, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x64, 0x0a, 0x10, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x10, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, - 0x68, 0x0a, 0x11, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x34, 0x0a, 0x11, 0x53, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1f, - 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, - 0x7e, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, + 0x72, 0x6f, 0x66, 0x12, 0x30, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x75, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, + 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x41, 0x0a, 0x0b, + 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x6e, 0x22, + 0xc6, 0x03, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x14, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3e, + 0x0a, 0x0c, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x35, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, - 0x56, 0x0a, 0x0f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, - 0x62, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x76, 0x0a, 0x10, 0x54, 0x69, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x0b, - 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, - 0x28, 0x0a, 0x09, 0x54, 0x72, 0x65, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, 0x0a, 0x09, - 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x4b, 0x0a, 0x0a, 0x54, 0x72, 0x65, - 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x0a, 0x50, 0x70, 0x72, 0x6f, 0x66, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x6f, 0x64, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x53, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, - 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, - 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, - 0x52, 0x12, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x73, 0x74, 0x61, 0x63, - 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x22, 0x4f, 0x0a, 0x0b, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, - 0x2a, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, - 0x70, 0x72, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x70, 0x72, 0x6f, - 0x66, 0x2a, 0xa2, 0x01, 0x0a, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x15, 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, - 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, - 0x12, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x56, 0x41, 0x4c, - 0x55, 0x45, 0x53, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x53, - 0x45, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x53, 0x10, 0x03, 0x12, 0x15, - 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x53, 0x45, 0x52, - 0x49, 0x45, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x54, - 0x52, 0x45, 0x45, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x50, - 0x50, 0x52, 0x4f, 0x46, 0x10, 0x06, 0x2a, 0xaa, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, - 0x12, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, - 0x4d, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, - 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x10, 0x02, 0x12, 0x18, - 0x0a, 0x14, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x5f, - 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x53, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x50, 0x4f, - 0x52, 0x54, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x10, 0x04, - 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x10, - 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x50, 0x52, 0x4f, - 0x46, 0x10, 0x06, 0x32, 0x52, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x54, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, - 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x18, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, - 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x9b, 0x01, - 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, - 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x51, - 0x58, 0x58, 0xaa, 0x02, 0x08, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x41, + 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x28, + 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x70, 0x72, 0x6f, + 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x05, + 0x70, 0x70, 0x72, 0x6f, 0x66, 0x12, 0x31, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x64, 0x0a, 0x10, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, + 0x2f, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x22, 0x31, 0x0a, 0x10, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x68, 0x0a, 0x11, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x34, + 0x0a, 0x11, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x22, 0x7e, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x35, 0x0a, + 0x0d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x22, 0x56, 0x0a, 0x0f, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x76, 0x0a, 0x10, + 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x2f, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x09, 0x54, 0x72, 0x65, 0x65, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x4b, + 0x0a, 0x0a, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x0a, + 0x50, 0x70, 0x72, 0x6f, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, + 0x78, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, + 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x12, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, + 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x4f, 0x0a, 0x0b, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x70, 0x72, 0x6f, 0x66, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x22, 0xdd, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x6a, 0x0a, 0x16, 0x66, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x16, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x1a, 0x61, 0x0a, 0x1b, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x42, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x46, + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x70, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, + 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0xb5, 0x01, 0x0a, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x51, + 0x55, 0x45, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, + 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x42, 0x45, + 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, + 0x53, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x54, 0x49, 0x4d, + 0x45, 0x5f, 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x5f, 0x50, 0x50, 0x52, 0x4f, 0x46, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x51, + 0x55, 0x45, 0x52, 0x59, 0x5f, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x53, 0x10, 0x07, 0x2a, 0xbe, + 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, + 0x12, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, + 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, + 0x13, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x56, 0x41, + 0x4c, 0x55, 0x45, 0x53, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, + 0x5f, 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x53, 0x10, 0x03, + 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x5f, + 0x53, 0x45, 0x52, 0x49, 0x45, 0x53, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, 0x4f, + 0x52, 0x54, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x50, + 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x50, 0x52, 0x4f, 0x46, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x52, + 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x53, 0x10, 0x07, 0x32, + 0x52, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x32, 0x54, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x49, 0x6e, + 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x9b, 0x01, 0x0a, 0x0c, 0x63, 0x6f, + 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, + 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, + 0x3b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x51, 0x58, 0x58, 0xaa, 0x02, + 0x08, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1725,7 +1928,7 @@ func file_query_v1_query_proto_rawDescGZIP() []byte { } var file_query_v1_query_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_query_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_query_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_query_v1_query_proto_goTypes = []any{ (QueryType)(0), // 0: query.v1.QueryType (ReportType)(0), // 1: query.v1.ReportType @@ -1752,10 +1955,14 @@ var file_query_v1_query_proto_goTypes = []any{ (*TreeReport)(nil), // 22: query.v1.TreeReport (*PprofQuery)(nil), // 23: query.v1.PprofQuery (*PprofReport)(nil), // 24: query.v1.PprofReport - (*v1.BlockMeta)(nil), // 25: metastore.v1.BlockMeta - (*v11.Labels)(nil), // 26: types.v1.Labels - (*v11.Series)(nil), // 27: types.v1.Series - (*v11.StackTraceSelector)(nil), // 28: types.v1.StackTraceSelector + (*MetricsQuery)(nil), // 25: query.v1.MetricsQuery + (*MetricsReport)(nil), // 26: query.v1.MetricsReport + (*FunctionList)(nil), // 27: query.v1.FunctionList + nil, // 28: query.v1.MetricsQuery.FunctionsByServiceNameEntry + (*v1.BlockMeta)(nil), // 29: metastore.v1.BlockMeta + (*v11.Labels)(nil), // 30: types.v1.Labels + (*v11.Series)(nil), // 31: types.v1.Series + (*v11.StackTraceSelector)(nil), // 32: types.v1.StackTraceSelector } var file_query_v1_query_proto_depIdxs = []int32{ 9, // 0: query.v1.QueryRequest.query:type_name -> query.v1.Query @@ -1766,7 +1973,7 @@ var file_query_v1_query_proto_depIdxs = []int32{ 8, // 5: query.v1.QueryPlan.root:type_name -> query.v1.QueryNode 2, // 6: query.v1.QueryNode.type:type_name -> query.v1.QueryNode.Type 8, // 7: query.v1.QueryNode.children:type_name -> query.v1.QueryNode - 25, // 8: query.v1.QueryNode.blocks:type_name -> metastore.v1.BlockMeta + 29, // 8: query.v1.QueryNode.blocks:type_name -> metastore.v1.BlockMeta 0, // 9: query.v1.Query.query_type:type_name -> query.v1.QueryType 13, // 10: query.v1.Query.label_names:type_name -> query.v1.LabelNamesQuery 15, // 11: query.v1.Query.label_values:type_name -> query.v1.LabelValuesQuery @@ -1774,34 +1981,40 @@ var file_query_v1_query_proto_depIdxs = []int32{ 19, // 13: query.v1.Query.time_series:type_name -> query.v1.TimeSeriesQuery 21, // 14: query.v1.Query.tree:type_name -> query.v1.TreeQuery 23, // 15: query.v1.Query.pprof:type_name -> query.v1.PprofQuery - 12, // 16: query.v1.InvokeResponse.reports:type_name -> query.v1.Report - 11, // 17: query.v1.InvokeResponse.diagnostics:type_name -> query.v1.Diagnostics - 7, // 18: query.v1.Diagnostics.query_plan:type_name -> query.v1.QueryPlan - 1, // 19: query.v1.Report.report_type:type_name -> query.v1.ReportType - 14, // 20: query.v1.Report.label_names:type_name -> query.v1.LabelNamesReport - 16, // 21: query.v1.Report.label_values:type_name -> query.v1.LabelValuesReport - 18, // 22: query.v1.Report.series_labels:type_name -> query.v1.SeriesLabelsReport - 20, // 23: query.v1.Report.time_series:type_name -> query.v1.TimeSeriesReport - 22, // 24: query.v1.Report.tree:type_name -> query.v1.TreeReport - 24, // 25: query.v1.Report.pprof:type_name -> query.v1.PprofReport - 13, // 26: query.v1.LabelNamesReport.query:type_name -> query.v1.LabelNamesQuery - 15, // 27: query.v1.LabelValuesReport.query:type_name -> query.v1.LabelValuesQuery - 17, // 28: query.v1.SeriesLabelsReport.query:type_name -> query.v1.SeriesLabelsQuery - 26, // 29: query.v1.SeriesLabelsReport.series_labels:type_name -> types.v1.Labels - 19, // 30: query.v1.TimeSeriesReport.query:type_name -> query.v1.TimeSeriesQuery - 27, // 31: query.v1.TimeSeriesReport.time_series:type_name -> types.v1.Series - 21, // 32: query.v1.TreeReport.query:type_name -> query.v1.TreeQuery - 28, // 33: query.v1.PprofQuery.stack_trace_selector:type_name -> types.v1.StackTraceSelector - 23, // 34: query.v1.PprofReport.query:type_name -> query.v1.PprofQuery - 3, // 35: query.v1.QueryFrontendService.Query:input_type -> query.v1.QueryRequest - 6, // 36: query.v1.QueryBackendService.Invoke:input_type -> query.v1.InvokeRequest - 4, // 37: query.v1.QueryFrontendService.Query:output_type -> query.v1.QueryResponse - 10, // 38: query.v1.QueryBackendService.Invoke:output_type -> query.v1.InvokeResponse - 37, // [37:39] is the sub-list for method output_type - 35, // [35:37] is the sub-list for method input_type - 35, // [35:35] is the sub-list for extension type_name - 35, // [35:35] is the sub-list for extension extendee - 0, // [0:35] is the sub-list for field type_name + 25, // 16: query.v1.Query.metrics:type_name -> query.v1.MetricsQuery + 12, // 17: query.v1.InvokeResponse.reports:type_name -> query.v1.Report + 11, // 18: query.v1.InvokeResponse.diagnostics:type_name -> query.v1.Diagnostics + 7, // 19: query.v1.Diagnostics.query_plan:type_name -> query.v1.QueryPlan + 1, // 20: query.v1.Report.report_type:type_name -> query.v1.ReportType + 14, // 21: query.v1.Report.label_names:type_name -> query.v1.LabelNamesReport + 16, // 22: query.v1.Report.label_values:type_name -> query.v1.LabelValuesReport + 18, // 23: query.v1.Report.series_labels:type_name -> query.v1.SeriesLabelsReport + 20, // 24: query.v1.Report.time_series:type_name -> query.v1.TimeSeriesReport + 22, // 25: query.v1.Report.tree:type_name -> query.v1.TreeReport + 24, // 26: query.v1.Report.pprof:type_name -> query.v1.PprofReport + 26, // 27: query.v1.Report.metrics:type_name -> query.v1.MetricsReport + 13, // 28: query.v1.LabelNamesReport.query:type_name -> query.v1.LabelNamesQuery + 15, // 29: query.v1.LabelValuesReport.query:type_name -> query.v1.LabelValuesQuery + 17, // 30: query.v1.SeriesLabelsReport.query:type_name -> query.v1.SeriesLabelsQuery + 30, // 31: query.v1.SeriesLabelsReport.series_labels:type_name -> types.v1.Labels + 19, // 32: query.v1.TimeSeriesReport.query:type_name -> query.v1.TimeSeriesQuery + 31, // 33: query.v1.TimeSeriesReport.time_series:type_name -> types.v1.Series + 21, // 34: query.v1.TreeReport.query:type_name -> query.v1.TreeQuery + 32, // 35: query.v1.PprofQuery.stack_trace_selector:type_name -> types.v1.StackTraceSelector + 23, // 36: query.v1.PprofReport.query:type_name -> query.v1.PprofQuery + 28, // 37: query.v1.MetricsQuery.functionsByServiceName:type_name -> query.v1.MetricsQuery.FunctionsByServiceNameEntry + 25, // 38: query.v1.MetricsReport.query:type_name -> query.v1.MetricsQuery + 31, // 39: query.v1.MetricsReport.time_series:type_name -> types.v1.Series + 27, // 40: query.v1.MetricsQuery.FunctionsByServiceNameEntry.value:type_name -> query.v1.FunctionList + 3, // 41: query.v1.QueryFrontendService.Query:input_type -> query.v1.QueryRequest + 6, // 42: query.v1.QueryBackendService.Invoke:input_type -> query.v1.InvokeRequest + 4, // 43: query.v1.QueryFrontendService.Query:output_type -> query.v1.QueryResponse + 10, // 44: query.v1.QueryBackendService.Invoke:output_type -> query.v1.InvokeResponse + 43, // [43:45] is the sub-list for method output_type + 41, // [41:43] is the sub-list for method input_type + 41, // [41:41] is the sub-list for extension type_name + 41, // [41:41] is the sub-list for extension extendee + 0, // [0:41] is the sub-list for field type_name } func init() { file_query_v1_query_proto_init() } @@ -2074,6 +2287,42 @@ func file_query_v1_query_proto_init() { return nil } } + file_query_v1_query_proto_msgTypes[22].Exporter = func(v any, i int) any { + switch v := v.(*MetricsQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_query_v1_query_proto_msgTypes[23].Exporter = func(v any, i int) any { + switch v := v.(*MetricsReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_query_v1_query_proto_msgTypes[24].Exporter = func(v any, i int) any { + switch v := v.(*FunctionList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_query_v1_query_proto_msgTypes[20].OneofWrappers = []any{} type x struct{} @@ -2082,7 +2331,7 @@ func file_query_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_query_v1_query_proto_rawDesc, NumEnums: 3, - NumMessages: 22, + NumMessages: 26, NumExtensions: 0, NumServices: 2, }, diff --git a/api/gen/proto/go/query/v1/query_vtproto.pb.go b/api/gen/proto/go/query/v1/query_vtproto.pb.go index e87f49c619..02bf57d504 100644 --- a/api/gen/proto/go/query/v1/query_vtproto.pb.go +++ b/api/gen/proto/go/query/v1/query_vtproto.pb.go @@ -189,6 +189,7 @@ func (m *Query) CloneVT() *Query { r.TimeSeries = m.TimeSeries.CloneVT() r.Tree = m.Tree.CloneVT() r.Pprof = m.Pprof.CloneVT() + r.Metrics = m.Metrics.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -253,6 +254,7 @@ func (m *Report) CloneVT() *Report { r.TimeSeries = m.TimeSeries.CloneVT() r.Tree = m.Tree.CloneVT() r.Pprof = m.Pprof.CloneVT() + r.Metrics = m.Metrics.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -528,6 +530,78 @@ func (m *PprofReport) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *MetricsQuery) CloneVT() *MetricsQuery { + if m == nil { + return (*MetricsQuery)(nil) + } + r := new(MetricsQuery) + if rhs := m.FunctionsByServiceName; rhs != nil { + tmpContainer := make(map[string]*FunctionList, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.FunctionsByServiceName = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MetricsQuery) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MetricsReport) CloneVT() *MetricsReport { + if m == nil { + return (*MetricsReport)(nil) + } + r := new(MetricsReport) + r.Query = m.Query.CloneVT() + if rhs := m.TimeSeries; rhs != nil { + tmpContainer := make([]*v11.Series, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *v11.Series }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*v11.Series) + } + } + r.TimeSeries = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MetricsReport) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *FunctionList) CloneVT() *FunctionList { + if m == nil { + return (*FunctionList)(nil) + } + r := new(FunctionList) + if rhs := m.Functions; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Functions = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *FunctionList) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *QueryRequest) EqualVT(that *QueryRequest) bool { if this == that { return true @@ -779,6 +853,9 @@ func (this *Query) EqualVT(that *Query) bool { if !this.Pprof.EqualVT(that.Pprof) { return false } + if !this.Metrics.EqualVT(that.Metrics) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -871,6 +948,9 @@ func (this *Report) EqualVT(that *Report) bool { if !this.Pprof.EqualVT(that.Pprof) { return false } + if !this.Metrics.EqualVT(that.Metrics) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1199,6 +1279,107 @@ func (this *PprofReport) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *MetricsQuery) EqualVT(that *MetricsQuery) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.FunctionsByServiceName) != len(that.FunctionsByServiceName) { + return false + } + for i, vx := range this.FunctionsByServiceName { + vy, ok := that.FunctionsByServiceName[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &FunctionList{} + } + if q == nil { + q = &FunctionList{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *MetricsQuery) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricsQuery) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MetricsReport) EqualVT(that *MetricsReport) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Query.EqualVT(that.Query) { + return false + } + if len(this.TimeSeries) != len(that.TimeSeries) { + return false + } + for i, vx := range this.TimeSeries { + vy := that.TimeSeries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &v11.Series{} + } + if q == nil { + q = &v11.Series{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*v11.Series) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *MetricsReport) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MetricsReport) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *FunctionList) EqualVT(that *FunctionList) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Functions) != len(that.Functions) { + return false + } + for i, vx := range this.Functions { + vy := that.Functions[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *FunctionList) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*FunctionList) + if !ok { + return false + } + return this.EqualVT(that) +} // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -1755,6 +1936,16 @@ func (m *Query) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Metrics != nil { + size, err := m.Metrics.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } if m.Pprof != nil { size, err := m.Pprof.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -1951,6 +2142,16 @@ func (m *Report) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Metrics != nil { + size, err := m.Metrics.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } if m.Pprof != nil { size, err := m.Pprof.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -2623,79 +2824,243 @@ func (m *PprofReport) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryRequest) SizeVT() (n int) { +func (m *MetricsQuery) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - if m.StartTime != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTime)) - } - if m.EndTime != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTime)) - } - l = len(m.LabelSelector) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return nil, nil } - if len(m.Query) > 0 { - for _, e := range m.Query { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *QueryResponse) SizeVT() (n int) { +func (m *MetricsQuery) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricsQuery) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if len(m.Reports) > 0 { - for _, e := range m.Reports { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.FunctionsByServiceName) > 0 { + for k := range m.FunctionsByServiceName { + v := m.FunctionsByServiceName[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *InvokeOptions) SizeVT() (n int) { +func (m *MetricsReport) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - n += len(m.unknownFields) - return n + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *InvokeRequest) SizeVT() (n int) { +func (m *MetricsReport) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MetricsReport) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if len(m.Tenant) > 0 { - for _, s := range m.Tenant { - l = len(s) - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - } - if m.StartTime != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTime)) - } - if m.EndTime != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTime)) - } - l = len(m.LabelSelector) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.TimeSeries) > 0 { + for iNdEx := len(m.TimeSeries) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.TimeSeries[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.TimeSeries[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Query != nil { + size, err := m.Query.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FunctionList) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FunctionList) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *FunctionList) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Functions) > 0 { + for iNdEx := len(m.Functions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Functions[iNdEx]) + copy(dAtA[i:], m.Functions[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Functions[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTime)) + } + if m.EndTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTime)) + } + l = len(m.LabelSelector) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Query) > 0 { + for _, e := range m.Query { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *QueryResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Reports) > 0 { + for _, e := range m.Reports { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *InvokeOptions) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *InvokeRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Tenant) > 0 { + for _, s := range m.Tenant { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.StartTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartTime)) + } + if m.EndTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndTime)) + } + l = len(m.LabelSelector) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Query) > 0 { for _, e := range m.Query { @@ -2793,6 +3158,10 @@ func (m *Query) SizeVT() (n int) { l = m.Pprof.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Metrics != nil { + l = m.Metrics.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -2864,6 +3233,10 @@ func (m *Report) SizeVT() (n int) { l = m.Pprof.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Metrics != nil { + l = m.Metrics.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -3094,6 +3467,71 @@ func (m *PprofReport) SizeVT() (n int) { return n } +func (m *MetricsQuery) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FunctionsByServiceName) > 0 { + for k, v := range m.FunctionsByServiceName { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *MetricsReport) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Query != nil { + l = m.Query.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.TimeSeries) > 0 { + for _, e := range m.TimeSeries { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *FunctionList) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Functions) > 0 { + for _, s := range m.Functions { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *QueryRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4141,6 +4579,42 @@ func (m *Query) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metrics == nil { + m.Metrics = &MetricsQuery{} + } + if err := m.Metrics.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -4635,17 +5109,53 @@ func (m *Report) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metrics == nil { + m.Metrics = &MetricsReport{} + } + if err := m.Metrics.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy @@ -5909,3 +6419,395 @@ func (m *PprofReport) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *MetricsQuery) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricsQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricsQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunctionsByServiceName", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FunctionsByServiceName == nil { + m.FunctionsByServiceName = make(map[string]*FunctionList) + } + var mapkey string + var mapvalue *FunctionList + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &FunctionList{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.FunctionsByServiceName[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MetricsReport) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricsReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricsReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Query == nil { + m.Query = &MetricsQuery{} + } + if err := m.Query.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeSeries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TimeSeries = append(m.TimeSeries, &v11.Series{}) + if unmarshal, ok := interface{}(m.TimeSeries[len(m.TimeSeries)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.TimeSeries[len(m.TimeSeries)-1]); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FunctionList) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FunctionList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FunctionList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Functions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Functions = append(m.Functions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/api/openapiv2/gen/phlare.swagger.json b/api/openapiv2/gen/phlare.swagger.json index c67c7cd4e1..80d2d5e31c 100644 --- a/api/openapiv2/gen/phlare.swagger.json +++ b/api/openapiv2/gen/phlare.swagger.json @@ -951,6 +951,17 @@ } } }, + "v1FunctionList": { + "type": "object", + "properties": { + "functions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "v1GetBlockStatsResponse": { "type": "object", "properties": { @@ -1435,6 +1446,32 @@ } } }, + "v1MetricsQuery": { + "type": "object", + "properties": { + "functionsByServiceName": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1FunctionList" + } + } + } + }, + "v1MetricsReport": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/v1MetricsQuery" + }, + "timeSeries": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Series" + } + } + } + }, "v1Point": { "type": "object", "properties": { @@ -1568,7 +1605,10 @@ "$ref": "#/definitions/v1TreeQuery" }, "pprof": { - "$ref": "#/definitions/v1PprofQuery", + "$ref": "#/definitions/v1PprofQuery" + }, + "metrics": { + "$ref": "#/definitions/v1MetricsQuery", "description": "function_details\n call_graph\n top_table\n ..." } } @@ -1704,7 +1744,8 @@ "QUERY_SERIES_LABELS", "QUERY_TIME_SERIES", "QUERY_TREE", - "QUERY_PPROF" + "QUERY_PPROF", + "QUERY_METRICS" ], "default": "QUERY_UNSPECIFIED" }, @@ -1769,6 +1810,9 @@ }, "pprof": { "$ref": "#/definitions/v1PprofReport" + }, + "metrics": { + "$ref": "#/definitions/v1MetricsReport" } } }, @@ -1781,7 +1825,8 @@ "REPORT_SERIES_LABELS", "REPORT_TIME_SERIES", "REPORT_TREE", - "REPORT_PPROF" + "REPORT_PPROF", + "REPORT_METRICS" ], "default": "REPORT_UNSPECIFIED" }, diff --git a/api/query/v1/query.proto b/api/query/v1/query.proto index dc5e34ef46..79161d1cc3 100644 --- a/api/query/v1/query.proto +++ b/api/query/v1/query.proto @@ -83,6 +83,7 @@ message Query { TimeSeriesQuery time_series = 5; TreeQuery tree = 6; PprofQuery pprof = 7; + MetricsQuery metrics = 8; // function_details // call_graph // top_table @@ -97,6 +98,7 @@ enum QueryType { QUERY_TIME_SERIES = 4; QUERY_TREE = 5; QUERY_PPROF = 6; + QUERY_METRICS = 7; } message InvokeResponse { @@ -119,6 +121,7 @@ message Report { TimeSeriesReport time_series = 5; TreeReport tree = 6; PprofReport pprof = 7; + MetricsReport metrics = 8; } enum ReportType { @@ -129,6 +132,7 @@ enum ReportType { REPORT_TIME_SERIES = 4; REPORT_TREE = 5; REPORT_PPROF = 6; + REPORT_METRICS = 7; } message LabelNamesQuery {} @@ -186,3 +190,16 @@ message PprofReport { PprofQuery query = 1; bytes pprof = 2; } + +message MetricsQuery { + map functionsByServiceName = 1; +} + +message MetricsReport { + MetricsQuery query = 1; + repeated types.v1.Series time_series = 2; +} + +message FunctionList { + repeated string functions = 1; +} \ No newline at end of file diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 4a60766ba8..b8bb0cb449 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.go @@ -9,7 +9,9 @@ import ( "fmt" "hash/fnv" "net/http" + slices2 "slices" "sort" + "strconv" "sync" "time" @@ -341,10 +343,152 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push } } + //var requestId = uuid.New() if req.TotalProfiles == 0 { return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("no profiles received")) } + for _, series := range req.Series { + if series.Labels[7].Value != "ride-sharing-app" || series.Labels[5].Value != "ap-south" { + continue + } + if len(series.Samples) > 1 { + _ = level.Error(d.logger).Log("msg", "Multiple samples!!!!") + continue + } + var dict = series.Samples[0].Profile.Profile.StringTable + level.Info(d.logger).Log("msg", "New samples lets goooo") + var profile = series.Samples[0].Profile.Profile + for num, sample := range profile.Sample { + var stacktraces string + for _, locationId := range sample.LocationId { + var location = profile.Location[locationId-1] + var stacktrace string + for _, line := range location.Line { + var function = profile.Function[line.FunctionId-1] + stacktrace += dict[function.Name] + ", " + dict[function.Filename] + " (" + strconv.FormatInt(function.StartLine, 10) + ")\n" + } + stacktraces += stacktrace + "\n\n" + } + var labels []LabelPair + for _, label := range sample.Label { + labels = append(labels, LabelPair{ + Name: dict[label.Key], + Value: dict[label.Str], + }) + } + + var period = strconv.FormatInt(profile.Period, 10) + " " + dict[profile.PeriodType.Type] + " " + dict[profile.PeriodType.Unit] + + var values string + for i, value := range sample.Value { + values += strconv.FormatInt(value, 10) + " " + dict[profile.SampleType[i].Unit] + " (" + dict[profile.SampleType[i].Type] + "), " + } + level.Info(d.logger).Log("msg", "", + "sample", num, + "labels", stringify(labels), + "stactrace", stacktraces, + "period", period, + "timeNanos", time.Unix(profile.TimeNanos/1000000000, 0), + "duration", profile.DurationNanos/1000000000.0, + "values", values, + ) + + } + // 8->9 (14) protobuf.go > varint + // 10->9 (27) protobuf.go > uint64 + // 11->9 (60) protobuf.go > int64 + // 12->9 (65) protobuf.go > int64Opt + // 13->14 (514) proto.go > emitLocation + // req.Series[0].Labels[7].Value == "ride-sharing-app" + // len(req.Series[0].Samples[0].Profile.Profile.Location[0].Line) > 2 + //var seriesId = uuid.New() + /* req.Series[0].Samples[0].Profile.Period != 524288 && req.Series[0].Samples[0].Profile.Period != 10000000 && req.Series[0].Samples[0].Profile.Period != 1 + var found = false + for _, label := range series.Labels { + if label.Name == phlaremodel.LabelNameServiceName && label.Value == "ride-sharing-app" { + found = true + } + } + if !found { + continue + } + println("Request ---------------------------------------------------------------")*/ + /*var globalLabels []LabelPair + for _, label := range series.Labels { + globalLabels = append(globalLabels, LabelPair{ + Name: label.Name, + Value: label.Value, + }) + } + slices2.SortFunc(globalLabels, func(a, b LabelPair) int { + if a.Name < b.Name { + return -1 + } else if a.Name > b.Name { + return 1 + } + return 0 + }) + for _, sample := range series.Samples { + for _, sample2 := range sample.Profile.Profile.Sample { + var labels []LabelPair + for _, label := range sample2.Label { + labelId := label.Key + labelValue := label.Str + labels = append(labels, LabelPair{ + Name: sample.Profile.Profile.StringTable[labelId], + Value: sample.Profile.Profile.StringTable[labelValue], + }) + } + + fmt.Print("requestId=", requestId, ", ", "seriesId=", seriesId, ", ") + + for _, label := range globalLabels { + fmt.Print(label.Name, "=", label.Value, ", ") + } + slices2.SortFunc(labels, func(a, b LabelPair) int { + if a.Name < b.Name { + return -1 + } else if a.Name > b.Name { + return 1 + } + return 0 + }) + for _, label := range labels { + fmt.Print(label.Name, "=", label.Value, ", ") + } + fmt.Println() + } + }*/ + + /*var found = false + for _, label := range series.Labels { + if label.Name == phlaremodel.LabelNameServiceName && label.Value == "ride-sharing-app" { + found = true + } + } + if !found { + continue + } + vehicle := "" + for _, label := range series.Labels { + if label.Name == "vehicle" { + vehicle = label.Value + } + } + if vehicle == "" { + continue + } + region := "" + for _, label := range series.Labels { + if label.Name == "region" { + region = label.Value + } + }*/ + //fmt.Println(region, vehicle) + /*for b, sample := range series.Samples { + }*/ + } // Normalisation is quite an expensive operation, // therefore it should be done after the rate limit check. for _, series := range req.Series { @@ -380,6 +524,27 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push return connect.NewResponse(&pushv1.PushResponse{}), nil } +func stringify(s []LabelPair) string { + slices2.SortFunc(s, func(a, b LabelPair) int { + if a.Name < b.Name { + return -1 + } else if a.Name > b.Name { + return 1 + } + return 0 + }) + var result string + for _, label := range s { + result += label.Name + "=" + label.Value + ", " + } + return result +} + +type LabelPair struct { + Name string + Value string +} + // If aggregation is configured for the tenant, we try to determine // whether the profile is eligible for aggregation based on the series // profile rate, and handle it asynchronously, if this is the case. diff --git a/pkg/experiment/compactor/compaction_worker.go b/pkg/experiment/compactor/compaction_worker.go index 3ba80cba65..4ff3d64e8e 100644 --- a/pkg/experiment/compactor/compaction_worker.go +++ b/pkg/experiment/compactor/compaction_worker.go @@ -17,12 +17,15 @@ import ( "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" + labels2 "github.com/prometheus/prometheus/model/labels" + _ "go.uber.org/automaxprocs" metastorev1 "github.com/grafana/pyroscope/api/gen/proto/go/metastore/v1" + queryv1 "github.com/grafana/pyroscope/api/gen/proto/go/query/v1" "github.com/grafana/pyroscope/pkg/experiment/metastore/client" + "github.com/grafana/pyroscope/pkg/experiment/query_backend" "github.com/grafana/pyroscope/pkg/experiment/query_backend/block" "github.com/grafana/pyroscope/pkg/objstore" - _ "go.uber.org/automaxprocs" ) type Worker struct { @@ -41,6 +44,8 @@ type Worker struct { queue chan *metastorev1.CompactionJob wg sync.WaitGroup + + exporter *Exporter } type Config struct { @@ -76,6 +81,7 @@ func New(config Config, logger log.Logger, metastoreClient *metastoreclient.Clie completedJobs: make(map[string]*metastorev1.CompactionJobStatus), metrics: newMetrics(reg), queue: make(chan *metastorev1.CompactionJob, workers), + exporter: NewExporter(), } w.BasicService = services.NewBasicService(w.starting, w.running, w.stopping) return w, nil @@ -274,6 +280,10 @@ func (w *Worker) startJob(ctx context.Context, job *metastorev1.CompactionJob) * "datasets", len(c.Datasets)) } + if job.CompactionLevel == 0 { + w.exportMetricsFromCompactedBlocks(ctx, compacted) + } + job.Status.Status = metastorev1.CompactionStatus_COMPACTION_STATUS_SUCCESS job.Status.CompletedJob = &metastorev1.CompletedJob{Blocks: compacted} statusName = "success" @@ -292,6 +302,76 @@ func (w *Worker) startJob(ctx context.Context, job *metastorev1.CompactionJob) * return job.Status } +func (w *Worker) exportMetricsFromCompactedBlocks(ctx context.Context, compacted []*metastorev1.BlockMeta) { + functions := map[string]*queryv1.FunctionList{ + // TODO: + // This must be richer. First, it should be split by tenant. + // Also, we could have functions associated to service_name + // while others are just collected generally no matter what + // service_name we handle + "pyroscope": { + Functions: []string{ + "net/http.HandlerFunc.ServeHTTP", + "runtime.gcBgMarkWorker", + }, + }, + "ride-sharing-app": { + Functions: []string{ + "net/http.HandlerFunc.ServeHTTP", + "runtime.gcBgMarkWorker", + }, + }, + } + for _, c := range compacted { + reader := query_backend.NewBlockReader(w.logger, w.storage) + var res, _ = reader.Invoke(ctx, + &queryv1.InvokeRequest{ + Tenant: []string{c.TenantId}, + StartTime: c.MinTime, + EndTime: c.MaxTime, + Query: []*queryv1.Query{{ + QueryType: queryv1.QueryType_QUERY_METRICS, + Metrics: &queryv1.MetricsQuery{ + FunctionsByServiceName: functions, + }, + }}, + QueryPlan: &queryv1.QueryPlan{ + Root: &queryv1.QueryNode{ + Blocks: []*metastorev1.BlockMeta{c}, + }, + }, + LabelSelector: "{}", + }, + ) + + // convert metrics into the expected export format + wr := WriteRequest{} + for _, series := range res.Reports[0].Metrics.GetTimeSeries() { + timeSeries := TimeSeries{} + for _, label := range series.Labels { + timeSeries.Labels = append(timeSeries.Labels, labels2.Label{ + Name: label.Name, + Value: label.Value, + }) + } + for _, point := range series.Points { + timeSeries.Samples = append(timeSeries.Samples, Sample{ + Value: point.Value, + Timestamp: point.Timestamp, + }) + } + wr.TimeSeries = append(wr.TimeSeries, timeSeries) + } + if len(wr.TimeSeries) > 0 { + go func() { + if sendErr := w.exporter.Send(context.Background(), &wr); sendErr != nil { + _ = w.logger.Log("msg", "failed to push metrics", "err", sendErr) + } + }() + } + } +} + func pretendEverythingIsOK(fn func() ([]*metastorev1.BlockMeta, error)) (m []*metastorev1.BlockMeta, err error) { defer func() { if r := recover(); r != nil { diff --git a/pkg/experiment/compactor/exporter.go b/pkg/experiment/compactor/exporter.go new file mode 100644 index 0000000000..bae65f714d --- /dev/null +++ b/pkg/experiment/compactor/exporter.go @@ -0,0 +1,87 @@ +package compactor + +import ( + "context" + "net/url" + "time" + + "github.com/gogo/protobuf/proto" + "github.com/klauspost/compress/snappy" + "github.com/prometheus/common/config" + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/prompb" + "github.com/prometheus/prometheus/storage/remote" +) + +type WriteRequest struct { + TimeSeries []TimeSeries +} + +type TimeSeries struct { + Labels labels.Labels + Samples []Sample +} + +type Sample struct { + Value float64 + Timestamp int64 +} + +type Exporter struct { + client remote.WriteClient +} + +func NewExporter() *Exporter { + wURL, err := url.Parse("https://prometheus-us-central1.grafana.net/api/prom/push") + if err != nil { + panic(err) + } + + c, err := remote.NewWriteClient("exporter", &remote.ClientConfig{ + URL: &config.URL{URL: wURL}, + Timeout: model.Duration(time.Second * 10), + HTTPClientConfig: config.HTTPClientConfig{ + BasicAuth: &config.BasicAuth{ + Username: "1741027", + Password: "omitted", + }, + }, + SigV4Config: nil, + AzureADConfig: nil, + Headers: nil, + RetryOnRateLimit: false, + }) + if err != nil { + panic(err) + } + return &Exporter{client: c} +} + +func (e *Exporter) Send(ctx context.Context, req *WriteRequest) error { + p := &prompb.WriteRequest{Timeseries: make([]prompb.TimeSeries, 0, len(req.TimeSeries))} + for _, ts := range req.TimeSeries { + // TODO: Merge external labels. + pts := prompb.TimeSeries{ + Labels: make([]prompb.Label, 0, len(ts.Labels)-1), + } + for _, l := range ts.Labels { + pts.Labels = append(pts.Labels, prompb.Label{ + Name: l.Name, + Value: l.Value, + }) + } + for _, s := range ts.Samples { + pts.Samples = append(pts.Samples, prompb.Sample{ + Value: s.Value, + Timestamp: s.Timestamp, + }) + } + p.Timeseries = append(p.Timeseries, pts) + } + buf := proto.NewBuffer(nil) + if err := buf.Marshal(p); err != nil { + return err + } + return e.client.Store(ctx, snappy.Encode(nil, buf.Bytes()), 0) +} diff --git a/pkg/experiment/query_backend/query_metrics.go b/pkg/experiment/query_backend/query_metrics.go new file mode 100644 index 0000000000..2e28697729 --- /dev/null +++ b/pkg/experiment/query_backend/query_metrics.go @@ -0,0 +1,238 @@ +package query_backend + +import ( + "fmt" + "strings" + "sync" + + "github.com/grafana/dskit/runutil" + + queryv1 "github.com/grafana/pyroscope/api/gen/proto/go/query/v1" + typesv1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" + "github.com/grafana/pyroscope/pkg/experiment/query_backend/block" + phlaremodel "github.com/grafana/pyroscope/pkg/model" + parquetquery "github.com/grafana/pyroscope/pkg/phlaredb/query" + schemav1 "github.com/grafana/pyroscope/pkg/phlaredb/schemas/v1" +) + +func init() { + registerQueryType( + queryv1.QueryType_QUERY_METRICS, + queryv1.ReportType_REPORT_METRICS, + queryMetrics, + newMetricsAggregator, + []block.Section{ + block.SectionProfiles, + block.SectionTSDB, + block.SectionSymbols, + }..., + ) +} + +func queryMetrics(q *queryContext, query *queryv1.Query) (r *queryv1.Report, err error) { + entries, err := profileEntryIterator(q) + if err != nil { + return nil, err + } + defer runutil.CloseWithErrCapture(&err, entries, "failed to close profile entry iterator") + + var columns schemav1.SampleColumns + if err := columns.Resolve(q.ds.Profiles().Schema()); err != nil { + // TODO + } + column, err := schemav1.ResolveColumnByPath(q.ds.Profiles().Schema(), strings.Split("TotalValue", ".")) + if err != nil { + return nil, err + } + + rows := parquetquery.NewRepeatedRowIterator(q.ctx, entries, q.ds.Profiles().RowGroups(), + column.ColumnIndex, + columns.StacktraceID.ColumnIndex, + columns.Value.ColumnIndex) + defer runutil.CloseWithErrCapture(&err, rows, "failed to close column iterator") + + labelsFromFp := make(map[uint64]phlaremodel.Labels) + builders := make(map[uint64]map[string]*phlaremodel.TimeSeriesBuilder) + for rows.Next() { + row := rows.At() + fp := uint64(row.Row.Fingerprint) + // Storing for later + _, ok := labelsFromFp[fp] + if !ok { + labelsFromFp[fp] = row.Row.Labels + } + + // Lazy init of builders + _, ok = builders[fp] + if !ok { + builders[fp] = make(map[string]*phlaremodel.TimeSeriesBuilder) + } + + // "" stands for total dimensions (no specific function) + _, ok = builders[fp][""] + if !ok { + builders[fp][""] = phlaremodel.NewTimeSeriesBuilder() + } + builders[fp][""].Add( + row.Row.Fingerprint, + row.Row.Labels, + int64(row.Row.Timestamp), + float64(row.Values[0][0].Int64()), + ) + + // metrics for target functions + reader, _ := q.ds.Symbols().Partition(q.ctx, row.Row.Partition) + for _, target := range query.Metrics.FunctionsByServiceName[q.ds.Meta().Name].Functions { + stringsTable := reader.Symbols().Strings + targetIndex := -1 + for i, s := range stringsTable { + if s == target { + targetIndex = i + } + } + if targetIndex == -1 { + continue + } + targetFunction := -1 + for i, fn := range reader.Symbols().Functions { + if targetIndex == int(fn.SystemName) { + targetFunction = i + } + } + if targetFunction == -1 { + continue + } + total := 0 + for i, stacktraceId := range row.Values[1] { + var locations []uint64 + locations = reader.Symbols().Stacktraces.LookupLocations(locations, stacktraceId.Uint32()) + found := false + for _, location := range locations { + for _, line := range reader.Symbols().Locations[location].Line { + if int(line.FunctionId) == targetFunction { + found = true + break + } + } + if found { + break + } + } + if !found { + continue + } + total += int(row.Values[2][i].Uint32()) + } + _, ok = builders[fp][target] + if !ok { + builders[fp][target] = phlaremodel.NewTimeSeriesBuilder() + } + builders[fp][target].Add( + row.Row.Fingerprint, + row.Row.Labels, + int64(row.Row.Timestamp), + float64(total), + ) + } + } + if err = rows.Err(); err != nil { + return nil, err + } + + // Build everything (all + functions) + var timeSeries []*typesv1.Series + for fingerPrint, buildersByFunction := range builders { + for function, builder := range buildersByFunction { + labels := getLabels(labelsFromFp[fingerPrint], function) + samples := getSamples(builder) + timeSeries = append(timeSeries, &typesv1.Series{ + Labels: labels, + Points: samples, + }) + } + } + + resp := &queryv1.Report{ + Metrics: &queryv1.MetricsReport{ + Query: query.Metrics.CloneVT(), + TimeSeries: timeSeries, + }, + } + + return resp, nil +} + +type metricsAggregator struct { + init sync.Once + query *queryv1.MetricsQuery + series []*typesv1.Series +} + +func newMetricsAggregator(req *queryv1.InvokeRequest) aggregator { + return &metricsAggregator{} +} + +func (a *metricsAggregator) aggregate(report *queryv1.Report) error { + r := report.Metrics + a.init.Do(func() { + a.series = make([]*typesv1.Series, 0) + a.query = r.Query.CloneVT() + }) + for _, s := range report.Metrics.GetTimeSeries() { + a.series = append(a.series, s) + } + return nil +} + +func (a *metricsAggregator) build() *queryv1.Report { + return &queryv1.Report{ + Metrics: &queryv1.MetricsReport{ + Query: a.query, + TimeSeries: a.series, + }, + } +} + +func getLabels(labelsIn phlaremodel.Labels, functionName string) phlaremodel.Labels { + prefix := "pyroscope_exported_metrics_" + if functionName != "" { + prefix = prefix + "functions_" + } + var labels phlaremodel.Labels + var reservedLabels = make(map[string]*typesv1.LabelPair) + for _, label := range labelsIn { + if strings.HasPrefix(label.Name, "__") { + reservedLabels[label.Name] = label + continue + } + fmt.Print(label.Name, "=", label.Value, ", ") + labels = append(labels, &typesv1.LabelPair{ + Name: label.Name, + Value: label.Value, + }) + } + labels = append(labels, &typesv1.LabelPair{ + Name: "__name__", + Value: prefix + strings.ReplaceAll(reservedLabels["__profile_type__"].Value, ":", "_"), + }) + if functionName != "" { + labels = append(labels, &typesv1.LabelPair{ + Name: "function", + Value: functionName, + }) + } + return labels +} + +func getSamples(builder *phlaremodel.TimeSeriesBuilder) []*typesv1.Point { + timeSeries := builder.Build() + var samples []*typesv1.Point + for _, point := range timeSeries[0].Points { + fmt.Println("(", point.Timestamp, ",", point.Value, ")") + samples = append(samples, &typesv1.Point{ + Value: point.Value, + Timestamp: point.Timestamp, + }) + } + return samples +} diff --git a/pkg/experiment/query_backend/query_profile_entry.go b/pkg/experiment/query_backend/query_profile_entry.go index cf76362dca..7cfb097652 100644 --- a/pkg/experiment/query_backend/query_profile_entry.go +++ b/pkg/experiment/query_backend/query_profile_entry.go @@ -18,6 +18,7 @@ func profileEntryIterator(q *queryContext, groupBy ...string) (iter.Iterator[Pro if err != nil { return nil, err } + // eliminar series per tal de mirar totes? results := parquetquery.NewBinaryJoinIterator(0, q.ds.Profiles().Column(q.ctx, "SeriesIndex", parquetquery.NewMapPredicate(series)), q.ds.Profiles().Column(q.ctx, "TimeNanos", parquetquery.NewIntBetweenPredicate(q.req.startTime, q.req.endTime)), @@ -72,7 +73,12 @@ func getSeriesLabels(reader phlaredb.IndexReader, matchers []*labels.Matcher, by series := make(map[uint32]seriesLabels) l := make(phlaremodel.Labels, 0, 6) for postings.Next() { - fp, err := reader.SeriesBy(postings.At(), &l, &chunks, by...) + var fp uint64 + if len(by) == 0 { + fp, err = reader.Series(postings.At(), &l, &chunks) + } else { + fp, err = reader.SeriesBy(postings.At(), &l, &chunks, by...) + } if err != nil { return nil, err }