From 357b76d376a7dde5ed43455c9553a9602a645e5f Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Tue, 2 Jan 2024 11:19:43 +0000 Subject: [PATCH 1/9] chore(update): update deep proto - will add support for metrics and watch source --- .idea/deep.iml | 4 +- go.mod | 2 +- go.sum | 2 + pkg/deepdb/encoding/vparquet/schema.go | 20 + pkg/deepdb/encoding/vparquet/schema_test.go | 57 ++ pkg/deeppb/tracepoint/v1/tracepoint.pb.go | 636 ++++++++++++++++---- 6 files changed, 600 insertions(+), 121 deletions(-) diff --git a/.idea/deep.iml b/.idea/deep.iml index 4bdb6dc..d408205 100644 --- a/.idea/deep.iml +++ b/.idea/deep.iml @@ -2,7 +2,7 @@ - + @@ -12,6 +12,6 @@ - + \ No newline at end of file diff --git a/go.mod b/go.mod index 596a405..0bce30a 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/googleapis/gax-go/v2 v2.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/intergral/go-deep-proto v1.0.2 + github.com/intergral/go-deep-proto v1.0.3 golang.org/x/exp v0.0.0-20221002003631-540bb7301a08 ) diff --git a/go.sum b/go.sum index b7d1279..2ba9db5 100644 --- a/go.sum +++ b/go.sum @@ -500,6 +500,8 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/intergral/go-deep-proto v1.0.2 h1:ezpNLMusTjpQ2yvXUYT9aLmAL3s+/CRYdsMyiKN5ckg= github.com/intergral/go-deep-proto v1.0.2/go.mod h1:kYiHIYAykVITDekpSAu1y9Z8Hr6OKpoYJGorm9uaeak= +github.com/intergral/go-deep-proto v1.0.3 h1:p0fmzX7Qn9ZlDkM1FEGzmy3vXkbzqEN9gUIVghPlknw= +github.com/intergral/go-deep-proto v1.0.3/go.mod h1:kYiHIYAykVITDekpSAu1y9Z8Hr6OKpoYJGorm9uaeak= github.com/ionos-cloud/sdk-go/v6 v6.1.3 h1:vb6yqdpiqaytvreM0bsn2pXw+1YDvEk2RKSmBAQvgDQ= github.com/jedib0t/go-pretty/v6 v6.2.4 h1:wdaj2KHD2W+mz8JgJ/Q6L/T5dB7kyqEFI16eLq7GEmk= github.com/jedib0t/go-pretty/v6 v6.2.4/go.mod h1:+nE9fyyHGil+PuISTCrp7avEdo6bqoMwqZnuiK2r2a0= diff --git a/pkg/deepdb/encoding/vparquet/schema.go b/pkg/deepdb/encoding/vparquet/schema.go index eb9da67..e7fc3f3 100644 --- a/pkg/deepdb/encoding/vparquet/schema.go +++ b/pkg/deepdb/encoding/vparquet/schema.go @@ -150,6 +150,7 @@ type WatchResult struct { Expression string `parquet:",snappy"` GoodResult *VariableID `parquet:""` ErrorResult *string `parquet:",snappy"` + Source string `parquet:",snappy"` } type Snapshot struct { @@ -292,6 +293,7 @@ func convertWatch(watch *deepTP.WatchResult) WatchResult { return WatchResult{ Expression: watch.Expression, GoodResult: &variableId, + Source: watch.Source.String(), } } @@ -299,6 +301,7 @@ func convertWatch(watch *deepTP.WatchResult) WatchResult { return WatchResult{ Expression: watch.Expression, ErrorResult: &result, + Source: watch.Source.String(), } } @@ -497,19 +500,36 @@ func parquetConvertWatches(watches []WatchResult) []*deepTP.WatchResult { } func parquetConvertWatchResult(watch WatchResult) *deepTP.WatchResult { + source := parquetConvertWatchSource(watch) if watch.GoodResult != nil { return &deepTP.WatchResult{ Expression: watch.Expression, Result: &deepTP.WatchResult_GoodResult{GoodResult: parquetConvertVariableID(*watch.GoodResult)}, + Source: source, } } else { return &deepTP.WatchResult{ Expression: watch.Expression, Result: &deepTP.WatchResult_ErrorResult{ErrorResult: *watch.ErrorResult}, + Source: source, } } } +func parquetConvertWatchSource(watch WatchResult) deepTP.WatchSource { + switch watch.Source { + case "LOG": + return deepTP.WatchSource_LOG + case "METRIC": + return deepTP.WatchSource_METRIC + case "WATCH": + case "": + default: + return deepTP.WatchSource_WATCH + } + return deepTP.WatchSource_WATCH +} + func parquetConvertFrames(frames []StackFrame) []*deepTP.StackFrame { varFrames := make([]*deepTP.StackFrame, len(frames)) for i, frame := range frames { diff --git a/pkg/deepdb/encoding/vparquet/schema_test.go b/pkg/deepdb/encoding/vparquet/schema_test.go index 1becdb9..f0a5aa5 100644 --- a/pkg/deepdb/encoding/vparquet/schema_test.go +++ b/pkg/deepdb/encoding/vparquet/schema_test.go @@ -87,6 +87,63 @@ func TestFieldsAreCleared(t *testing.T) { require.Equal(t, simpleSnapshot, actualSnapshot) } +func TestCovertDefaultWatch(t *testing.T) { + result := &deeptp.WatchResult{ + Expression: "something.me", + Result: &deeptp.WatchResult_GoodResult{GoodResult: &deeptp.VariableID{ID: "123", Name: "some.name"}}, + } + watch := convertWatch(result) + + assert.Equal(t, watch.Source, "WATCH") +} + +func TestConvertWatch(t *testing.T) { + tests := []struct { + name string + result *deeptp.WatchResult + expectedWatch string + }{ + { + name: "Log", + result: &deeptp.WatchResult{ + Expression: "something.me", + Result: &deeptp.WatchResult_GoodResult{GoodResult: &deeptp.VariableID{ID: "123", Name: "some.name"}}, + Source: deeptp.WatchSource_LOG, + }, + expectedWatch: "LOG", + }, + { + name: "Metric", + result: &deeptp.WatchResult{ + Expression: "something.me", + Result: &deeptp.WatchResult_GoodResult{GoodResult: &deeptp.VariableID{ID: "123", Name: "some.name"}}, + Source: deeptp.WatchSource_METRIC, + }, + expectedWatch: "METRIC", + }, + { + name: "Watch", + result: &deeptp.WatchResult{ + Expression: "something.me", + Result: &deeptp.WatchResult_GoodResult{GoodResult: &deeptp.VariableID{ID: "123", Name: "some.name"}}, + Source: deeptp.WatchSource_WATCH, + }, + expectedWatch: "WATCH", + }, + } + for _, tCase := range tests { + t.Run(tCase.name, func(t *testing.T) { + watch := convertWatch(tCase.result) + + assert.Equal(t, watch.Source, tCase.expectedWatch) + + result := parquetConvertWatchResult(watch) + + assert.Equal(t, result.Source, tCase.result.Source) + }) + } +} + func TestParquetRowSizeEstimate(t *testing.T) { // use this test to parse actual Parquet files and compare the two methods of estimating row size s := []string{} diff --git a/pkg/deeppb/tracepoint/v1/tracepoint.pb.go b/pkg/deeppb/tracepoint/v1/tracepoint.pb.go index 64be3c1..e283897 100644 --- a/pkg/deeppb/tracepoint/v1/tracepoint.pb.go +++ b/pkg/deeppb/tracepoint/v1/tracepoint.pb.go @@ -36,6 +36,109 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// The types of metric to create +type MetricType int32 + +const ( + MetricType_COUNTER MetricType = 0 + MetricType_GAUGE MetricType = 1 + MetricType_HISTOGRAM MetricType = 2 + MetricType_SUMMARY MetricType = 3 +) + +// Enum value maps for MetricType. +var ( + MetricType_name = map[int32]string{ + 0: "COUNTER", + 1: "GAUGE", + 2: "HISTOGRAM", + 3: "SUMMARY", + } + MetricType_value = map[string]int32{ + "COUNTER": 0, + "GAUGE": 1, + "HISTOGRAM": 2, + "SUMMARY": 3, + } +) + +func (x MetricType) Enum() *MetricType { + p := new(MetricType) + *p = x + return p +} + +func (x MetricType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetricType) Descriptor() protoreflect.EnumDescriptor { + return file_tracepoint_v1_tracepoint_proto_enumTypes[0].Descriptor() +} + +func (MetricType) Type() protoreflect.EnumType { + return &file_tracepoint_v1_tracepoint_proto_enumTypes[0] +} + +func (x MetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MetricType.Descriptor instead. +func (MetricType) EnumDescriptor() ([]byte, []int) { + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{0} +} + +// WatchSource is the logical source of the watch expression used to generate a result. +type WatchSource int32 + +const ( + WatchSource_WATCH WatchSource = 0 // A user attached this as an expression + WatchSource_LOG WatchSource = 1 // A watch expression from a log + WatchSource_METRIC WatchSource = 2 // A watch expression from a metric value or tag +) + +// Enum value maps for WatchSource. +var ( + WatchSource_name = map[int32]string{ + 0: "WATCH", + 1: "LOG", + 2: "METRIC", + } + WatchSource_value = map[string]int32{ + "WATCH": 0, + "LOG": 1, + "METRIC": 2, + } +) + +func (x WatchSource) Enum() *WatchSource { + p := new(WatchSource) + *p = x + return p +} + +func (x WatchSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WatchSource) Descriptor() protoreflect.EnumDescriptor { + return file_tracepoint_v1_tracepoint_proto_enumTypes[1].Descriptor() +} + +func (WatchSource) Type() protoreflect.EnumType { + return &file_tracepoint_v1_tracepoint_proto_enumTypes[1] +} + +func (x WatchSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WatchSource.Descriptor instead. +func (WatchSource) EnumDescriptor() ([]byte, []int) { + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{1} +} + // This is the config of a tracepoint that should be installed by the application agent. type TracePointConfig struct { state protoimpl.MessageState @@ -48,6 +151,7 @@ type TracePointConfig struct { Args map[string]string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Arbitrary key/kay of config values (this can contain conditions, logs, fire counts etc) Watches []string `protobuf:"bytes,5,rep,name=watches,proto3" json:"watches,omitempty"` // Expressions to evaluate at the this point of the code Targeting []*v1.KeyValue `protobuf:"bytes,6,rep,name=targeting,proto3" json:"targeting,omitempty"` // The targeting config for this tracepoint, used by the server to filter response. + Metrics []*Metric `protobuf:"bytes,7,rep,name=metrics,proto3" json:"metrics,omitempty"` // List of metric rules to apply at this point in the code } func (x *TracePointConfig) Reset() { @@ -124,6 +228,198 @@ func (x *TracePointConfig) GetTargeting() []*v1.KeyValue { return nil } +func (x *TracePointConfig) GetMetrics() []*Metric { + if x != nil { + return x.Metrics + } + return nil +} + +// Metric describes a metric rule to apply at this point. +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The name of the metric + LabelExpressions []*LabelExpression `protobuf:"bytes,2,rep,name=labelExpressions,proto3" json:"labelExpressions,omitempty"` // The metric labels + Type MetricType `protobuf:"varint,3,opt,name=type,proto3,enum=deeppb.tracepoint.v1.MetricType" json:"type,omitempty"` // The type of metric to generate + Expression *string `protobuf:"bytes,4,opt,name=expression,proto3,oneof" json:"expression,omitempty"` // The result of this expression will become the metric value. + Namespace *string `protobuf:"bytes,5,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"` // The namespace to set on the metric + Help *string `protobuf:"bytes,6,opt,name=help,proto3,oneof" json:"help,omitempty"` // The help statement to attach to the metric + Unit *string `protobuf:"bytes,7,opt,name=unit,proto3,oneof" json:"unit,omitempty"` // The unit associated with this value +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{1} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metric) GetLabelExpressions() []*LabelExpression { + if x != nil { + return x.LabelExpressions + } + return nil +} + +func (x *Metric) GetType() MetricType { + if x != nil { + return x.Type + } + return MetricType_COUNTER +} + +func (x *Metric) GetExpression() string { + if x != nil && x.Expression != nil { + return *x.Expression + } + return "" +} + +func (x *Metric) GetNamespace() string { + if x != nil && x.Namespace != nil { + return *x.Namespace + } + return "" +} + +func (x *Metric) GetHelp() string { + if x != nil && x.Help != nil { + return *x.Help + } + return "" +} + +func (x *Metric) GetUnit() string { + if x != nil && x.Unit != nil { + return *x.Unit + } + return "" +} + +// LabelExpression describes a label that should be evaluated and the value used as the label +type LabelExpression struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The label key + // Types that are assignable to Value: + // *LabelExpression_Static + // *LabelExpression_Expression + Value isLabelExpression_Value `protobuf_oneof:"value"` +} + +func (x *LabelExpression) Reset() { + *x = LabelExpression{} + if protoimpl.UnsafeEnabled { + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LabelExpression) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LabelExpression) ProtoMessage() {} + +func (x *LabelExpression) ProtoReflect() protoreflect.Message { + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LabelExpression.ProtoReflect.Descriptor instead. +func (*LabelExpression) Descriptor() ([]byte, []int) { + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{2} +} + +func (x *LabelExpression) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (m *LabelExpression) GetValue() isLabelExpression_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *LabelExpression) GetStatic() *v1.AnyValue { + if x, ok := x.GetValue().(*LabelExpression_Static); ok { + return x.Static + } + return nil +} + +func (x *LabelExpression) GetExpression() string { + if x, ok := x.GetValue().(*LabelExpression_Expression); ok { + return x.Expression + } + return "" +} + +type isLabelExpression_Value interface { + isLabelExpression_Value() +} + +type LabelExpression_Static struct { + Static *v1.AnyValue `protobuf:"bytes,2,opt,name=static,proto3,oneof"` // The label value +} + +type LabelExpression_Expression struct { + Expression string `protobuf:"bytes,3,opt,name=expression,proto3,oneof"` // The label expression +} + +func (*LabelExpression_Static) isLabelExpression_Value() {} + +func (*LabelExpression_Expression) isLabelExpression_Value() {} + // VariableID is used to identify a variable on a stack frame or as a child of another variable. type VariableID struct { state protoimpl.MessageState @@ -139,7 +435,7 @@ type VariableID struct { func (x *VariableID) Reset() { *x = VariableID{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[1] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -152,7 +448,7 @@ func (x *VariableID) String() string { func (*VariableID) ProtoMessage() {} func (x *VariableID) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[1] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -165,7 +461,7 @@ func (x *VariableID) ProtoReflect() protoreflect.Message { // Deprecated: Use VariableID.ProtoReflect.Descriptor instead. func (*VariableID) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{1} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{3} } func (x *VariableID) GetID() string { @@ -212,7 +508,7 @@ type Variable struct { func (x *Variable) Reset() { *x = Variable{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[2] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -225,7 +521,7 @@ func (x *Variable) String() string { func (*Variable) ProtoMessage() {} func (x *Variable) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[2] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -238,7 +534,7 @@ func (x *Variable) ProtoReflect() protoreflect.Message { // Deprecated: Use Variable.ProtoReflect.Descriptor instead. func (*Variable) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{2} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{4} } func (x *Variable) GetType() string { @@ -300,7 +596,7 @@ type StackFrame struct { func (x *StackFrame) Reset() { *x = StackFrame{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[3] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -313,7 +609,7 @@ func (x *StackFrame) String() string { func (*StackFrame) ProtoMessage() {} func (x *StackFrame) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[3] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -326,7 +622,7 @@ func (x *StackFrame) ProtoReflect() protoreflect.Message { // Deprecated: Use StackFrame.ProtoReflect.Descriptor instead. func (*StackFrame) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{3} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{5} } func (x *StackFrame) GetFileName() string { @@ -430,13 +726,15 @@ type WatchResult struct { // Types that are assignable to Result: // *WatchResult_GoodResult // *WatchResult_ErrorResult - Result isWatchResult_Result `protobuf_oneof:"result"` + Result isWatchResult_Result `protobuf_oneof:"result"` + FromMetric *bool `protobuf:"varint,4,opt,name=from_metric,json=fromMetric,proto3,oneof" json:"from_metric,omitempty"` // Is this the result of a metric, or metric tag @Deprecated + Source WatchSource `protobuf:"varint,5,opt,name=source,proto3,enum=deeppb.tracepoint.v1.WatchSource" json:"source,omitempty"` // This is the source of the watch result. e.g. did the watch come from a watch input, a log message or a metric } func (x *WatchResult) Reset() { *x = WatchResult{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[4] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -449,7 +747,7 @@ func (x *WatchResult) String() string { func (*WatchResult) ProtoMessage() {} func (x *WatchResult) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[4] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -462,7 +760,7 @@ func (x *WatchResult) ProtoReflect() protoreflect.Message { // Deprecated: Use WatchResult.ProtoReflect.Descriptor instead. func (*WatchResult) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{4} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{6} } func (x *WatchResult) GetExpression() string { @@ -493,6 +791,20 @@ func (x *WatchResult) GetErrorResult() string { return "" } +func (x *WatchResult) GetFromMetric() bool { + if x != nil && x.FromMetric != nil { + return *x.FromMetric + } + return false +} + +func (x *WatchResult) GetSource() WatchSource { + if x != nil { + return x.Source + } + return WatchSource_WATCH +} + type isWatchResult_Result interface { isWatchResult_Result() } @@ -530,7 +842,7 @@ type Snapshot struct { func (x *Snapshot) Reset() { *x = Snapshot{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[5] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -543,7 +855,7 @@ func (x *Snapshot) String() string { func (*Snapshot) ProtoMessage() {} func (x *Snapshot) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[5] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -556,7 +868,7 @@ func (x *Snapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use Snapshot.ProtoReflect.Descriptor instead. func (*Snapshot) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{5} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{7} } func (x *Snapshot) GetID() []byte { @@ -639,7 +951,7 @@ type SnapshotResponse struct { func (x *SnapshotResponse) Reset() { *x = SnapshotResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[6] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -652,7 +964,7 @@ func (x *SnapshotResponse) String() string { func (*SnapshotResponse) ProtoMessage() {} func (x *SnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[6] + mi := &file_tracepoint_v1_tracepoint_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -665,7 +977,7 @@ func (x *SnapshotResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SnapshotResponse.ProtoReflect.Descriptor instead. func (*SnapshotResponse) Descriptor() ([]byte, []int) { - return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{6} + return file_tracepoint_v1_tracepoint_proto_rawDescGZIP(), []int{8} } var File_tracepoint_v1_tracepoint_proto protoreflect.FileDescriptor @@ -675,7 +987,7 @@ var file_tracepoint_v1_tracepoint_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, + 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x02, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -691,10 +1003,43 @@ var file_tracepoint_v1_tracepoint_proto_rawDesc = []byte{ 0x65, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x69, - 0x6e, 0x67, 0x1a, 0x37, 0x0a, 0x09, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x0a, + 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x41, 0x72, + 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xce, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, + 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x65, + 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, + 0x12, 0x21, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, + 0x75, 0x6e, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x75, 0x6e, + 0x69, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x68, 0x65, 0x6c, 0x70, 0x42, 0x07, 0x0a, 0x05, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x45, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, + 0x12, 0x20, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, @@ -761,7 +1106,7 @@ var file_tracepoint_v1_tracepoint_proto_rawDesc = []byte{ 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, - 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x22, 0xa1, 0x01, 0x0a, 0x0b, 0x57, + 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x02, 0x0a, 0x0b, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0b, 0x67, 0x6f, @@ -771,60 +1116,74 @@ var file_tracepoint_v1_tracepoint_proto_rawDesc = []byte{ 0x44, 0x48, 0x00, 0x52, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe5, - 0x04, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x44, 0x12, 0x46, 0x0a, 0x0a, 0x74, - 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x6f, 0x69, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, - 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, - 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x76, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, - 0x70, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x73, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x06, 0x52, 0x07, 0x74, 0x73, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x38, 0x0a, 0x06, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, - 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x06, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x77, 0x61, 0x74, 0x63, 0x68, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, - 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x77, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, - 0x25, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0a, 0x66, 0x72, 0x6f, + 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x64, 0x65, 0x65, + 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, + 0x0e, 0x0a, 0x0c, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x22, + 0xe5, 0x04, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x44, 0x12, 0x46, 0x0a, 0x0a, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, + 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x76, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x73, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x06, 0x52, 0x07, 0x74, 0x73, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x38, 0x0a, + 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, + 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, + 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x77, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, - 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x1a, 0x5c, 0x0a, 0x0e, - 0x56, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6c, - 0x6f, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x63, 0x0a, 0x0f, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, - 0x04, 0x73, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, - 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, - 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x5e, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, 0x61, 0x6c, - 0x2e, 0x64, 0x65, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, - 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, 0x61, - 0x6c, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x70, - 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6e, + 0x6f, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x65, 0x65, 0x70, + 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x1c, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x1a, 0x5c, 0x0a, + 0x0e, 0x56, 0x61, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, + 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x40, 0x0a, 0x0a, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55, + 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, + 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x02, + 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x03, 0x2a, 0x2d, 0x0a, + 0x0b, 0x57, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x09, 0x0a, 0x05, + 0x57, 0x41, 0x54, 0x43, 0x48, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x47, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x02, 0x32, 0x63, 0x0a, 0x0f, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x50, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x5e, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, + 0x61, 0x6c, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, + 0x72, 0x61, 0x6c, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x65, + 0x70, 0x70, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -839,39 +1198,50 @@ func file_tracepoint_v1_tracepoint_proto_rawDescGZIP() []byte { return file_tracepoint_v1_tracepoint_proto_rawDescData } -var file_tracepoint_v1_tracepoint_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_tracepoint_v1_tracepoint_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_tracepoint_v1_tracepoint_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_tracepoint_v1_tracepoint_proto_goTypes = []interface{}{ - (*TracePointConfig)(nil), // 0: deeppb.tracepoint.v1.TracePointConfig - (*VariableID)(nil), // 1: deeppb.tracepoint.v1.VariableID - (*Variable)(nil), // 2: deeppb.tracepoint.v1.Variable - (*StackFrame)(nil), // 3: deeppb.tracepoint.v1.StackFrame - (*WatchResult)(nil), // 4: deeppb.tracepoint.v1.WatchResult - (*Snapshot)(nil), // 5: deeppb.tracepoint.v1.Snapshot - (*SnapshotResponse)(nil), // 6: deeppb.tracepoint.v1.SnapshotResponse - nil, // 7: deeppb.tracepoint.v1.TracePointConfig.ArgsEntry - nil, // 8: deeppb.tracepoint.v1.Snapshot.VarLookupEntry - (*v1.KeyValue)(nil), // 9: deeppb.common.v1.KeyValue + (MetricType)(0), // 0: deeppb.tracepoint.v1.MetricType + (WatchSource)(0), // 1: deeppb.tracepoint.v1.WatchSource + (*TracePointConfig)(nil), // 2: deeppb.tracepoint.v1.TracePointConfig + (*Metric)(nil), // 3: deeppb.tracepoint.v1.Metric + (*LabelExpression)(nil), // 4: deeppb.tracepoint.v1.LabelExpression + (*VariableID)(nil), // 5: deeppb.tracepoint.v1.VariableID + (*Variable)(nil), // 6: deeppb.tracepoint.v1.Variable + (*StackFrame)(nil), // 7: deeppb.tracepoint.v1.StackFrame + (*WatchResult)(nil), // 8: deeppb.tracepoint.v1.WatchResult + (*Snapshot)(nil), // 9: deeppb.tracepoint.v1.Snapshot + (*SnapshotResponse)(nil), // 10: deeppb.tracepoint.v1.SnapshotResponse + nil, // 11: deeppb.tracepoint.v1.TracePointConfig.ArgsEntry + nil, // 12: deeppb.tracepoint.v1.Snapshot.VarLookupEntry + (*v1.KeyValue)(nil), // 13: deeppb.common.v1.KeyValue + (*v1.AnyValue)(nil), // 14: deeppb.common.v1.AnyValue } var file_tracepoint_v1_tracepoint_proto_depIdxs = []int32{ - 7, // 0: deeppb.tracepoint.v1.TracePointConfig.args:type_name -> deeppb.tracepoint.v1.TracePointConfig.ArgsEntry - 9, // 1: deeppb.tracepoint.v1.TracePointConfig.targeting:type_name -> deeppb.common.v1.KeyValue - 1, // 2: deeppb.tracepoint.v1.Variable.children:type_name -> deeppb.tracepoint.v1.VariableID - 1, // 3: deeppb.tracepoint.v1.StackFrame.variables:type_name -> deeppb.tracepoint.v1.VariableID - 1, // 4: deeppb.tracepoint.v1.WatchResult.good_result:type_name -> deeppb.tracepoint.v1.VariableID - 0, // 5: deeppb.tracepoint.v1.Snapshot.tracepoint:type_name -> deeppb.tracepoint.v1.TracePointConfig - 8, // 6: deeppb.tracepoint.v1.Snapshot.var_lookup:type_name -> deeppb.tracepoint.v1.Snapshot.VarLookupEntry - 3, // 7: deeppb.tracepoint.v1.Snapshot.frames:type_name -> deeppb.tracepoint.v1.StackFrame - 4, // 8: deeppb.tracepoint.v1.Snapshot.watches:type_name -> deeppb.tracepoint.v1.WatchResult - 9, // 9: deeppb.tracepoint.v1.Snapshot.attributes:type_name -> deeppb.common.v1.KeyValue - 9, // 10: deeppb.tracepoint.v1.Snapshot.resource:type_name -> deeppb.common.v1.KeyValue - 2, // 11: deeppb.tracepoint.v1.Snapshot.VarLookupEntry.value:type_name -> deeppb.tracepoint.v1.Variable - 5, // 12: deeppb.tracepoint.v1.SnapshotService.send:input_type -> deeppb.tracepoint.v1.Snapshot - 6, // 13: deeppb.tracepoint.v1.SnapshotService.send:output_type -> deeppb.tracepoint.v1.SnapshotResponse - 13, // [13:14] is the sub-list for method output_type - 12, // [12:13] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 11, // 0: deeppb.tracepoint.v1.TracePointConfig.args:type_name -> deeppb.tracepoint.v1.TracePointConfig.ArgsEntry + 13, // 1: deeppb.tracepoint.v1.TracePointConfig.targeting:type_name -> deeppb.common.v1.KeyValue + 3, // 2: deeppb.tracepoint.v1.TracePointConfig.metrics:type_name -> deeppb.tracepoint.v1.Metric + 4, // 3: deeppb.tracepoint.v1.Metric.labelExpressions:type_name -> deeppb.tracepoint.v1.LabelExpression + 0, // 4: deeppb.tracepoint.v1.Metric.type:type_name -> deeppb.tracepoint.v1.MetricType + 14, // 5: deeppb.tracepoint.v1.LabelExpression.static:type_name -> deeppb.common.v1.AnyValue + 5, // 6: deeppb.tracepoint.v1.Variable.children:type_name -> deeppb.tracepoint.v1.VariableID + 5, // 7: deeppb.tracepoint.v1.StackFrame.variables:type_name -> deeppb.tracepoint.v1.VariableID + 5, // 8: deeppb.tracepoint.v1.WatchResult.good_result:type_name -> deeppb.tracepoint.v1.VariableID + 1, // 9: deeppb.tracepoint.v1.WatchResult.source:type_name -> deeppb.tracepoint.v1.WatchSource + 2, // 10: deeppb.tracepoint.v1.Snapshot.tracepoint:type_name -> deeppb.tracepoint.v1.TracePointConfig + 12, // 11: deeppb.tracepoint.v1.Snapshot.var_lookup:type_name -> deeppb.tracepoint.v1.Snapshot.VarLookupEntry + 7, // 12: deeppb.tracepoint.v1.Snapshot.frames:type_name -> deeppb.tracepoint.v1.StackFrame + 8, // 13: deeppb.tracepoint.v1.Snapshot.watches:type_name -> deeppb.tracepoint.v1.WatchResult + 13, // 14: deeppb.tracepoint.v1.Snapshot.attributes:type_name -> deeppb.common.v1.KeyValue + 13, // 15: deeppb.tracepoint.v1.Snapshot.resource:type_name -> deeppb.common.v1.KeyValue + 6, // 16: deeppb.tracepoint.v1.Snapshot.VarLookupEntry.value:type_name -> deeppb.tracepoint.v1.Variable + 9, // 17: deeppb.tracepoint.v1.SnapshotService.send:input_type -> deeppb.tracepoint.v1.Snapshot + 10, // 18: deeppb.tracepoint.v1.SnapshotService.send:output_type -> deeppb.tracepoint.v1.SnapshotResponse + 18, // [18:19] is the sub-list for method output_type + 17, // [17:18] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_tracepoint_v1_tracepoint_proto_init() } @@ -893,7 +1263,7 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VariableID); i { + switch v := v.(*Metric); i { case 0: return &v.state case 1: @@ -905,7 +1275,7 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Variable); i { + switch v := v.(*LabelExpression); i { case 0: return &v.state case 1: @@ -917,7 +1287,7 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StackFrame); i { + switch v := v.(*VariableID); i { case 0: return &v.state case 1: @@ -929,7 +1299,7 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchResult); i { + switch v := v.(*Variable); i { case 0: return &v.state case 1: @@ -941,7 +1311,7 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Snapshot); i { + switch v := v.(*StackFrame); i { case 0: return &v.state case 1: @@ -953,6 +1323,30 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tracepoint_v1_tracepoint_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Snapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tracepoint_v1_tracepoint_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SnapshotResponse); i { case 0: return &v.state @@ -966,25 +1360,31 @@ func file_tracepoint_v1_tracepoint_proto_init() { } } file_tracepoint_v1_tracepoint_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_tracepoint_v1_tracepoint_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_tracepoint_v1_tracepoint_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*LabelExpression_Static)(nil), + (*LabelExpression_Expression)(nil), + } file_tracepoint_v1_tracepoint_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_tracepoint_v1_tracepoint_proto_msgTypes[4].OneofWrappers = []interface{}{ + file_tracepoint_v1_tracepoint_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_tracepoint_v1_tracepoint_proto_msgTypes[5].OneofWrappers = []interface{}{} + file_tracepoint_v1_tracepoint_proto_msgTypes[6].OneofWrappers = []interface{}{ (*WatchResult_GoodResult)(nil), (*WatchResult_ErrorResult)(nil), } - file_tracepoint_v1_tracepoint_proto_msgTypes[5].OneofWrappers = []interface{}{} + file_tracepoint_v1_tracepoint_proto_msgTypes[7].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tracepoint_v1_tracepoint_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, + NumEnums: 2, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, GoTypes: file_tracepoint_v1_tracepoint_proto_goTypes, DependencyIndexes: file_tracepoint_v1_tracepoint_proto_depIdxs, + EnumInfos: file_tracepoint_v1_tracepoint_proto_enumTypes, MessageInfos: file_tracepoint_v1_tracepoint_proto_msgTypes, }.Build() File_tracepoint_v1_tracepoint_proto = out.File From e729d14c74e758e6865893a3fb302f01c7aff895 Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Wed, 3 Jan 2024 11:59:39 +0000 Subject: [PATCH 2/9] chore(update): update CHANGELOG.md --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2de4b25..b485f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ + +# main (unreleased) +- **[ENHANCEMENT]**: Update deep proto version to support new properties on tracepoints [#78](https://github.com/intergral/deep/pull/78) [@Umaaz](https://github.com/Umaaz) + + + +# 1.0.4 (04/12/2024) +- **[BUGFIX]**: compactor loop was not running [#76](https://github.com/intergral/deep/pull/76) [@Umaaz](https://github.com/Umaaz) + + -# 1.0.3 (xx/xx/2023) +# 1.0.3 (30/11/2023) - **[CHANGE]**: add/improve monitoring for retention [#75](https://github.com/intergral/deep/pull/75) [@Umaaz](https://github.com/Umaaz) - **[CHANGE]**: add docs for run books [#74](https://github.com/intergral/deep/pull/74) [@Umaaz](https://github.com/Umaaz) - **[CHANGE]**: unify metric namespaces and subsystems [#73](https://github.com/intergral/deep/pull/73) [@Umaaz](https://github.com/Umaaz) From 50715c07487c843a5777c0909f874868d2e4a9bb Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Wed, 3 Jan 2024 13:28:12 +0000 Subject: [PATCH 3/9] chore(update): update docs for features --- docs/docs/.pages | 2 + docs/docs/_sections/client_docs.md | 2 + docs/docs/features/.pages | 5 ++ docs/docs/features/logging.md | 2 +- docs/docs/features/method_entry.md | 18 +++++++ docs/docs/features/metrics.md | 87 ++++++++++++++++++++++++++++++ docs/docs/features/snapshots.md | 26 +++++++++ docs/docs/features/tracepoints.md | 7 +++ docs/docs/features/traces.md | 34 ++++++++++++ docs/docs/index.md | 3 +- docs/mkdocs.yml | 1 + docs/requirements.txt | 1 + 12 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 docs/docs/.pages create mode 100644 docs/docs/_sections/client_docs.md create mode 100644 docs/docs/features/.pages create mode 100644 docs/docs/features/method_entry.md create mode 100644 docs/docs/features/metrics.md create mode 100644 docs/docs/features/snapshots.md create mode 100644 docs/docs/features/tracepoints.md create mode 100644 docs/docs/features/traces.md diff --git a/docs/docs/.pages b/docs/docs/.pages new file mode 100644 index 0000000..a670ce1 --- /dev/null +++ b/docs/docs/.pages @@ -0,0 +1,2 @@ +nav: + - ... | regex=^[^_][A-z0-9]+$ \ No newline at end of file diff --git a/docs/docs/_sections/client_docs.md b/docs/docs/_sections/client_docs.md new file mode 100644 index 0000000..d5d7351 --- /dev/null +++ b/docs/docs/_sections/client_docs.md @@ -0,0 +1,2 @@ +- [github](intergral/deep-python-client) +- [github](intergral/deep-java-client) diff --git a/docs/docs/features/.pages b/docs/docs/features/.pages new file mode 100644 index 0000000..e385d34 --- /dev/null +++ b/docs/docs/features/.pages @@ -0,0 +1,5 @@ +nav: + - Tracepoints: tracepoints.md + - Snapshot: snapshots.md + - Method Entry: method_entry.md + - ... \ No newline at end of file diff --git a/docs/docs/features/logging.md b/docs/docs/features/logging.md index 696f968..a7c5abe 100644 --- a/docs/docs/features/logging.md +++ b/docs/docs/features/logging.md @@ -6,7 +6,7 @@ To add a log message simply attach the argument 'log_msg' to the tracepoint. ```json { "path": "some/file.py", - "line": 22, + "line_number": 22, "args": { "log_msg": "This log message will be injected" } diff --git a/docs/docs/features/method_entry.md b/docs/docs/features/method_entry.md new file mode 100644 index 0000000..cd2db0d --- /dev/null +++ b/docs/docs/features/method_entry.md @@ -0,0 +1,18 @@ +# Method Entry + +This feature is linked to the [span features](./traces.md). Essentially this allows Deep to create snapshots or spans on +methods rather than lines, by setting the argument 'method_name'. + +```json +{ + "path": "some/file.py", + "line_number": -1, + "args": { + "method_name": "session_created" + } +} +``` + +This would essentially ignore the line number and instead create a snapshot when the method/function 'session_created' +in the file 'some/file.py' is called. This can be useful if the line numbers of the running code is not known, but you +know the method/function name. diff --git a/docs/docs/features/metrics.md b/docs/docs/features/metrics.md new file mode 100644 index 0000000..3635460 --- /dev/null +++ b/docs/docs/features/metrics.md @@ -0,0 +1,87 @@ +# Metrics + +Deep offers the ability to dynamically create metrics at arbitrary points in the code. This allows you to create metrics +about specific actions within your applications without having to change the code. + +To attach a metric +a '[Metric](https://github.com/intergral/deep-proto/blob/master/deepproto/proto/tracepoint/v1/tracepoint.proto#L45)' +must be attached to the tracepoint config. + +```json +{ + "path": "some/file.py", + "line_number": 22, + "metrics": [ + { + "name": "session_created", + "labelExpressions": [ + { + "key": "user_id", + "value": { + "expression": "user.id" + } + } + ] + } + ] +} +``` + +The above example would create a metric called `session_created` with the labels `user_ud: 167252` (the value of the +label evaluated at runtime). The value of the labels can be either expressions (as above) or static values. The value of +the metric is optional, if not set then the value will be `1`, if set the value should be a valid expression for the +point it is executed. + +# Supported providers + +The specific supported providers is dependent on the client that is being used. In all cases custom providers can be set +using the plugin architecture of the client. As a generalisation the following providers will be detected and used automatically: + + - Prometheus + - Otel + +For more info on what providers are supported by which clients see the client docs. + +{!_sections/client_docs.md!} + +# Example (User Session Duration) + +Let us imagine a scenario where we want to track when a user session is destroyed. Let us imagine the follow code is +called when a user session is destroyed. + +```py title="users/session.py" linenums="22" +def delete_session(self, user, session): + self.process_session_end(session) + session = self.db.delete_session(user.id) + return True +``` + +In this example we can create the tracepoint as follows: + +```json +{ + "path": "users/sessions.py", + "line_number": 24, + "metrics": [ + { + "name": "session_duration", + "type": "HISTOGRAM", + "labelExpressions": [ + { + "key": "user_id", + "value": { + "expression": "user.id" + } + } + ], + "expression": "time.time() - session.start_ts" + } + ] +} +``` + +This tracepoint would result in the Deep intercepting line 24 and creating a new histogram metric using the value of the +expression `time.time() - session.start_ts` as the value. This metric will then be pushed to metric provider and +captured by your existing metric services (e.g. Prometheus). + +{!_sections/expression.md!} \ No newline at end of file diff --git a/docs/docs/features/snapshots.md b/docs/docs/features/snapshots.md new file mode 100644 index 0000000..8d6e4c3 --- /dev/null +++ b/docs/docs/features/snapshots.md @@ -0,0 +1,26 @@ +# Snapshots + +Deeps primary feature is the ability to capture data at any point in your code. This allows you to gather any data at +any point to help speed up diagnosis of application issues. + +The way Deep triggers controls its data collection is with '[Tracepoints](./tracepoints.md)'. A tracepoint is a +definition of a point of code (file and line number), with some customisations of how to collect data. The default +behaviour is to create a snapshot that contains the stack and variable data at that point in the code. + +```json +{ + "path": "some/file.py", + "line_number": 22 +} +``` + +## Data Collection + +The data that is collected by a snapshot is controlled by the config of the tracepoint but can include: + + - Stack Frames - The list of frames that where executed for the application to get to the tracepoints location, this includes file name, class name, line number etc. + - Variables - The variable data that is available at that point of the code, this includes local variables, method parameters (arguments), defining object (this/self) + - Watches - User specified values that are evaluated at the point the code is executed + +It is possible to customise the data collection by using plugins. + diff --git a/docs/docs/features/tracepoints.md b/docs/docs/features/tracepoints.md new file mode 100644 index 0000000..49f61ca --- /dev/null +++ b/docs/docs/features/tracepoints.md @@ -0,0 +1,7 @@ +# Tracepoints + +Tracepoints are the way Deep defines the actions it will take. A tracepoint is primarily a code location (file name and +line number), however, there can also be other configurations that control how the data is collected and any +restrictions the client should make. + +For details of the structure of a tracepoint see the [proto definition](https://github.com/intergral/deep-proto/blob/master/deepproto/proto/tracepoint/v1/tracepoint.proto). \ No newline at end of file diff --git a/docs/docs/features/traces.md b/docs/docs/features/traces.md new file mode 100644 index 0000000..962ac6d --- /dev/null +++ b/docs/docs/features/traces.md @@ -0,0 +1,34 @@ +# Traces / Spans + +Deep offers the ability to dynamically create Spans at arbitrary points in the code. This allows you to augment your +exising monitoring with specific Spans when you need additional data while diagnosing an issue. + +To create a Span the `span` argument should be attached to the tracepoint. This argument can have the values of: + +- `method` - This will create a span around the method the tracepoint is located in +- `line` - This will create a span around the line the tracepoint is on + +Additionally, the argument `method_name` can be set (to the name of the method) to crate a span around any method in the +file with that name. If `method_name` is set then the `line_number` property is ignored for the span. This method also +allows for '[method entry tracepoints](./method_entry.md)' + +```json +{ + "path": "some/file.py", + "line_number": 22, + "args": { + "span": "method" + } +} +``` + +# Supported providers + +The specific supported providers is dependent on the client that is being used. In all cases custom providers can be set +using the plugin architecture of the client. As a generalisation the following providers will be detected and used automatically: + +- Otel + +For more info on what providers are supported by which clients see the client docs. + +{!_sections/client_docs.md!} diff --git a/docs/docs/index.md b/docs/docs/index.md index ad75a64..b75cd16 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -33,5 +33,4 @@ These plugins are planned for release, pending review from Grafana. To set up the client you will need to pick the appropriate language and follow the instructions for that client. The available clients are: -- [github](intergral/deep-python-client) -- [github](intergral/deep-java-client) +{!_sections/client_docs.md!} diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 12561ac..9aa6327 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -36,6 +36,7 @@ markdown_extensions: base_path: docs plugins: + - awesome-pages: - glightbox: - mkdocs_gitlinks: show_docs: true diff --git a/docs/requirements.txt b/docs/requirements.txt index 7a65452..047de3b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,4 @@ markdown-include mkdocs-material mkdocs-glightbox mkdocs-gitlinks +mkdocs-awesome-pages-plugin From 5caef4557d206963e81e738488d2a33c795ce797 Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 11:26:49 +0000 Subject: [PATCH 4/9] chore(update): update to new deep proto version - support for metric tracepoints - add docs for features --- docs/docs/features/tracepoints.md | 57 +++++++++- go.mod | 2 +- go.sum | 2 + pkg/deepdb/encoding/vparquet/schema.go | 152 ++++++++++++++++++++++++- 4 files changed, 206 insertions(+), 7 deletions(-) diff --git a/docs/docs/features/tracepoints.md b/docs/docs/features/tracepoints.md index 49f61ca..418bef4 100644 --- a/docs/docs/features/tracepoints.md +++ b/docs/docs/features/tracepoints.md @@ -4,4 +4,59 @@ Tracepoints are the way Deep defines the actions it will take. A tracepoint is p line number), however, there can also be other configurations that control how the data is collected and any restrictions the client should make. -For details of the structure of a tracepoint see the [proto definition](https://github.com/intergral/deep-proto/blob/master/deepproto/proto/tracepoint/v1/tracepoint.proto). \ No newline at end of file +For details of the structure of a tracepoint see +the [proto definition](https://github.com/intergral/deep-proto/blob/master/deepproto/proto/tracepoint/v1/tracepoint.proto). + +## Tracepoint Types + +There are a few different types of tracepoints supported by Deep, each with slightly different config options and use +cases. + +### Line Tracepoints + +A line tracepoint is the basic form of a tracepoint and allows tracepoints to be installed on a line of code. There are +a couple of options that change the behaviour of line tracepoints. + +- **Line Start**: This is the default behaviour for line tracepoints and will trigger the tracepoint at the start of the + line. +- **Line End**: This will tell Deep to collect data at the end of the line, and capture the time spent on the line as + well as any exceptions from the execution of the line. +- **Line Capture**: This will combine the two, collecting the data at the start of the line, but also capturing the line + execution time and exception. + +### Method Tracepoints + +A method tracepoint is a form of tracepoint that will wrap a method (or function) and capture the start, or end of a +method call. There are a few options for this tracepoint type: + +- **Method Start**: This is the default behaviour of a method tracepoint, and will capture a snapshot at the start of a + method. Capturing only the method parameters (or arguments) and the declaring object (this/self) +- **Method End**: This type allows the end of a method call to be captured, capturing the result of the call or + exception to be captured +- **Method Capture**: This will combine the two, capturing the data at the start of the method, and capturing the + returned data or exception. + +## Dynamic Monitoring + +Deep provides the ability to create Spans, Metrics and Logs dynamically by configuring the tracepoint appropriately. + +- [Logging](./logging.md) +- [Spans](./traces.md) +- [Metrics](./metrics.md) + +It is also possible to set the tracepoint to not capture any data and only create Spans, Logs or Metrics. + +### Logging + +All tracepoints can define a log message that will be evaluated at the point the tracepoint is executed and result in a +log message in the application logs. + +### Metrics + +All tracepoints can define metrics that will be evaluated at the point the tracepoint is executed and the result will be +processed by the configured metric processor. + +## Span Options + +It is also possible to start a span when a tracepoint is captured. The Span will have the name of the method, or +file/line number it was created from. diff --git a/go.mod b/go.mod index 0bce30a..c9abb0e 100644 --- a/go.mod +++ b/go.mod @@ -80,7 +80,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/googleapis/gax-go/v2 v2.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/intergral/go-deep-proto v1.0.3 + github.com/intergral/go-deep-proto v1.0.5 golang.org/x/exp v0.0.0-20221002003631-540bb7301a08 ) diff --git a/go.sum b/go.sum index 2ba9db5..a09cec8 100644 --- a/go.sum +++ b/go.sum @@ -502,6 +502,8 @@ github.com/intergral/go-deep-proto v1.0.2 h1:ezpNLMusTjpQ2yvXUYT9aLmAL3s+/CRYdsM github.com/intergral/go-deep-proto v1.0.2/go.mod h1:kYiHIYAykVITDekpSAu1y9Z8Hr6OKpoYJGorm9uaeak= github.com/intergral/go-deep-proto v1.0.3 h1:p0fmzX7Qn9ZlDkM1FEGzmy3vXkbzqEN9gUIVghPlknw= github.com/intergral/go-deep-proto v1.0.3/go.mod h1:kYiHIYAykVITDekpSAu1y9Z8Hr6OKpoYJGorm9uaeak= +github.com/intergral/go-deep-proto v1.0.5 h1:j5s2ovw7l+zrNrhjZteP8pE5kZe/fJXhgtwfn2JATeg= +github.com/intergral/go-deep-proto v1.0.5/go.mod h1:kYiHIYAykVITDekpSAu1y9Z8Hr6OKpoYJGorm9uaeak= github.com/ionos-cloud/sdk-go/v6 v6.1.3 h1:vb6yqdpiqaytvreM0bsn2pXw+1YDvEk2RKSmBAQvgDQ= github.com/jedib0t/go-pretty/v6 v6.2.4 h1:wdaj2KHD2W+mz8JgJ/Q6L/T5dB7kyqEFI16eLq7GEmk= github.com/jedib0t/go-pretty/v6 v6.2.4/go.mod h1:+nE9fyyHGil+PuISTCrp7avEdo6bqoMwqZnuiK2r2a0= diff --git a/pkg/deepdb/encoding/vparquet/schema.go b/pkg/deepdb/encoding/vparquet/schema.go index e7fc3f3..11c80af 100644 --- a/pkg/deepdb/encoding/vparquet/schema.go +++ b/pkg/deepdb/encoding/vparquet/schema.go @@ -19,6 +19,8 @@ package vparquet import ( "bytes" + "fmt" + "strconv" deepCommon "github.com/intergral/deep/pkg/deeppb/common/v1" deepTP "github.com/intergral/deep/pkg/deeppb/tracepoint/v1" @@ -108,12 +110,29 @@ type Resource struct { Test string `parquet:",snappy,dict,optional" json:",omitempty"` // Always empty for testing } +type LabelExpression struct { + Key string `parquest:",snappy,dict"` + Expression string `parquest:",snappy,dict"` + Static string `parquest:",snappy,dict"` +} + +type MetricDefinition struct { + Name string `parquest:",snappy,dict"` + Labels []LabelExpression `parquest:""` + MetricType string `parquest:",snappy,dict"` + Expression *string `parquest:",snappy,dict"` + Namespace *string `parquest:",snappy,dict"` + Help *string `parquest:",snappy,dict"` + Unit *string `parquest:",snappy,dict"` +} + type TracePointConfig struct { - ID string `parquet:",snappy,dict"` - Path string `parquet:",snappy,dict"` - LineNumber uint32 `parquet:",delta"` - Args map[string]string `parquet:""` - Watches []string `parquet:""` + ID string `parquet:",snappy,dict"` + Path string `parquet:",snappy,dict"` + LineNumber uint32 `parquet:",delta"` + Args map[string]string `parquet:""` + Watches []string `parquet:""` + Metrics []MetricDefinition `parquet:""` } type VariableID struct { @@ -387,7 +406,71 @@ func convertTracepoint(tracepoint *deepTP.TracePointConfig) TracePointConfig { LineNumber: tracepoint.LineNumber, Args: tracepoint.Args, Watches: tracepoint.Watches, + Metrics: convertMetricDefinitions(tracepoint.Metrics), + } +} + +func convertMetricDefinitions(metrics []*deepTP.Metric) []MetricDefinition { + if metrics == nil || len(metrics) == 0 { + return nil + } + definitions := make([]MetricDefinition, len(metrics)) + for i, metric := range metrics { + definitions[i] = convertMetricDefinition(metric) + } + return definitions +} + +func convertMetricDefinition(metric *deepTP.Metric) MetricDefinition { + return MetricDefinition{ + Name: metric.Name, + Labels: convertMetricLabels(metric.LabelExpressions), + MetricType: metric.Type.String(), + Expression: metric.Expression, + Namespace: metric.Namespace, + Help: metric.Help, + Unit: metric.Unit, + } +} + +func convertMetricLabels(expressions []*deepTP.LabelExpression) []LabelExpression { + if expressions == nil || len(expressions) == 0 { + return nil + } + labelExpressions := make([]LabelExpression, len(expressions)) + for i, label := range expressions { + labelExpressions[i] = convertMetricLabel(label) + } + return labelExpressions +} + +func convertMetricLabel(label *deepTP.LabelExpression) LabelExpression { + return LabelExpression{ + Key: label.Key, + Expression: label.GetExpression(), + Static: anyValueToString(label.GetStatic()), + } +} + +func anyValueToString(static *deepCommon.AnyValue) string { + + switch v := static.Value.(type) { + case *deepCommon.AnyValue_StringValue: + return v.StringValue + case *deepCommon.AnyValue_IntValue: + return strconv.FormatInt(v.IntValue, 10) + case *deepCommon.AnyValue_DoubleValue: + return fmt.Sprintf("%g", v.DoubleValue) + case *deepCommon.AnyValue_BoolValue: + return strconv.FormatBool(v.BoolValue) + case *deepCommon.AnyValue_ArrayValue: + // todo + return "" + case *deepCommon.AnyValue_KvlistValue: + // todo + return "" } + return "" } func extendReuseSlice[T any](sz int, in []T) []T { @@ -410,6 +493,7 @@ func parquetToDeepSnapshot(snap *Snapshot) *deepTP.Snapshot { LineNumber: snap.Tracepoint.LineNumber, Args: snap.Tracepoint.Args, Watches: snap.Tracepoint.Watches, + Metrics: parquetConvertMetrics(snap.Tracepoint.Metrics), }, VarLookup: parquetConvertVariables(snap.VarLookup), TsNanos: snap.TsNanos, @@ -422,6 +506,64 @@ func parquetToDeepSnapshot(snap *Snapshot) *deepTP.Snapshot { } } +func parquetConvertMetrics(metrics []MetricDefinition) []*deepTP.Metric { + if metrics == nil || len(metrics) == 0 { + return nil + } + deepMetrics := make([]*deepTP.Metric, len(metrics)) + for i, metric := range metrics { + deepMetrics[i] = &deepTP.Metric{ + Name: metric.Name, + LabelExpressions: parquetConvertLabelExpression(metric.Labels), + Type: parquetConvertMetricType(metric.MetricType), + Expression: metric.Expression, + Namespace: metric.Namespace, + Help: metric.Help, + Unit: metric.Unit, + } + } + return deepMetrics +} + +func parquetConvertLabelExpression(labels []LabelExpression) []*deepTP.LabelExpression { + if labels == nil || len(labels) == 0 { + return nil + } + labelExpressions := make([]*deepTP.LabelExpression, len(labels)) + for i, label := range labels { + if label.Expression == "" { + labelExpressions[i] = &deepTP.LabelExpression{ + Key: label.Key, + Value: &deepTP.LabelExpression_Static{Static: &deepCommon.AnyValue{Value: &deepCommon.AnyValue_StringValue{StringValue: label.Static}}}, // todo: how to support other types + } + } else { + + labelExpressions[i] = &deepTP.LabelExpression{ + Key: label.Key, + Value: &deepTP.LabelExpression_Expression{Expression: label.Expression}, + } + } + } + return labelExpressions +} + +func parquetConvertMetricType(metricType string) deepTP.MetricType { + switch metricType { + case "": + case "COUNTER": + return deepTP.MetricType_COUNTER + case "GAUGE": + return deepTP.MetricType_GAUGE + case "HISTOGRAM": + return deepTP.MetricType_HISTOGRAM + case "SUMMARY": + return deepTP.MetricType_SUMMARY + default: + return deepTP.MetricType_COUNTER + } + return deepTP.MetricType_COUNTER +} + func parquetConvertResource(resource Resource) []*deepCommon.KeyValue { protoAttrs := parquetConvertAttributes(resource.Attrs) From cb569622394d8dccd0b8f58efba4ee9c183bd86d Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 15:21:34 +0000 Subject: [PATCH 5/9] fix(build): ensure build uses the same proto version as set in go mod --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8e43f20..07137ce 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,8 @@ PROTO_INTERMEDIATE_DIR = pkg/.patched-proto PROTOC_ARGS=--go_out=${PROTO_INTERMEDIATE_DIR}/out GRPC_PROTOC_ARGS=--go-grpc_out=${PROTO_INTERMEDIATE_DIR}/out +PROTO_VERSION=$(shell grep -P deep-proto go.mod | cut -d ' ' -f2 | cut -c2-) + .PHONY: gen-proto gen-proto: @echo -- @@ -128,10 +130,11 @@ gen-proto: find pkg/deeppb -name *.proto | grep -v deep.proto | grep -v frontend.proto | xargs -L 1 -I rm @echo -- + @echo -- Using proto version $(PROTO_VERSION) @echo -- Copying to $(PROTO_INTERMEDIATE_DIR) @echo -- git submodule update --init - cd deep-proto && git pull origin master + cd deep-proto && git checkout tags/$(PROTO_VERSION) mkdir -p $(PROTO_INTERMEDIATE_DIR) mkdir -p $(PROTO_INTERMEDIATE_DIR)/out mkdir -p $(PROTO_INTERMEDIATE_DIR)/stats From e62cc7699137546b76c55bd052f7d1d819035f2a Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 15:25:04 +0000 Subject: [PATCH 6/9] fix(build): correct fmt errors --- pkg/deepdb/encoding/vparquet/schema.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/deepdb/encoding/vparquet/schema.go b/pkg/deepdb/encoding/vparquet/schema.go index 11c80af..a20c037 100644 --- a/pkg/deepdb/encoding/vparquet/schema.go +++ b/pkg/deepdb/encoding/vparquet/schema.go @@ -453,7 +453,6 @@ func convertMetricLabel(label *deepTP.LabelExpression) LabelExpression { } func anyValueToString(static *deepCommon.AnyValue) string { - switch v := static.Value.(type) { case *deepCommon.AnyValue_StringValue: return v.StringValue @@ -537,7 +536,6 @@ func parquetConvertLabelExpression(labels []LabelExpression) []*deepTP.LabelExpr Value: &deepTP.LabelExpression_Static{Static: &deepCommon.AnyValue{Value: &deepCommon.AnyValue_StringValue{StringValue: label.Static}}}, // todo: how to support other types } } else { - labelExpressions[i] = &deepTP.LabelExpression{ Key: label.Key, Value: &deepTP.LabelExpression_Expression{Expression: label.Expression}, From 5b64d3c0e33fd2a48eefc1742790e492e482d25d Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 15:35:06 +0000 Subject: [PATCH 7/9] chore(proto): update proto to 1.0.5 --- pkg/deeppb/tracepoint/v1/tracepoint.pb.go | 46 ++++++++++++----------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/pkg/deeppb/tracepoint/v1/tracepoint.pb.go b/pkg/deeppb/tracepoint/v1/tracepoint.pb.go index e283897..49827fd 100644 --- a/pkg/deeppb/tracepoint/v1/tracepoint.pb.go +++ b/pkg/deeppb/tracepoint/v1/tracepoint.pb.go @@ -93,9 +93,10 @@ func (MetricType) EnumDescriptor() ([]byte, []int) { type WatchSource int32 const ( - WatchSource_WATCH WatchSource = 0 // A user attached this as an expression - WatchSource_LOG WatchSource = 1 // A watch expression from a log - WatchSource_METRIC WatchSource = 2 // A watch expression from a metric value or tag + WatchSource_WATCH WatchSource = 0 // A user attached this as an expression + WatchSource_LOG WatchSource = 1 // A watch expression from a log + WatchSource_METRIC WatchSource = 2 // A watch expression from a metric value or tag + WatchSource_CAPTURE WatchSource = 3 // A watch expression generated from a capture: e.g. thrown, return, duration ) // Enum value maps for WatchSource. @@ -104,11 +105,13 @@ var ( 0: "WATCH", 1: "LOG", 2: "METRIC", + 3: "CAPTURE", } WatchSource_value = map[string]int32{ - "WATCH": 0, - "LOG": 1, - "METRIC": 2, + "WATCH": 0, + "LOG": 1, + "METRIC": 2, + "CAPTURE": 3, } ) @@ -1167,23 +1170,24 @@ var file_tracepoint_v1_tracepoint_proto_rawDesc = []byte{ 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x02, - 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x03, 0x2a, 0x2d, 0x0a, + 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x03, 0x2a, 0x3a, 0x0a, 0x0b, 0x57, 0x61, 0x74, 0x63, 0x68, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x41, 0x54, 0x43, 0x48, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x47, 0x10, 0x01, - 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x02, 0x32, 0x63, 0x0a, 0x0f, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x50, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, - 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, - 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x5e, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, - 0x61, 0x6c, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, - 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x32, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, - 0x72, 0x61, 0x6c, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x65, - 0x70, 0x70, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, + 0x43, 0x41, 0x50, 0x54, 0x55, 0x52, 0x45, 0x10, 0x03, 0x32, 0x63, 0x0a, 0x0f, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x04, + 0x73, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x5e, + 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, 0x61, 0x6c, 0x2e, + 0x64, 0x65, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x67, 0x72, 0x61, 0x6c, + 0x2f, 0x64, 0x65, 0x65, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x65, 0x70, 0x70, 0x62, + 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 589615750f7e0a00e9d2b13508fa180c0c2e0f25 Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 15:50:01 +0000 Subject: [PATCH 8/9] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ceb250..21db5d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ -# 1.0.4 (04/12/2024) +# 1.0.4 (04/12/2023) - **[BUGFIX]**: compactor loop was not running [#76](https://github.com/intergral/deep/pull/76) [@Umaaz](https://github.com/Umaaz) From cdde13e0ad04dde52247ba3be62051005c2d901f Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Thu, 8 Feb 2024 15:50:22 +0000 Subject: [PATCH 9/9] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21db5d8..4eb0d33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ # 1.0.4 (04/12/2023) - **[BUGFIX]**: compactor loop was not running [#76](https://github.com/intergral/deep/pull/76) [@Umaaz](https://github.com/Umaaz) - + # 1.0.3 (30/11/2023)