From ceb5c6a47edd9530cb28e02992c2f81d838bf15b Mon Sep 17 00:00:00 2001 From: soloio-bot Date: Thu, 10 Oct 2024 22:29:38 +0000 Subject: [PATCH] Sync Gloo APIs. Destination Branch: gloo-main --- .../envoy/config/trace/v3/datadog.proto | 24 ++ .../envoy/config/trace/v3/datadog.pb.clone.go | 33 +++ .../envoy/config/trace/v3/datadog.pb.equal.go | 58 +++++ .../envoy/config/trace/v3/datadog.pb.go | 221 ++++++++++++++---- .../envoy/config/trace/v3/datadog.pb.hash.go | 80 +++++++ 5 files changed, 367 insertions(+), 49 deletions(-) diff --git a/api/gloo/gloo/external/envoy/config/trace/v3/datadog.proto b/api/gloo/gloo/external/envoy/config/trace/v3/datadog.proto index cd533f247..c34861603 100644 --- a/api/gloo/gloo/external/envoy/config/trace/v3/datadog.proto +++ b/api/gloo/gloo/external/envoy/config/trace/v3/datadog.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package solo.io.envoy.config.trace.v3; import "google/protobuf/wrappers.proto"; +import "google/protobuf/duration.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; @@ -19,6 +20,18 @@ option (solo.io.udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Datadog tracer] +// Configuration for the Remote Configuration feature. +message DatadogRemoteConfig { + // Frequency at which new configuration updates are queried. + // If no value is provided, the default value is delegated to the Datadog tracing library. + google.protobuf.Duration polling_interval = 1; + + // Disabled remote config. + // This field does not exist in envoy's config but allow us to preserve the default behavior + // when upgrading to envoy v1.31 + google.protobuf.BoolValue disabled = 2; +} + // Configuration for the Datadog tracer. // [#extension: envoy.tracers.datadog] message DatadogConfig { @@ -38,6 +51,17 @@ message DatadogConfig { // The name used for the service when traces are generated by envoy. google.protobuf.StringValue service_name = 2 [(validate.rules).string = {min_len: 1}]; + + // Optional hostname to use when sending spans to the collector_cluster. Useful for collectors + // that require a specific hostname. Defaults to :ref:`collector_cluster ` above. + string collector_hostname = 4; + + // Configures remote configuration. + // Remote Configuration allows to configure the tracer from Datadog's user interface. + // This feature can drastically increase the number of connections to the Datadog Agent. + // Each tracer regularly polls for configuration updates, and the number of tracers is the product + // of the number of listeners and worker threads. + DatadogRemoteConfig remote_config = 5; } option go_package = "github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/external/envoy/config/trace/v3"; import "extproto/ext.proto"; diff --git a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.clone.go b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.clone.go index debf97130..7357eb4b7 100644 --- a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.clone.go +++ b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.clone.go @@ -13,6 +13,8 @@ import ( "github.com/solo-io/protoc-gen-ext/pkg/clone" "google.golang.org/protobuf/proto" + github_com_golang_protobuf_ptypes_duration "github.com/golang/protobuf/ptypes/duration" + github_com_golang_protobuf_ptypes_wrappers "github.com/golang/protobuf/ptypes/wrappers" github_com_solo_io_solo_kit_pkg_api_v1_resources_core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core" @@ -29,6 +31,29 @@ var ( _ = proto.Message(nil) ) +// Clone function +func (m *DatadogRemoteConfig) Clone() proto.Message { + var target *DatadogRemoteConfig + if m == nil { + return target + } + target = &DatadogRemoteConfig{} + + if h, ok := interface{}(m.GetPollingInterval()).(clone.Cloner); ok { + target.PollingInterval = h.Clone().(*github_com_golang_protobuf_ptypes_duration.Duration) + } else { + target.PollingInterval = proto.Clone(m.GetPollingInterval()).(*github_com_golang_protobuf_ptypes_duration.Duration) + } + + if h, ok := interface{}(m.GetDisabled()).(clone.Cloner); ok { + target.Disabled = h.Clone().(*github_com_golang_protobuf_ptypes_wrappers.BoolValue) + } else { + target.Disabled = proto.Clone(m.GetDisabled()).(*github_com_golang_protobuf_ptypes_wrappers.BoolValue) + } + + return target +} + // Clone function func (m *DatadogConfig) Clone() proto.Message { var target *DatadogConfig @@ -43,6 +68,14 @@ func (m *DatadogConfig) Clone() proto.Message { target.ServiceName = proto.Clone(m.GetServiceName()).(*github_com_golang_protobuf_ptypes_wrappers.StringValue) } + target.CollectorHostname = m.GetCollectorHostname() + + if h, ok := interface{}(m.GetRemoteConfig()).(clone.Cloner); ok { + target.RemoteConfig = h.Clone().(*DatadogRemoteConfig) + } else { + target.RemoteConfig = proto.Clone(m.GetRemoteConfig()).(*DatadogRemoteConfig) + } + switch m.CollectorCluster.(type) { case *DatadogConfig_CollectorUpstreamRef: diff --git a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.equal.go b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.equal.go index 1004b2965..9cc11d686 100644 --- a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.equal.go +++ b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.equal.go @@ -25,6 +25,50 @@ var ( _ = proto.Message(nil) ) +// Equal function +func (m *DatadogRemoteConfig) Equal(that interface{}) bool { + if that == nil { + return m == nil + } + + target, ok := that.(*DatadogRemoteConfig) + if !ok { + that2, ok := that.(DatadogRemoteConfig) + if ok { + target = &that2 + } else { + return false + } + } + if target == nil { + return m == nil + } else if m == nil { + return false + } + + if h, ok := interface{}(m.GetPollingInterval()).(equality.Equalizer); ok { + if !h.Equal(target.GetPollingInterval()) { + return false + } + } else { + if !proto.Equal(m.GetPollingInterval(), target.GetPollingInterval()) { + return false + } + } + + if h, ok := interface{}(m.GetDisabled()).(equality.Equalizer); ok { + if !h.Equal(target.GetDisabled()) { + return false + } + } else { + if !proto.Equal(m.GetDisabled(), target.GetDisabled()) { + return false + } + } + + return true +} + // Equal function func (m *DatadogConfig) Equal(that interface{}) bool { if that == nil { @@ -56,6 +100,20 @@ func (m *DatadogConfig) Equal(that interface{}) bool { } } + if strings.Compare(m.GetCollectorHostname(), target.GetCollectorHostname()) != 0 { + return false + } + + if h, ok := interface{}(m.GetRemoteConfig()).(equality.Equalizer); ok { + if !h.Equal(target.GetRemoteConfig()) { + return false + } + } else { + if !proto.Equal(m.GetRemoteConfig(), target.GetRemoteConfig()) { + return false + } + } + switch m.CollectorCluster.(type) { case *DatadogConfig_CollectorUpstreamRef: diff --git a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.go b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.go index 12050ca02..0bab6bacf 100644 --- a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.go +++ b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.go @@ -11,6 +11,7 @@ import ( sync "sync" _ "github.com/envoyproxy/protoc-gen-validate/validate" + duration "github.com/golang/protobuf/ptypes/duration" wrappers "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/solo-io/protoc-gen-ext/extproto" _ "github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/external/udpa/annotations" @@ -26,6 +27,67 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Configuration for the Remote Configuration feature. +type DatadogRemoteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Frequency at which new configuration updates are queried. + // If no value is provided, the default value is delegated to the Datadog tracing library. + PollingInterval *duration.Duration `protobuf:"bytes,1,opt,name=polling_interval,json=pollingInterval,proto3" json:"polling_interval,omitempty"` + // Disabled remote config. + // This field does not exist in envoy's config but allow us to preserve the default behavior + // when upgrading to envoy v1.31 + Disabled *wrappers.BoolValue `protobuf:"bytes,2,opt,name=disabled,proto3" json:"disabled,omitempty"` +} + +func (x *DatadogRemoteConfig) Reset() { + *x = DatadogRemoteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DatadogRemoteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DatadogRemoteConfig) ProtoMessage() {} + +func (x *DatadogRemoteConfig) ProtoReflect() protoreflect.Message { + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DatadogRemoteConfig.ProtoReflect.Descriptor instead. +func (*DatadogRemoteConfig) Descriptor() ([]byte, []int) { + return file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_rawDescGZIP(), []int{0} +} + +func (x *DatadogRemoteConfig) GetPollingInterval() *duration.Duration { + if x != nil { + return x.PollingInterval + } + return nil +} + +func (x *DatadogRemoteConfig) GetDisabled() *wrappers.BoolValue { + if x != nil { + return x.Disabled + } + return nil +} + // Configuration for the Datadog tracer. // [#extension: envoy.tracers.datadog] type DatadogConfig struct { @@ -42,12 +104,21 @@ type DatadogConfig struct { CollectorCluster isDatadogConfig_CollectorCluster `protobuf_oneof:"collector_cluster"` // The name used for the service when traces are generated by envoy. ServiceName *wrappers.StringValue `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + // Optional hostname to use when sending spans to the collector_cluster. Useful for collectors + // that require a specific hostname. Defaults to :ref:`collector_cluster ` above. + CollectorHostname string `protobuf:"bytes,4,opt,name=collector_hostname,json=collectorHostname,proto3" json:"collector_hostname,omitempty"` + // Configures remote configuration. + // Remote Configuration allows to configure the tracer from Datadog's user interface. + // This feature can drastically increase the number of connections to the Datadog Agent. + // Each tracer regularly polls for configuration updates, and the number of tracers is the product + // of the number of listeners and worker threads. + RemoteConfig *DatadogRemoteConfig `protobuf:"bytes,5,opt,name=remote_config,json=remoteConfig,proto3" json:"remote_config,omitempty"` } func (x *DatadogConfig) Reset() { *x = DatadogConfig{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -60,7 +131,7 @@ func (x *DatadogConfig) String() string { func (*DatadogConfig) ProtoMessage() {} func (x *DatadogConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -73,7 +144,7 @@ func (x *DatadogConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use DatadogConfig.ProtoReflect.Descriptor instead. func (*DatadogConfig) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_rawDescGZIP(), []int{0} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_rawDescGZIP(), []int{1} } func (m *DatadogConfig) GetCollectorCluster() isDatadogConfig_CollectorCluster { @@ -104,6 +175,20 @@ func (x *DatadogConfig) GetServiceName() *wrappers.StringValue { return nil } +func (x *DatadogConfig) GetCollectorHostname() string { + if x != nil { + return x.CollectorHostname + } + return "" +} + +func (x *DatadogConfig) GetRemoteConfig() *DatadogRemoteConfig { + if x != nil { + return x.RemoteConfig + } + return nil +} + type isDatadogConfig_CollectorCluster interface { isDatadogConfig_CollectorCluster() } @@ -136,7 +221,9 @@ var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_ 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, @@ -148,38 +235,56 @@ var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_ 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x02, 0x0a, 0x0d, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, - 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x72, 0x65, - 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x73, - 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x66, 0x48, 0x00, 0x52, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x55, - 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x66, 0x12, 0x23, 0x0a, 0x0c, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x48, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x2b, 0x8a, 0xc8, 0xde, 0x8e, 0x04, - 0x25, 0x0a, 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x13, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0xd3, 0x01, 0xb8, 0xf5, - 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x82, 0x8a, 0xd7, 0xad, 0x04, 0x2a, - 0x12, 0x28, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, - 0x6f, 0x67, 0x2e, 0x76, 0x34, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0xb5, 0xdf, 0xcb, 0x07, 0x02, - 0x10, 0x02, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x33, 0x42, - 0x0c, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, - 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, - 0x69, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, - 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x01, 0x0a, 0x13, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, + 0x10, 0x70, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0f, 0x70, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x9b, 0x03, 0x0a, 0x0d, + 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x51, 0x0a, + 0x16, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x48, 0x00, 0x52, 0x14, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x66, + 0x12, 0x23, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x73, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x57, + 0x0a, 0x0d, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x2b, 0x8a, 0xc8, 0xde, 0x8e, 0x04, 0x25, 0x0a, + 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x42, 0x13, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0xd3, 0x01, 0xb8, 0xf5, 0x04, 0x01, + 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x82, 0x8a, 0xd7, 0xad, 0x04, 0x2a, 0x12, 0x28, + 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, + 0x2e, 0x76, 0x34, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0xb5, 0xdf, 0xcb, 0x07, 0x02, 0x10, 0x02, + 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x44, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, + 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, + 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x33, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -194,20 +299,26 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace return file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_rawDescData } -var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_goTypes = []interface{}{ - (*DatadogConfig)(nil), // 0: solo.io.envoy.config.trace.v3.DatadogConfig - (*core.ResourceRef)(nil), // 1: core.solo.io.ResourceRef - (*wrappers.StringValue)(nil), // 2: google.protobuf.StringValue + (*DatadogRemoteConfig)(nil), // 0: solo.io.envoy.config.trace.v3.DatadogRemoteConfig + (*DatadogConfig)(nil), // 1: solo.io.envoy.config.trace.v3.DatadogConfig + (*duration.Duration)(nil), // 2: google.protobuf.Duration + (*wrappers.BoolValue)(nil), // 3: google.protobuf.BoolValue + (*core.ResourceRef)(nil), // 4: core.solo.io.ResourceRef + (*wrappers.StringValue)(nil), // 5: google.protobuf.StringValue } var file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_depIdxs = []int32{ - 1, // 0: solo.io.envoy.config.trace.v3.DatadogConfig.collector_upstream_ref:type_name -> core.solo.io.ResourceRef - 2, // 1: solo.io.envoy.config.trace.v3.DatadogConfig.service_name:type_name -> google.protobuf.StringValue - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 2, // 0: solo.io.envoy.config.trace.v3.DatadogRemoteConfig.polling_interval:type_name -> google.protobuf.Duration + 3, // 1: solo.io.envoy.config.trace.v3.DatadogRemoteConfig.disabled:type_name -> google.protobuf.BoolValue + 4, // 2: solo.io.envoy.config.trace.v3.DatadogConfig.collector_upstream_ref:type_name -> core.solo.io.ResourceRef + 5, // 3: solo.io.envoy.config.trace.v3.DatadogConfig.service_name:type_name -> google.protobuf.StringValue + 0, // 4: solo.io.envoy.config.trace.v3.DatadogConfig.remote_config:type_name -> solo.io.envoy.config.trace.v3.DatadogRemoteConfig + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { @@ -219,6 +330,18 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace } if !protoimpl.UnsafeEnabled { file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatadogRemoteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DatadogConfig); i { case 0: return &v.state @@ -231,7 +354,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace } } } - file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_msgTypes[1].OneofWrappers = []interface{}{ (*DatadogConfig_CollectorUpstreamRef)(nil), (*DatadogConfig_ClusterName)(nil), } @@ -241,7 +364,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_solo_io_solo_apis_api_gloo_gloo_external_envoy_config_trace_v3_datadog_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.hash.go b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.hash.go index 5b41710a5..c74cc0084 100644 --- a/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.hash.go +++ b/pkg/api/gloo.solo.io/external/envoy/config/trace/v3/datadog.pb.hash.go @@ -25,6 +25,62 @@ var ( _ = new(safe_hasher.SafeHasher) ) +// Hash function +func (m *DatadogRemoteConfig) Hash(hasher hash.Hash64) (uint64, error) { + if m == nil { + return 0, nil + } + if hasher == nil { + hasher = fnv.New64() + } + var err error + if _, err = hasher.Write([]byte("solo.io.envoy.config.trace.v3.github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/external/envoy/config/trace/v3.DatadogRemoteConfig")); err != nil { + return 0, err + } + + if h, ok := interface{}(m.GetPollingInterval()).(safe_hasher.SafeHasher); ok { + if _, err = hasher.Write([]byte("PollingInterval")); err != nil { + return 0, err + } + if _, err = h.Hash(hasher); err != nil { + return 0, err + } + } else { + if fieldValue, err := hashstructure.Hash(m.GetPollingInterval(), nil); err != nil { + return 0, err + } else { + if _, err = hasher.Write([]byte("PollingInterval")); err != nil { + return 0, err + } + if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil { + return 0, err + } + } + } + + if h, ok := interface{}(m.GetDisabled()).(safe_hasher.SafeHasher); ok { + if _, err = hasher.Write([]byte("Disabled")); err != nil { + return 0, err + } + if _, err = h.Hash(hasher); err != nil { + return 0, err + } + } else { + if fieldValue, err := hashstructure.Hash(m.GetDisabled(), nil); err != nil { + return 0, err + } else { + if _, err = hasher.Write([]byte("Disabled")); err != nil { + return 0, err + } + if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil { + return 0, err + } + } + } + + return hasher.Sum64(), nil +} + // Hash function func (m *DatadogConfig) Hash(hasher hash.Hash64) (uint64, error) { if m == nil { @@ -58,6 +114,30 @@ func (m *DatadogConfig) Hash(hasher hash.Hash64) (uint64, error) { } } + if _, err = hasher.Write([]byte(m.GetCollectorHostname())); err != nil { + return 0, err + } + + if h, ok := interface{}(m.GetRemoteConfig()).(safe_hasher.SafeHasher); ok { + if _, err = hasher.Write([]byte("RemoteConfig")); err != nil { + return 0, err + } + if _, err = h.Hash(hasher); err != nil { + return 0, err + } + } else { + if fieldValue, err := hashstructure.Hash(m.GetRemoteConfig(), nil); err != nil { + return 0, err + } else { + if _, err = hasher.Write([]byte("RemoteConfig")); err != nil { + return 0, err + } + if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil { + return 0, err + } + } + } + switch m.CollectorCluster.(type) { case *DatadogConfig_CollectorUpstreamRef: