From e00beb4a94c6b860dce53af2051a504d7f8c4f77 Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:48:16 +0000 Subject: [PATCH] Mirrored from envoyproxy/envoy @ 838f27200ddca87f4c2cb2adcc4d25f5741f4a82 Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- .../samplers/v3/dynatrace_sampler.pb.go | 101 +++++++++--------- .../v3/dynatrace_sampler.pb.validate.go | 12 +-- .../v3/dynatrace_sampler_vtproto.pb.go | 25 ++--- 4 files changed, 62 insertions(+), 78 deletions(-) diff --git a/envoy/COMMIT b/envoy/COMMIT index 98aab0535c..fdac18d37d 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -34d67fc5c046527b25f37b2ae06dd6ee8e41ceae +838f27200ddca87f4c2cb2adcc4d25f5741f4a82 diff --git a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.go b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.go index 43730301f7..3cef2bf306 100755 --- a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.go +++ b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.go @@ -22,7 +22,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// [#next-free-field: 6] +// Configuration for the Dynatrace Sampler extension. +// [#extension: envoy.tracers.opentelemetry.samplers.dynatrace] type DynatraceSamplerConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -36,24 +37,27 @@ type DynatraceSamplerConfig struct { // // The value can be obtained from the Envoy deployment page in Dynatrace. ClusterId int32 `protobuf:"varint,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // The HTTP URI to fetch the sampler configuration (root spans per minute). For example: + // The HTTP service to fetch the sampler configuration from the Dynatrace API (root spans per minute). For example: // // .. code-block:: yaml // - // http_uri: - // uri: .dev.dynatracelabs.com/api/v2/samplingConfiguration - // cluster: dynatrace - // timeout: 10s - HttpUri *v3.HttpUri `protobuf:"bytes,3,opt,name=http_uri,json=httpUri,proto3" json:"http_uri,omitempty"` - // The access token to fetch the sampling configuration from the Dynatrace API - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + // http_service: + // http_uri: + // cluster: dynatrace + // uri: .dev.dynatracelabs.com/api/v2/samplingConfiguration + // timeout: 10s + // request_headers_to_add: + // - header: + // key : "authorization" + // value: "Api-Token dt..." + HttpService *v3.HttpService `protobuf:"bytes,3,opt,name=http_service,json=httpService,proto3" json:"http_service,omitempty"` // Default number of root spans per minute, used when the value can't be obtained from the Dynatrace API. // // A default value of “1000“ is used when: // // - “root_spans_per_minute“ is unset // - “root_spans_per_minute“ is set to 0 - RootSpansPerMinute uint32 `protobuf:"varint,5,opt,name=root_spans_per_minute,json=rootSpansPerMinute,proto3" json:"root_spans_per_minute,omitempty"` + RootSpansPerMinute uint32 `protobuf:"varint,4,opt,name=root_spans_per_minute,json=rootSpansPerMinute,proto3" json:"root_spans_per_minute,omitempty"` } func (x *DynatraceSamplerConfig) Reset() { @@ -102,20 +106,13 @@ func (x *DynatraceSamplerConfig) GetClusterId() int32 { return 0 } -func (x *DynatraceSamplerConfig) GetHttpUri() *v3.HttpUri { +func (x *DynatraceSamplerConfig) GetHttpService() *v3.HttpService { if x != nil { - return x.HttpUri + return x.HttpService } return nil } -func (x *DynatraceSamplerConfig) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - func (x *DynatraceSamplerConfig) GetRootSpansPerMinute() uint32 { if x != nil { return x.RootSpansPerMinute @@ -134,37 +131,37 @@ var file_envoy_extensions_tracers_opentelemetry_samplers_v3_dynatrace_sampler_pr 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x33, - 0x1a, 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x75, 0x72, 0x69, 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, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x16, 0x44, 0x79, 0x6e, 0x61, 0x74, 0x72, 0x61, - 0x63, 0x65, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x08, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x75, - 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, - 0x48, 0x74, 0x74, 0x70, 0x55, 0x72, 0x69, 0x52, 0x07, 0x68, 0x74, 0x74, 0x70, 0x55, 0x72, 0x69, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x31, 0x0a, 0x15, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x73, - 0x70, 0x61, 0x6e, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x72, 0x6f, 0x6f, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x73, - 0x50, 0x65, 0x72, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x42, 0xc9, 0x01, 0xba, 0x80, 0xc8, 0xd1, - 0x06, 0x02, 0x10, 0x02, 0x0a, 0x40, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 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, 0x6f, 0x70, 0x65, - 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x72, 0x73, 0x2e, 0x76, 0x33, 0x42, 0x15, 0x44, 0x79, 0x6e, 0x61, 0x74, 0x72, 0x61, 0x63, - 0x65, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x64, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, - 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x73, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x72, 0x73, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 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, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x01, 0x0a, 0x16, 0x44, 0x79, 0x6e, + 0x61, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x31, 0x0a, 0x15, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x12, 0x72, 0x6f, 0x6f, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x50, 0x65, 0x72, 0x4d, 0x69, 0x6e, + 0x75, 0x74, 0x65, 0x42, 0xc9, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x40, + 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 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, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x33, + 0x42, 0x15, 0x44, 0x79, 0x6e, 0x61, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x64, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, + 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x73, 0x76, 0x33, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -182,10 +179,10 @@ func file_envoy_extensions_tracers_opentelemetry_samplers_v3_dynatrace_sampler_p var file_envoy_extensions_tracers_opentelemetry_samplers_v3_dynatrace_sampler_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_envoy_extensions_tracers_opentelemetry_samplers_v3_dynatrace_sampler_proto_goTypes = []interface{}{ (*DynatraceSamplerConfig)(nil), // 0: envoy.extensions.tracers.opentelemetry.samplers.v3.DynatraceSamplerConfig - (*v3.HttpUri)(nil), // 1: envoy.config.core.v3.HttpUri + (*v3.HttpService)(nil), // 1: envoy.config.core.v3.HttpService } var file_envoy_extensions_tracers_opentelemetry_samplers_v3_dynatrace_sampler_proto_depIdxs = []int32{ - 1, // 0: envoy.extensions.tracers.opentelemetry.samplers.v3.DynatraceSamplerConfig.http_uri:type_name -> envoy.config.core.v3.HttpUri + 1, // 0: envoy.extensions.tracers.opentelemetry.samplers.v3.DynatraceSamplerConfig.http_service:type_name -> envoy.config.core.v3.HttpService 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.validate.go b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.validate.go index 14500f14b1..965a755430 100755 --- a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.validate.go +++ b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler.pb.validate.go @@ -63,11 +63,11 @@ func (m *DynatraceSamplerConfig) validate(all bool) error { // no validation rules for ClusterId if all { - switch v := interface{}(m.GetHttpUri()).(type) { + switch v := interface{}(m.GetHttpService()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, DynatraceSamplerConfigValidationError{ - field: "HttpUri", + field: "HttpService", reason: "embedded message failed validation", cause: err, }) @@ -75,24 +75,22 @@ func (m *DynatraceSamplerConfig) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, DynatraceSamplerConfigValidationError{ - field: "HttpUri", + field: "HttpService", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetHttpUri()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetHttpService()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DynatraceSamplerConfigValidationError{ - field: "HttpUri", + field: "HttpService", reason: "embedded message failed validation", cause: err, } } } - // no validation rules for Token - // no validation rules for RootSpansPerMinute if len(errors) > 0 { diff --git a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler_vtproto.pb.go b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler_vtproto.pb.go index 7d9b552724..046101adff 100755 --- a/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler_vtproto.pb.go +++ b/envoy/extensions/tracers/opentelemetry/samplers/v3/dynatrace_sampler_vtproto.pb.go @@ -50,17 +50,10 @@ func (m *DynatraceSamplerConfig) MarshalToSizedBufferVTStrict(dAtA []byte) (int, if m.RootSpansPerMinute != 0 { i = encodeVarint(dAtA, i, uint64(m.RootSpansPerMinute)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarint(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x22 - } - if m.HttpUri != nil { - if vtmsg, ok := interface{}(m.HttpUri).(interface { + if m.HttpService != nil { + if vtmsg, ok := interface{}(m.HttpService).(interface { MarshalToSizedBufferVTStrict([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) @@ -70,7 +63,7 @@ func (m *DynatraceSamplerConfig) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i -= size i = encodeVarint(dAtA, i, uint64(size)) } else { - encoded, err := proto.Marshal(m.HttpUri) + encoded, err := proto.Marshal(m.HttpService) if err != nil { return 0, err } @@ -109,20 +102,16 @@ func (m *DynatraceSamplerConfig) SizeVT() (n int) { if m.ClusterId != 0 { n += 1 + sov(uint64(m.ClusterId)) } - if m.HttpUri != nil { - if size, ok := interface{}(m.HttpUri).(interface { + if m.HttpService != nil { + if size, ok := interface{}(m.HttpService).(interface { SizeVT() int }); ok { l = size.SizeVT() } else { - l = proto.Size(m.HttpUri) + l = proto.Size(m.HttpService) } n += 1 + l + sov(uint64(l)) } - l = len(m.Token) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } if m.RootSpansPerMinute != 0 { n += 1 + sov(uint64(m.RootSpansPerMinute)) }