From 4da9754cfb7ce43a07aabe76121090a302eaf17a Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sat, 6 Apr 2024 00:08:49 +0530 Subject: [PATCH 01/22] add more grpc config options Signed-off-by: Harshvir Potpose --- cmd/remote-storage/app/server.go | 1 + go.mod | 9 +- go.sum | 160 +-------------------------- plugin/storage/grpc/config/config.go | 44 ++++++++ 4 files changed, 51 insertions(+), 163 deletions(-) diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go index ecc29f0ff9b..1c133aba1fd 100644 --- a/cmd/remote-storage/app/server.go +++ b/cmd/remote-storage/app/server.go @@ -22,6 +22,7 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + _ "google.golang.org/grpc/encoding" "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" diff --git a/go.mod b/go.mod index b20d6a87dab..e94b2934cf0 100644 --- a/go.mod +++ b/go.mod @@ -115,7 +115,6 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect - github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect @@ -152,7 +151,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.2.2 // indirect + github.com/mostynb/go-grpc-compression v1.2.2 github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.97.0 // indirect @@ -206,9 +205,9 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.97.0 // indirect go.opentelemetry.io/collector/config/configauth v0.97.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.4.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.4.0 go.opentelemetry.io/collector/config/confignet v0.97.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.4.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.4.0 go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect go.opentelemetry.io/collector/config/internal v0.97.0 // indirect go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0 // indirect @@ -221,7 +220,7 @@ require ( go.opentelemetry.io/collector/extension/auth v0.97.0 // indirect go.opentelemetry.io/collector/featuregate v1.4.0 // indirect go.opentelemetry.io/collector/semconv v0.97.0 // indirect - go.opentelemetry.io/collector/service v0.97.0 // indirect + go.opentelemetry.io/collector/service v0.97.0 go.opentelemetry.io/contrib/config v0.4.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.24.0 // indirect go.opentelemetry.io/contrib/zpages v0.49.0 // indirect diff --git a/go.sum b/go.sum index 6f2f224115e..f7c3c3e4f13 100644 --- a/go.sum +++ b/go.sum @@ -15,15 +15,11 @@ github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoH github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= -github.com/apache/thrift v0.19.0/go.mod h1:SUALL216IiaOw2Oy+5Vs9lboJ/t9g40C+G07Dc0QC1I= github.com/apache/thrift v0.20.0 h1:631+KvYbsBZxmuJjYwhezVsrfc/TbqtZV4QcxOX1fOI= github.com/apache/thrift v0.20.0/go.mod h1:hOk1BQqcp2OLzGsyVXdfMk7YFlMxK3aoEVhjD06QhB8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA= -github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.51.7 h1:RRjxHhx9RCjw5AhgpmmShq3F4JDlleSkyhYMQ2xUAe8= github.com/aws/aws-sdk-go v1.51.7/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -37,8 +33,6 @@ github.com/bsm/sarama-cluster v2.1.13+incompatible h1:bqU3gMJbWZVxLZ9PGWVKP05yOm github.com/bsm/sarama-cluster v2.1.13+incompatible/go.mod h1:r7ao+4tTNXvWm+VRpRJchr2kQhqxgmAp2iEX5W96gMM= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -89,8 +83,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/expr-lang/expr v1.16.1 h1:Na8CUcMdyGbnNpShY7kzcHCU7WqxuL+hnxgHZ4vaz/A= -github.com/expr-lang/expr v1.16.1/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= github.com/expr-lang/expr v1.16.2 h1:JvMnzUs3LeVHBvGFcXYmXo+Q6DPDmzrlcSBO6Wy3w4s= github.com/expr-lang/expr v1.16.2/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -154,9 +146,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -171,7 +160,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -194,8 +182,6 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0Q github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/haimrubinstein/go-syslog/v3 v3.0.0 h1:wuTrxJE60wx2pfwdERdbLNlcXEk3hk1MPagAaD2fq2g= -github.com/haimrubinstein/go-syslog/v3 v3.0.0/go.mod h1:/IKKpe5PS9pB5vJY1APQQM0ZPBrm95HWE1SQwsXWmVI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -220,7 +206,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/go-syslog/v3 v3.0.0/go.mod h1:tulsOp+CecTAYC27u9miMgq21GqXRW6VdKbOG+QSP4Q= github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 h1:2r2WiFeAwiJ/uyx1qIKnV1L4C9w/2V8ehlbJY4gjFaM= github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4/go.mod h1:1yEQhaLb/cETXCqQmdh7lDjupNAReO7c83AHyK2dJ48= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -328,102 +313,54 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.96.0 h1:KAlAzuzvYq0xZWRR+N2qUJhE7/pvmNFYlcN5yW8Km60= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.96.0/go.mod h1:KcZjtSdoelUWRwGtVaiEX16Hw8mFH+JnYrN+r4Ox550= github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.97.0 h1:GHoDUZN2H4IQzE14IO6m8X12dgk4y6pI1OWeqUKQr5c= github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.97.0/go.mod h1:KeFJu9BR7NtI1IKzKqO1i1gwcSYeQgctkMPNqt7gJNM= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.96.0 h1:2FnXGN9xxIcIz7f4hdX+OgsGowWC1D35oNtX5ErnLBc= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.96.0/go.mod h1:VPyawEuVpqKg3oemeDnYwDfBbh9gjGbrVVXl4OeHK60= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.97.0 h1:8GH8y3Cq54Ey6He9tyhcVYLfG4TEs/7pp3s6934zNKA= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.97.0/go.mod h1:QBHXt+tHds39B4xGyBkbOx2TST+p8JLWBiXbKKAhNss= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.96.0 h1:nUvVFQDNDPsItUcYYXZcbcOSv65lVai4uGHBr1czaxk= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.96.0/go.mod h1:efM1kx1r7SrEEmEexQjhn69KZZSS4JSTJG+BSAgLMVI= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.97.0 h1:m8Q0Kz5uKW+8wYtkjeu3s/AQ4y7+lbZDKXnSDMnUV2k= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.97.0/go.mod h1:/i2jmL/rPyLT4w6g4KtN9gNAL/Cy1ry9WsszKPkAipE= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.96.0 h1:ruhy+EGMxhFZ8XfA6QOFjpZeI8HRY8vmibEIo0v3mAg= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.96.0/go.mod h1:UDKAMXjliMiikHBuuTwmINCKODXgOQKzdAkG+LwiprM= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.97.0 h1:mRVgGq9AesW/1nucHaGPZR5YVLFvlSlBE3Ja+YvnRMk= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.97.0/go.mod h1:b2Lgyg0/PkkCpktXV/3OMuDJRNr37kROP1m+zcJrphg= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.96.0 h1:iymE+KruqfZlCnUOzz8PtMrQ4zFtYlMmhB0zhAVLlE4= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.96.0/go.mod h1:+p3Y9GdIlG7SbkiUoUUoePDnxxLOcMXSyX86ibTmN1U= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.97.0 h1:WGRSjhOYfW/NCseia4Av8s4q65vZmM66WJPw8ocjU1I= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.97.0/go.mod h1:3QaZO29iFAiW+wCjQ3pI7yFn+lcQB5VLfPjbyBx9ThA= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.96.0 h1:7ZLtvso1fCli8/Bhk2ib0c0/iT4OacRPcx8e6j74ClY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.96.0/go.mod h1:hcpQL/YtUYT4XF8Q6xzhW0n1GjvT5ewRF3I8uKoxTdI= github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.97.0 h1:p7ANWW52nAKp9+f7RgGZvvXqU80rZu6yXVdSvcrgta0= github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.97.0/go.mod h1:eLeuqRgW59hKeKdSdD2mNOs64yBKuxyp6udwgToUxjE= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.96.0 h1:uG8YgKM932zjruNwAicIKrGpW09bt+Ckcw5Zi4gn1qU= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.96.0/go.mod h1:/NVf7ci5xbUiSwqttXqqdsJMjH/C38cHhhBLnXrECA0= github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.97.0 h1:jPhm8t6pJcxgng2DaEhPZ3sY44KBoM0W32j6aI+hMgU= github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.97.0/go.mod h1:PAJCWmb9gEZh1OhazzHrvUGQeu31Rzqm8OJQVfxlLwU= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.96.0 h1:tyNJ1qYXm1jMJV2NbskYosfo7xIyRP7YvbdcvldXAeA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.96.0/go.mod h1:f3d2OcVhcMGgcMkyf614jPfAD8eE+zlJ6Pd5P43qWyI= github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.97.0 h1:vX/BkTfd7/cvydXJ7FmUy5iSviQeNGAgTCoXcLu7/Ww= github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.97.0/go.mod h1:yrlbvRlLeny1kFmj4Ac9BSqv/pOr2h7sOIvDE6OMCKk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.96.0 h1:lsOJsYuELFPTm3cm2b11DwVD18H9Mz3fWVNaRPdUxPg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.96.0/go.mod h1:iZi3xMSwNdGs6eAQrq2C3eWm3+PE40tQV84fNw42ERI= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.97.0 h1:+EA1iNRxeOqtU+9/+4hu8Tz7LhW2xmhFPd3w+ntpxiE= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.97.0/go.mod h1:pHbdUUE+6ZWpvaHyyHQiytt7t6IPVCvacnDPmKWVgu0= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.96.0 h1:i4PpId1NbxqVrtTb4VLYyIE57ZhTlgEEmUbTUyULlDk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.96.0/go.mod h1:Fa/tTxfSAMyDGcbon9CqBuMe0083BY+B4/4PBhop2Ko= github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.97.0 h1:sd7JEwe5e7VYel/6gFWTKFTsQz8PxzdpU8tWlL6Ymos= github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.97.0/go.mod h1:2E6Bx0OjGlwbsdpakU6ZiMb2VeA2hIcssmFL9Ov251g= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.96.0 h1:wNeHYUxCxUHmT6YmUBFM8V1UyR80yV+bUIgWwNydrOU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.96.0/go.mod h1:tV2btxxNu9EhivKU2Meq0HagHHrSkpCiwrQTcwRrsss= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.97.0 h1:jZQsM7cMygRatb5ng1Hbstmfuzn6aqXDmhYpwtljZyg= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.97.0/go.mod h1:WONvd1Xj3VFOziyxExHxmhmEx70DxqJ0nIVQ3FXtdS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.96.0 h1:6xhEYeFRjui33hCCP8tD9B2R2VCGNdNrzi+pivp0osk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.96.0/go.mod h1:7CDMyrWBi/iST+UVvheDNjZX8VWyboTJqkXHz7gpLDI= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.97.0 h1:N5b1f66i7KKaUWcDR6gvl5ZucLns2sMidbfXvfQZFTw= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.97.0/go.mod h1:sShrcWdTiwWfuZ8oQhulxYk4eF+qB2vrAxg/MAd690c= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.96.0 h1:iynLFjnG869r53AIhiavbEVMZoPqCba7Mijm+9MRdOo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.96.0/go.mod h1:FuTdjIZj7Un07dcbJs06IF1DJiYfpQkc4oklhNWE8fg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.96.0 h1:nzAR1IjPcbgLNFmJElLPyRlLOfijAkQcWo4L9CXixu4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.96.0/go.mod h1:Zn0A4V5t3uNr2FYsgnzT4t0OBqdOk8jcPjgHgy3jHG0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.97.0 h1:zVXzbHR2aXRuypZXve4+AxcEYeeYeqzl76WtkZ/pGpw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.97.0/go.mod h1:K6kz22H/i+t2/BGyCsaaNxFKjoXr1VJPhJV4GtjnJK0= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.97.0 h1:MWki5BBYideAF82i3ladRxmed3nkkGHDUA1YC2p2mz8= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.97.0/go.mod h1:Zsl3xSYy9QFqZ5lTPXqPHSuxz03kUaMw75kvvScE+94= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.96.0 h1:qDu31FoiT71TIhswpgqrfbwA+boU5a+xNWBKxl5Tkto= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.96.0/go.mod h1:wVd9yB8IEMBAdPq5iAoni3vvucIv1ahS7tFwl/n0jTA= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.97.0 h1:j0YEfadJv26PQWhaMynfWcDtSnsAGvBmGW9wwp+q2mU= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.97.0/go.mod h1:BleH1EFM1PjhKy9geg/FVIsvc/v7hl+FqZlxAnzUHSk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.96.0 h1:ZKH4+0dAqGW0Yc/W3NeP4zwcWouUoLIPgjzP0Dq9qew= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.96.0/go.mod h1:6jYdZIsLvWzVyJ7gvJ3dpTAw3WgSsSitc3+M0PzxoUM= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.97.0 h1:/aQbyj1DK8mK2lU+7VrzI/OPGISrIayAJyHlu67LI/8= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.97.0/go.mod h1:4W8p7s7UtnLzAaFps6At8ELJE9eLc7y4C/xvQJ0t7Mg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.96.0 h1:nRk4vyYsMkFht1Mo3n1d2X7WxLex0LzIWtQhE5/c2P8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.96.0/go.mod h1:XTq2FQlb1ao2NHoZvkBC+LPUdMO4DG/4FJ7LqAyE8YU= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.97.0 h1:5/19bkuB0GDo+vScgEnNy/TcXAkmyTu7BenfpaD2a/M= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.97.0/go.mod h1:CuGIeYSpb4Kmyq4Ez83gHbTjNQGxptjYcC4T5dWkPnM= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.96.0 h1:LZ2wG6AzwfOFc1bFPo1G8A9EbVcYb7pJOi9vpvoEiYE= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.96.0/go.mod h1:dT01MSqUkDuSiXBpbk8IpeFe5FEYPQWKnuckJxciyBc= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.97.0 h1:vqkBZCBjZLuDpErk9bEWS02ZhwEDMJBtyNmK0eLwi7A= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.97.0/go.mod h1:Z65edZWOfvG3/l5F/X42jnW4yMST5UeuktvG5QMCvF8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.96.0 h1:rIU8xMvn8sW22/Qg1BRmUMWaVhKqfNA6XkdWaXM0v2A= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.96.0/go.mod h1:zhqxjkw5cM9reIfN7prd4RObR12jmze/bUWQU4auDB4= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.97.0 h1:fgzi0d0NRJfSnFP0amVR1+tscNpYPnPs7ODKOzJzBq8= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.97.0/go.mod h1:x9pkj9/5Ej/8hwi+uHMPM70hcYpJ2cPf6gLFwGZpOv4= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.96.0 h1:5rdHJH2SKp9+g3ypk7wlRfMq1a7xRKqwvTffZHIOVgQ= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.96.0/go.mod h1:yk9+s0wSHn8WKzvBSa63puaPhCrjr+rmkfJ4/4NVyeQ= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.97.0 h1:vPQQQezde/dqG/UzWFVeWPUE5YUU3neybTWtF6dSSLM= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.97.0/go.mod h1:oC3rBafNReIB/XZDshYZjjFulwOF1Feu3ZmY7aYJ4P4= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.96.0 h1:V3DvS2g8qPp2Pr0i39iS37iByUlk7JvE6iEA6Ia1F58= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.96.0/go.mod h1:SpDMTfNxJhLoh90tzVbFVR6jBznomtSSfv1+mKR1s9I= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.97.0 h1:S6b9R3SexIKjaP6wB7+v20oX/7abc9vOsiazMA+j/gM= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.97.0/go.mod h1:GZYAz9b6feR5cZOxqYZip7kiBfYc7gU6x0XL2VatINw= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.96.0 h1:gK3nBuj0qhtt8HT4MuiW60KfNcnAA1hjdqnwdIbxHaU= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.96.0/go.mod h1:xc2JC4VmYfGsjaH834h0O+nCTHcddAGZkt5fJxQF7LE= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.97.0 h1:dHEhNYReKFxRAmVb9cXnpxwSCGgccps/SP+J1c2DOng= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.97.0/go.mod h1:IpzPnQdTgkYETRB7YwGJuzcZkSeznv/ZpxUWpALQL9s= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.96.0 h1:wqW04h5tvkYt2+7oBwvZUsrJijU7sktKSVq0fgsvKjo= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.96.0/go.mod h1:Lsow/P69ua84HwOhpsZNAd1Ek1fy5LPLCRnDp8raalI= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.97.0 h1:xCBESxW4jfSpIanPxkv+H+2WW79qgDPNFdPwU+lhzJU= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.97.0/go.mod h1:L5FPAGRGK8do+jyklQ1XvECXRtuf9tUjFxt3aS/R05k= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.96.0 h1:y9QNvhQ0XjJOJid4jNlEliJQI4+AFdEaN6weB9jMWaY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.96.0/go.mod h1:9xJFaECGKFH3U9ToFeE9f9/L5zw0fSY3jJCgHzFOBR0= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.97.0 h1:LEC8VOsV6BXyuROoCmZlr1m9yRNqtWtNFt5p62RpoG0= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.97.0/go.mod h1:guZo8ioeCrww44DypI+3CIWDDGodECkr/H+il26EzsI= -github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.96.0 h1:JT6kDGqnw7dzrzXZd8pgruoW5avvCm4rKVeCNg1HGbw= -github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.96.0/go.mod h1:8iPwXuyzz6aJJ9YHW8Z2jAJe5gKptXAs5f8ACVEXJr8= github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.97.0 h1:7daWAAjOgzP6qFZtqd6bULEmYu0zANFwIOUOaQPDwJ8= github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.97.0/go.mod h1:GkSGS8d+x06VqJENdfVzeBVNxQo9Y8FT+F1ESE+ilIc= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -477,8 +414,6 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= -github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y= github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= @@ -558,171 +493,89 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.96.0 h1:qXA3biNps8LPYYCTJwepGu58sW0XInmwnQbkkWZchIg= -go.opentelemetry.io/collector v0.96.0/go.mod h1:/i3zyRg23r7vloTLzKG/mRI2VkEt1Q4ARXbe3vKnAaE= go.opentelemetry.io/collector v0.97.0 h1:qyOju13byHIKEK/JehmTiGMj4pFLa4kDyrOCtTmjHU0= go.opentelemetry.io/collector v0.97.0/go.mod h1:V6xquYAaO2VHVu4DBK28JYuikRdZajh7DH5Vl/Y8NiA= -go.opentelemetry.io/collector/component v0.96.0 h1:O7F8F1YWOHNCqK5NH6vkGI6S1ObR4aPMFq3nHUxdWs0= -go.opentelemetry.io/collector/component v0.96.0/go.mod h1:HsiWaGHT+npm+c54iuUes1MpZJuGKZzS+ts2iaKt/Lo= go.opentelemetry.io/collector/component v0.97.0 h1:vanKhXl5nptN8igRH4PqVYHOILif653vaPIKv6LCZCI= go.opentelemetry.io/collector/component v0.97.0/go.mod h1:F/m3HMlkb16RKI7wJjgbECK1IZkAcmB8bu7yD8XOkwM= -go.opentelemetry.io/collector/config/configauth v0.96.0 h1:nnRLtaPVafazVij60/Q6qL32WEWHOlPee5E+5D3pN4c= -go.opentelemetry.io/collector/config/configauth v0.96.0/go.mod h1:XABE3s1OiLzjhHv6R/eMOp8fYFweF6/Naa9NgDD+Ntg= go.opentelemetry.io/collector/config/configauth v0.97.0 h1:38M2uUsBzgD7sdJPPXUsOq1BFr6X6P4A5VFg+MOcRNY= go.opentelemetry.io/collector/config/configauth v0.97.0/go.mod h1:BkCDatBU7CXXStrRPE1b4woj2VLxaYEMg2WTkb50BlI= -go.opentelemetry.io/collector/config/configcompression v0.96.0 h1:mbP0YbYTfbpovxcZE6JrBYmWg5G1Dozj7eOuLAdqcI4= -go.opentelemetry.io/collector/config/configcompression v0.96.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= go.opentelemetry.io/collector/config/configcompression v1.4.0 h1:qWRKdl49lBvPUr6UWmyf1pR4EOBHN+66pDeGtfQ1Mbk= go.opentelemetry.io/collector/config/configcompression v1.4.0/go.mod h1:O0fOPCADyGwGLLIf5lf7N3960NsnIfxsm6dr/mIpL+M= -go.opentelemetry.io/collector/config/configgrpc v0.96.0 h1:FxCtsN8V4zYYq5wlSYAjBs3OEI1AbjfzmzSPkHYZKkY= -go.opentelemetry.io/collector/config/configgrpc v0.96.0/go.mod h1:uUxDCwvWvyf331boTH8/gZhUXXST2r1ps5+ZAvxZl4o= go.opentelemetry.io/collector/config/configgrpc v0.97.0 h1:Ukl1GPtzSko4Pu8KV5jedD8OjySL/C+QgrfRdaakfHk= go.opentelemetry.io/collector/config/configgrpc v0.97.0/go.mod h1:i8OrrxynYldlcZ6wPOUKNoZmmbUCDp3CzryRT+2mN7c= -go.opentelemetry.io/collector/config/confighttp v0.96.0 h1:/piTkhB+UhhkvHc2PmHBuZzvp0okWTGiL/kZIh+zMmQ= -go.opentelemetry.io/collector/config/confighttp v0.96.0/go.mod h1:KWac7J9mNFjtN4dQz8AUmFVBr7c2UOfo5OM7wfdPToI= go.opentelemetry.io/collector/config/confighttp v0.97.0 h1:Tfw4DtK5x66uSoRdbZc9tQTNGWEo/urR8RAedBdYtNU= go.opentelemetry.io/collector/config/confighttp v0.97.0/go.mod h1:wyg4yXvCsk1CsfPBWQ3+rZDThz44Q0d35/1lJBHj5VI= -go.opentelemetry.io/collector/config/confignet v0.96.0 h1:ZUwziVVxWgcRMqukfKfdEjxfgmfhGsX6J3GEzF/Pupk= -go.opentelemetry.io/collector/config/confignet v0.96.0/go.mod h1:BVw5xkQ7TH2wH75cbph+dtOoxq1baWLuhdSYIAvuVu0= go.opentelemetry.io/collector/config/confignet v0.97.0 h1:KJjv10/YVMslSSLVWW/IIjpLM3JiO3rWvw5dK/t1H7g= go.opentelemetry.io/collector/config/confignet v0.97.0/go.mod h1:3naWoPss70RhDHhYjGACi7xh4NcVRvs9itzIRVWyu1k= -go.opentelemetry.io/collector/config/configopaque v1.3.0 h1:J60RL/XxGmBF+OX2+Gx+yAo/p7YwjSsOOlPlo1yXotA= -go.opentelemetry.io/collector/config/configopaque v1.3.0/go.mod h1:+vgBSjB0aSA5SnYAbLlWAcfqgNsrX/65/8EjMKCBGyk= go.opentelemetry.io/collector/config/configopaque v1.4.0 h1:5KgD9oLN+N07HqDsLzUrU0mE2pC8cMhrCSC1Nf8CEO4= go.opentelemetry.io/collector/config/configopaque v1.4.0/go.mod h1:7Qzo69x7i+FaNELeA9jmZtVvfnR5lE6JYa5YEOCJPFQ= -go.opentelemetry.io/collector/config/configretry v0.96.0 h1:rdZqq/ddPCjZCYYuqDGxrC93uHzQWhX5MQ9tt5uMSpM= -go.opentelemetry.io/collector/config/configretry v0.96.0/go.mod h1:Nq7hp4nk+zeH0LYYsx348NHl02O89FnV45hcCCmqdtg= go.opentelemetry.io/collector/config/configretry v0.97.0 h1:k7VwQ5H0oBLm6Fgm0ltfDDbmQVsiqSIY9ojijF0hiR0= go.opentelemetry.io/collector/config/configretry v0.97.0/go.mod h1:s7A6ZGxK8bxqidFzwbr2pITzbsB2qf+aeHEDQDcanV8= -go.opentelemetry.io/collector/config/configtelemetry v0.96.0 h1:Q9bSLPUzJUFG+P8eQ7W25Feko8yjdB7dK98V7hmUxCA= -go.opentelemetry.io/collector/config/configtelemetry v0.96.0/go.mod h1:tl8sI2RE3LSgJ0HjpadYpIwsKzw/CRA0nZUXLzMAZS0= go.opentelemetry.io/collector/config/configtelemetry v0.97.0 h1:JS/WxK09A9m39D5OqsAWaoRe4tG7ESMnzDNIbZ5bD6c= go.opentelemetry.io/collector/config/configtelemetry v0.97.0/go.mod h1:YV5PaOdtnU1xRomPcYqoHmyCr48tnaAREeGO96EZw8o= -go.opentelemetry.io/collector/config/configtls v0.96.0 h1:SPsL0ZzmNscRtKYCECXfvEE8tB6BqNdnWAgB42KCPeE= -go.opentelemetry.io/collector/config/configtls v0.96.0/go.mod h1:/LHiDf3jMuEY+rXu3DMWBmArcf0DPIc3V0aKQeaTEdQ= go.opentelemetry.io/collector/config/configtls v0.97.0 h1:wmXj/rKQUGMZzbHVCTyB+xUWImsGxnLqhivwjBE0FdI= go.opentelemetry.io/collector/config/configtls v0.97.0/go.mod h1:ev/fMI6hm1WTSHHEAEoVjF3RZj0qf38E/XO5itFku7k= -go.opentelemetry.io/collector/config/internal v0.96.0 h1:/HJtvjB9/XJRFs+g0XpRInRdUz0O7yeIbe0Av/Dg/TM= -go.opentelemetry.io/collector/config/internal v0.96.0/go.mod h1:74acJyU1E+bFidoy0tjTORZGttdjDYnKhkqGjao/bUA= go.opentelemetry.io/collector/config/internal v0.97.0 h1:vhTzCm2u6MUAxdWPprkOePR/Kd57v2uF11twpza1E7o= go.opentelemetry.io/collector/config/internal v0.97.0/go.mod h1:RVGDn9OH/KHT878cclG497/n2qxe54+zW+u/SVsRLNw= -go.opentelemetry.io/collector/confmap v0.96.0 h1:415ELCfC8S3xjiNFLneDWJi6h7j7SUw8A8pZtINEQdI= -go.opentelemetry.io/collector/confmap v0.96.0/go.mod h1:q/dWHLvkk1vgvAF0l5dbgQSiPOmGwpv0FwcNaGpqsfM= go.opentelemetry.io/collector/confmap v0.97.0 h1:0CGSk7YW9rPc6jCwJteJzHzN96HRoHTfuqI7J/EmZsg= go.opentelemetry.io/collector/confmap v0.97.0/go.mod h1:AnJmZcZoOLuykSXGiAf3shi11ZZk5ei4tZd9dDTTpWE= -go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0 h1:ISINaNKyTKIQQO5ijXXb2fagAmyZgndluqgF6Eccl50= -go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0/go.mod h1:eBpkcWGSKntw8xzifdg9okqHZ0o3kIqHjfyGM3afPbc= go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0 h1:Tw0+JlvA1Z5xpvHYqzYXsPdsCaq6+oGoqw7fCymh+lc= go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0/go.mod h1:gp3XWfC1OpmwHZsODRIpy4XZtrNy1RryJhvK7sdNgmk= -go.opentelemetry.io/collector/confmap/provider/envprovider v0.96.0 h1:ylJ12FL62H7liRCvxfvZQBSc0u4ggtTvjxML97jBwlE= -go.opentelemetry.io/collector/confmap/provider/envprovider v0.96.0/go.mod h1:vxIfEbehiq8JwlWqDgzWO14kl0K/g1jc/+J6LANnpj0= go.opentelemetry.io/collector/confmap/provider/envprovider v0.97.0 h1:2F3yl+Vr6nJ0sN9HoYeebY5+lJ8OJ4VqxCY16SsVcXs= go.opentelemetry.io/collector/confmap/provider/envprovider v0.97.0/go.mod h1:GrHP/mOgzx8+fcTRmgB/IgH3lG80nv2bFW1v6oPggRM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0 h1:1PrjESnmkJ231dCsO/n5SGGUPKc7J4qk4tYtvjoJbMs= -go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0/go.mod h1:rJXmOz1Q9nTl3Mubxb2HvAy7KWoi3Re2ettuo0BFUVw= go.opentelemetry.io/collector/confmap/provider/fileprovider v0.97.0 h1:5SXsBAA/6Hv76+ndBY0wZRYGNES/55SKu6VhP4kriqM= go.opentelemetry.io/collector/confmap/provider/fileprovider v0.97.0/go.mod h1:YAj2CNxE1go08GiAxYO2HSeNkWv8g7C7DHFpEECttI8= -go.opentelemetry.io/collector/confmap/provider/httpprovider v0.96.0 h1:ulbACw+gY1Wp9tiewDz3+w8lTfUdCT7YJ/qb//JqD7s= -go.opentelemetry.io/collector/confmap/provider/httpprovider v0.96.0/go.mod h1:QqSQiNy44Kw39cHIqCB7Zyq5f2SU1bX7AgmUhZblxRI= go.opentelemetry.io/collector/confmap/provider/httpprovider v0.97.0 h1:Wd4XR3cOznED8sYM0Qy0NlAToxvpEG8OH9O89RKp+pg= go.opentelemetry.io/collector/confmap/provider/httpprovider v0.97.0/go.mod h1:2LIGxKR6dJPP5kxkRSTIeWuJ7Mto1Mv456+MlG86RH8= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.96.0 h1:Hb51q5K2F5IYPS0/fwixQr2Metzb8RnZO0lT25z0ehM= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.96.0/go.mod h1:mD+9d+cBvlAm7tgLEgfDbHBaLgr+9PIPJI8K5cMNU7o= go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.97.0 h1:suZwewHxcwA3z0kE6p6tjYcPKlGOYWoIjy/58gBK/c0= go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.97.0/go.mod h1:R+cJ8wWzaJll+WCTUOM769zIk1vOb7NQARG9xWNbgUA= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0 h1:/uuau+nbiLvw9Zan78ySruDr9S12iLPw5d9i6h8379I= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0/go.mod h1:NPK3XddOGCuNavzunXD94dP9jLU4BAMs4mI9pOW0N80= go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.97.0 h1:ntcR7AMHwFRROTMW1ifx0xVu+ltbPafS/1r/ssxe+hM= go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.97.0/go.mod h1:0THo600LMD0RGl7loqyaHgd/47Icgb64QOmqaj0j5dU= -go.opentelemetry.io/collector/connector v0.96.0 h1:wPrX7Yc70Xko7nFin5gYxe6xPCkV7mHcKeQ75Y0HsTU= -go.opentelemetry.io/collector/connector v0.96.0/go.mod h1:6laIl3khhccApCiWjPeupU9BKw6KRoqLDt0OHS2OIp0= go.opentelemetry.io/collector/connector v0.97.0 h1:X3AI3rCRiNhKCF5OJc1XzNoIKYbClYm5BiLINtxHts8= go.opentelemetry.io/collector/connector v0.97.0/go.mod h1:KolkR5/kkPzy2jW7Q7zs+FiO1xiDrBeAvDYrZe/ygtA= -go.opentelemetry.io/collector/connector/forwardconnector v0.96.0 h1:z3rrDiGbiRGbpOT6P7gb50wy2umG4hV50edwvYgilW8= -go.opentelemetry.io/collector/connector/forwardconnector v0.96.0/go.mod h1:70pElzS8yzAX72rpF4AOcsgoP3IM5+K+AJJJbZNagF8= go.opentelemetry.io/collector/connector/forwardconnector v0.97.0 h1:laotTRES6yWViNWn5d4ek1le0YSO4UZV17ValkLuh44= go.opentelemetry.io/collector/connector/forwardconnector v0.97.0/go.mod h1:NG9qFqFvg7VgQ+ZOS/l2wk+741jFnup76MuGNxcJfGg= -go.opentelemetry.io/collector/consumer v0.96.0 h1:JN4JHelp5EGMGoC2UVelTMG6hyZjgtgdLLt5eZfVynU= -go.opentelemetry.io/collector/consumer v0.96.0/go.mod h1:Vn+qzzKgekDFayCVV8peSH5Btx1xrt/bmzD9gTxgidQ= go.opentelemetry.io/collector/consumer v0.97.0 h1:S0BZQtJQxSHT156S8a5rLt3TeWYP8Rq+jn8QEyWQUYk= go.opentelemetry.io/collector/consumer v0.97.0/go.mod h1:1D06LURiZ/1KA2OnuKNeSn9bvFmJ5ZWe6L8kLu0osSY= -go.opentelemetry.io/collector/exporter v0.96.0 h1:SmOSaP+zUNq0nl+BcllsCSsYePdUNIIUfW5sXKKaUlI= -go.opentelemetry.io/collector/exporter v0.96.0/go.mod h1:DcuGaxcINhOV2LgojDI56r3830cUtuCsNadINMIU23c= go.opentelemetry.io/collector/exporter v0.97.0 h1:kw/fQrpkhTz0/3I/Z0maRj0S8Mi0NK50/WwFuWrRYPc= go.opentelemetry.io/collector/exporter v0.97.0/go.mod h1:EJYc4biKWxq3kD4Xh4SUSFbZ2lMsxjzwiCozikEDMjk= -go.opentelemetry.io/collector/exporter/debugexporter v0.96.0 h1:88v2GWCIuYgd3e4KdwF0JLklIgBzETBw0e3dkEJ7BbI= -go.opentelemetry.io/collector/exporter/debugexporter v0.96.0/go.mod h1:mZjJ0G6Pn6aSS7T4UeEjXSHt3pgslvaZa/4Uam8DKuo= go.opentelemetry.io/collector/exporter/debugexporter v0.97.0 h1:BZ2QjBmPBsYKFKaZvOJU0o0Xfth8kxOB6izrCB19qTM= go.opentelemetry.io/collector/exporter/debugexporter v0.97.0/go.mod h1:CKrzODDvR5bLQZxSkNXUoaFcCY1fe6dPZV6FkdyH8/M= -go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0 h1:vZEd10B/zj7WkBWSVegDkGOwv7FZhUwyk60E2zkYwL4= -go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0/go.mod h1:tzJFwn1fR88rdGKkpvygMawu2Prc53bFhuKFk3EnpS8= go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0 h1:yqEl3oMw/h4jzkTEC599Icm2jp7oVsa1pOu5RoxIJTA= go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0/go.mod h1:XF5RsoyMLVMTtvLv4lIbsTiowJtE3Z9Jikot8/nJUDw= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.96.0 h1:c7pBEGYxlsnPPfs4ECIr2E+mEh25OTV+v20tv3pCIyU= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.96.0/go.mod h1:wmDxflnOrp0JRmB6gPBtNMPFD80V62+tZDZ2ZQNj3Cs= go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.0 h1:TjqChvxmmGMvY8/GV2/FQygwzTRUsj77HjJBc9kraEw= go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.0/go.mod h1:AqVCYi9O5hWzdko9zvRm/DGA4pOxBJZ5OqJ+XinLK8Y= -go.opentelemetry.io/collector/extension v0.96.0 h1:b02WX/2XxDf/PlqboYwWUSmiT2BXXWSntlnDlGiJuWw= -go.opentelemetry.io/collector/extension v0.96.0/go.mod h1:RrjDbQUCPKZmR9mfZ6kVQ0J8OfrcYnf09U+6ZyToV/Q= go.opentelemetry.io/collector/extension v0.97.0 h1:LpjZ4KQgnhLG/u3l69QgWkX8qMqeS8IFKWMoDtbPIeE= go.opentelemetry.io/collector/extension v0.97.0/go.mod h1:jWNG0Npi7AxiqwCclToskDfCQuNKHYHlBPJNnIKHp84= -go.opentelemetry.io/collector/extension/auth v0.96.0 h1:10ZSoVCF0WI8IYS+kD7lbdvbvOdfUBGEQ0c4G1mVuCU= -go.opentelemetry.io/collector/extension/auth v0.96.0/go.mod h1:UX0SpWMwRvzEaVr6fxP2CNooQ2JnuTEnTGYD8kCAjWc= go.opentelemetry.io/collector/extension/auth v0.97.0 h1:2AYGxSbsi1KC2DOOFbAe7valrERb86m7TfRY85X8hSE= go.opentelemetry.io/collector/extension/auth v0.97.0/go.mod h1:uElLYtzMPA48mu9baxGIH6lHpOn76NLe4mVHnmV+hEY= -go.opentelemetry.io/collector/extension/ballastextension v0.96.0 h1:BZVSyf/tRtMkb74zQg3hUDx3KMTKxiWtyObyvqbkRjI= -go.opentelemetry.io/collector/extension/ballastextension v0.96.0/go.mod h1:4mOLYUlaZq1h0mIdKKhBoYB8+8VEsQooBqch0r+JYI0= go.opentelemetry.io/collector/extension/ballastextension v0.97.0 h1:cKdHuNzg9wSKgXdIP+3zIFP9jBt47i6DTeEIJPIEv2o= go.opentelemetry.io/collector/extension/ballastextension v0.97.0/go.mod h1:gD7xVVFs0Q8n5eLu2mMWXv2Nb/jyxkKrTwWSaWK83SM= -go.opentelemetry.io/collector/extension/zpagesextension v0.96.0 h1:eSjSBqWIN+OiEBgZhRq8B2LDmqZMgBRMNAF1oGfp4XI= -go.opentelemetry.io/collector/extension/zpagesextension v0.96.0/go.mod h1:wWBmrP4H/gEInjtCiwZHlDj5+MuWI8bLybCSIrNXoNE= go.opentelemetry.io/collector/extension/zpagesextension v0.97.0 h1:IaZm011+6WKE03TFmDQ7ztp65eu8ngGc026m9KhuhB4= go.opentelemetry.io/collector/extension/zpagesextension v0.97.0/go.mod h1:PxR6gK4FEYHc6iGPH7svM9jjFIZo4o/MGGO0l+see0o= -go.opentelemetry.io/collector/featuregate v1.3.0 h1:nrFSx+zfjdisjE9oCx25Aep3nJ9RaUjeE1qFL6eovoU= -go.opentelemetry.io/collector/featuregate v1.3.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= go.opentelemetry.io/collector/featuregate v1.4.0 h1:RWE9M659C9iuUQc4GzBsndkGHG1jIzIY+nZJWvcKy1M= go.opentelemetry.io/collector/featuregate v1.4.0/go.mod h1:w7nUODKxEi3FLf1HslCiE6YWtMtOOrMnSwsDam8Mg9w= -go.opentelemetry.io/collector/otelcol v0.96.0 h1:/UGDovYdOAgXgRJlTlBEGXv8oF9vDoEjp2P5lidAkTY= -go.opentelemetry.io/collector/otelcol v0.96.0/go.mod h1:Xo58hEmoZFLyOIs9Wk400ME9gEFV+ttxCGcls6NxbhI= go.opentelemetry.io/collector/otelcol v0.97.0 h1:xtZOYmdzeu1dSgco0I4yqhSyQ6GrGa7E7TRUlg7KIwI= go.opentelemetry.io/collector/otelcol v0.97.0/go.mod h1:mHzwRh3ATXfStF9xsttnJilxpaP+03hhozMn39dP+Jo= -go.opentelemetry.io/collector/pdata v1.3.0 h1:JRYN7tVHYFwmtQhIYbxWeiKSa2L1nCohyAs8sYqKFZo= -go.opentelemetry.io/collector/pdata v1.3.0/go.mod h1:t7W0Undtes53HODPdSujPLTnfSR5fzT+WpL+RTaaayo= go.opentelemetry.io/collector/pdata v1.4.0 h1:cA6Pr7Z2V7mE+i7FmYpavX7nefzd6H4CICgW0T9aJX0= go.opentelemetry.io/collector/pdata v1.4.0/go.mod h1:0Ttp4wQinhV5oJTd9MjyvUegmZBO9O0nrlh/+EDLw+Q= -go.opentelemetry.io/collector/processor v0.96.0 h1:TGo7tLbLJo9tBZ9NNoSlB7xBP5osUXThKxCmg96gSko= -go.opentelemetry.io/collector/processor v0.96.0/go.mod h1:fvTTODSFY97D6Fc/iwBOL3outreBvZBlaHT2ciEWNZQ= go.opentelemetry.io/collector/processor v0.97.0 h1:L3R5R7x56LH2inF3sv0ZOsFfulVo8yuIFhO/OgpkCU0= go.opentelemetry.io/collector/processor v0.97.0/go.mod h1:OsxBAPQ2fDytAn+yWLdEQ1yjYfl/OIak1AfKGfI8ALs= -go.opentelemetry.io/collector/processor/batchprocessor v0.96.0 h1:5SbJUx9q4w05QSl7p1xOEdNLOmmPZDE9SXi0OST1SbI= -go.opentelemetry.io/collector/processor/batchprocessor v0.96.0/go.mod h1:NSlJS7EQ4zR4aisHAoKZEC2KP9LcSgMw8Yap2cCAO4I= go.opentelemetry.io/collector/processor/batchprocessor v0.97.0 h1:DpC+d8ZQB/Qj5+sODYPpu8a8l0aMtMZEq6pN/3e+5X4= go.opentelemetry.io/collector/processor/batchprocessor v0.97.0/go.mod h1:2sSDgffCKAUocMEapmcMBvgfBIotLtDFg/YJrOia8GE= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.96.0 h1:BOAg0hhFCSsuFsCXdwAb5tGgPHRG5D9bwsWERHRc1So= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.96.0/go.mod h1:TnvJD4MgxhHX0/y9lVtfeiDP6033/VyhM8FO2TT9klE= go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0 h1:B0ji9gIYZc+NohgcQ8arPtPLvzk+O1gdphGTk69hAmg= go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0/go.mod h1:/Euc792OGPS4EVgzRVrRex1v4e5Oq2MJjCff3t1vOgw= -go.opentelemetry.io/collector/receiver v0.96.0 h1:OrlcuyFCBQpbWNb2klzTdz1ZXMk0acRDh7fbaQtP4eo= -go.opentelemetry.io/collector/receiver v0.96.0/go.mod h1:fb5Vr2+tAkzB4qE6+lNaMsZwaeE8qZvG3IBdzK5hCRY= go.opentelemetry.io/collector/receiver v0.97.0 h1:ozzE5MhIPtfnYA/UKB/NCcgxSmeLqdwErboi6B/IpLQ= go.opentelemetry.io/collector/receiver v0.97.0/go.mod h1:1TCN9DRuB45+xKqlwv4BMQR6qXgaJeSSNezFTJhmDUo= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.96.0 h1:3tQG3+Bd5Ur/htNHTSHcwS25Cq+hLhC5+mti63x8NsY= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.96.0/go.mod h1:LgauKnCOayfutm4Y+WN3AaqK3cM+R7o+v3uXsq/be64= go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0 h1:LY6kbWURk2g+jcfJlQo51Xu6WyYKHW3W+UOhAr3g3qc= go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0/go.mod h1:JL1oxtysJT2TN80p/nC9vrWkENh/If7kmMRio7yF9WE= -go.opentelemetry.io/collector/semconv v0.96.0 h1:DrZy8BpzJDnN2zFxXRj6BhfGYxNlqpFHBqyuS9fVHRY= -go.opentelemetry.io/collector/semconv v0.96.0/go.mod h1:zOm/U3pgMIWcvrcnPbR9Xx2HinoXj46ERMK8PUV9wrs= go.opentelemetry.io/collector/semconv v0.97.0 h1:iF3nTfThbiOwz7o5Pocn0dDnDoffd18ijDuf6Mwzi1s= go.opentelemetry.io/collector/semconv v0.97.0/go.mod h1:8ElcRZ8Cdw5JnvhTOQOdYizkJaQ10Z2fS+R6djOnj6A= -go.opentelemetry.io/collector/service v0.96.0 h1:CDwDJ6aOmXFaTYWuj0KB3D4MpXdNlfJ5e5uj12OqAc4= -go.opentelemetry.io/collector/service v0.96.0/go.mod h1:9El7PPhnV+2xPXLlyileLaUa5mOE+vw6sswmcZBaUlc= go.opentelemetry.io/collector/service v0.97.0 h1:Nv/A41Ezot0lqMQwqJSRGV2PeQNcItaiDaQPudFXBOM= go.opentelemetry.io/collector/service v0.97.0/go.mod h1:h9SwBe1yThExLAhgIErMtGsyBdEmSKGK8p/f+QcWyT0= go.opentelemetry.io/contrib/config v0.4.0 h1:Xb+ncYOqseLroMuBesGNRgVQolXcXOhMj7EhGwJCdHs= @@ -796,8 +649,6 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -880,7 +731,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -915,8 +765,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -943,8 +791,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -956,8 +802,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 169b143c249..c5f5b7815ed 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -23,12 +23,16 @@ import ( "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" + "github.com/mostynb/go-grpc-compression/nonclobbering/snappy" + "github.com/mostynb/go-grpc-compression/nonclobbering/zstd" + "go.opentelemetry.io/collector/config/configcompression" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/encoding/gzip" "github.com/jaegertracing/jaeger/pkg/config/tlscfg" "github.com/jaegertracing/jaeger/pkg/tenancy" @@ -51,6 +55,12 @@ type Configuration struct { pluginHealthCheckDone chan bool pluginRPCClient plugin.ClientProtocol remoteConn *grpc.ClientConn + + Compression configcompression.Type `yaml:"compression" mapstructure:"compression"` + ReadBufferSize int `yaml:"read_buffer_size" mapstructure:"read_buffer_size"` + WriteBufferSize int `yaml:"write_buffer_size" mapstructure:"write_buffer_size"` + Authority string `yaml:"authority" mapstructure:"authority"` + WaitForReady bool `yaml:"wait_for_ready" mapstructure:"wait_for_ready"` } // ClientPluginServices defines services plugin can expose and its capabilities @@ -90,7 +100,28 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), grpc.WithBlock(), + grpc.WithDefaultCallOptions(grpc.WaitForReady(c.WaitForReady)), + } + + if c.Compression.IsCompressed() { + compressionType, err := getGRPCCompressionName(c.Compression) + if err != nil { + return nil, err + } + opts = append(opts, grpc.WithDefaultCallOptions(grpc.UseCompressor(compressionType))) + } + + if c.ReadBufferSize > 0 { + opts = append(opts, grpc.WithReadBufferSize(c.ReadBufferSize)) } + if c.WriteBufferSize > 0 { + opts = append(opts, grpc.WithWriteBufferSize(c.WriteBufferSize)) + } + + if c.Authority != "" { + opts = append(opts, grpc.WithAuthority(c.Authority)) + } + if c.RemoteTLS.Enabled { tlsCfg, err := c.RemoteTLS.Config(logger) if err != nil { @@ -223,3 +254,16 @@ func (c *Configuration) startPluginHealthCheck(rpcClient plugin.ClientProtocol, return c.pluginRPCClient.Ping() } + +func getGRPCCompressionName(compressionType configcompression.Type) (string, error) { + switch compressionType { + case configcompression.TypeGzip: + return gzip.Name, nil + case configcompression.TypeSnappy: + return snappy.Name, nil + case configcompression.TypeZstd: + return zstd.Name, nil + default: + return "", fmt.Errorf("unsupported compression type %q", compressionType) + } +} From 3986d8a54d4716ddcd25c1b75152e67992f6dc28 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 7 Apr 2024 18:34:47 +0530 Subject: [PATCH 02/22] reuse otel's client config Signed-off-by: Harshvir Potpose --- cmd/jaeger/grpc_config.yaml | 9 +++-- go.mod | 6 +-- plugin/storage/grpc/config/config.go | 56 +++++----------------------- 3 files changed, 17 insertions(+), 54 deletions(-) diff --git a/cmd/jaeger/grpc_config.yaml b/cmd/jaeger/grpc_config.yaml index c982b796646..df22ec219af 100644 --- a/cmd/jaeger/grpc_config.yaml +++ b/cmd/jaeger/grpc_config.yaml @@ -9,7 +9,7 @@ service: extensions: jaeger_query: trace_storage: external-storage - trace_storage_archive: external-storage-archive + # trace_storage_archive: external-storage-archive ui_config: ./cmd/jaeger/config-ui.json jaeger_storage: @@ -17,9 +17,10 @@ extensions: external-storage: server: localhost:17271 connection-timeout: 5s - external-storage-archive: - server: localhost:17281 - connection-timeout: 5s + compression: gzip + # external-storage-archive: + # server: localhost:17281 + # connection-timeout: 5s receivers: otlp: diff --git a/go.mod b/go.mod index e00ae4ab47c..8f10820bd88 100644 --- a/go.mod +++ b/go.mod @@ -151,7 +151,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.2.2 + github.com/mostynb/go-grpc-compression v1.2.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.97.0 // indirect @@ -205,9 +205,9 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.97.0 // indirect go.opentelemetry.io/collector/config/configauth v0.97.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.4.0 + go.opentelemetry.io/collector/config/configcompression v1.4.0 // indirect go.opentelemetry.io/collector/config/confignet v0.97.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.4.0 + go.opentelemetry.io/collector/config/configopaque v1.4.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect go.opentelemetry.io/collector/config/internal v0.97.0 // indirect go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0 // indirect diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index c5f5b7815ed..b6af3323a1e 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -23,16 +23,15 @@ import ( "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" - "github.com/mostynb/go-grpc-compression/nonclobbering/snappy" - "github.com/mostynb/go-grpc-compression/nonclobbering/zstd" - "go.opentelemetry.io/collector/config/configcompression" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/encoding/gzip" "github.com/jaegertracing/jaeger/pkg/config/tlscfg" "github.com/jaegertracing/jaeger/pkg/tenancy" @@ -51,16 +50,11 @@ type Configuration struct { RemoteConnectTimeout time.Duration `yaml:"connection-timeout" mapstructure:"connection-timeout"` TenancyOpts tenancy.Options - pluginHealthCheck *time.Ticker - pluginHealthCheckDone chan bool - pluginRPCClient plugin.ClientProtocol - remoteConn *grpc.ClientConn - - Compression configcompression.Type `yaml:"compression" mapstructure:"compression"` - ReadBufferSize int `yaml:"read_buffer_size" mapstructure:"read_buffer_size"` - WriteBufferSize int `yaml:"write_buffer_size" mapstructure:"write_buffer_size"` - Authority string `yaml:"authority" mapstructure:"authority"` - WaitForReady bool `yaml:"wait_for_ready" mapstructure:"wait_for_ready"` + pluginHealthCheck *time.Ticker + pluginHealthCheckDone chan bool + pluginRPCClient plugin.ClientProtocol + remoteConn *grpc.ClientConn + configgrpc.ClientConfig `mapstructure:",squash"` } // ClientPluginServices defines services plugin can expose and its capabilities @@ -102,26 +96,7 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.WaitForReady(c.WaitForReady)), } - - if c.Compression.IsCompressed() { - compressionType, err := getGRPCCompressionName(c.Compression) - if err != nil { - return nil, err - } - opts = append(opts, grpc.WithDefaultCallOptions(grpc.UseCompressor(compressionType))) - } - - if c.ReadBufferSize > 0 { - opts = append(opts, grpc.WithReadBufferSize(c.ReadBufferSize)) - } - if c.WriteBufferSize > 0 { - opts = append(opts, grpc.WithWriteBufferSize(c.WriteBufferSize)) - } - - if c.Authority != "" { - opts = append(opts, grpc.WithAuthority(c.Authority)) - } - + c.ClientConfig.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if c.RemoteTLS.Enabled { tlsCfg, err := c.RemoteTLS.Config(logger) if err != nil { @@ -254,16 +229,3 @@ func (c *Configuration) startPluginHealthCheck(rpcClient plugin.ClientProtocol, return c.pluginRPCClient.Ping() } - -func getGRPCCompressionName(compressionType configcompression.Type) (string, error) { - switch compressionType { - case configcompression.TypeGzip: - return gzip.Name, nil - case configcompression.TypeSnappy: - return snappy.Name, nil - case configcompression.TypeZstd: - return zstd.Name, nil - default: - return "", fmt.Errorf("unsupported compression type %q", compressionType) - } -} From 6cfb2dd463735f525eaf6f33af4e95f81d298058 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 7 Apr 2024 18:36:19 +0530 Subject: [PATCH 03/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/grpc_config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/jaeger/grpc_config.yaml b/cmd/jaeger/grpc_config.yaml index df22ec219af..f320b457a48 100644 --- a/cmd/jaeger/grpc_config.yaml +++ b/cmd/jaeger/grpc_config.yaml @@ -9,7 +9,7 @@ service: extensions: jaeger_query: trace_storage: external-storage - # trace_storage_archive: external-storage-archive + trace_storage_archive: external-storage-archive ui_config: ./cmd/jaeger/config-ui.json jaeger_storage: @@ -18,9 +18,9 @@ extensions: server: localhost:17271 connection-timeout: 5s compression: gzip - # external-storage-archive: - # server: localhost:17281 - # connection-timeout: 5s + external-storage-archive: + server: localhost:17281 + connection-timeout: 5s receivers: otlp: From 45467be30a8a5c942272462d92ca75e74d4a0b3a Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 7 Apr 2024 18:36:45 +0530 Subject: [PATCH 04/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/grpc_config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/jaeger/grpc_config.yaml b/cmd/jaeger/grpc_config.yaml index f320b457a48..c982b796646 100644 --- a/cmd/jaeger/grpc_config.yaml +++ b/cmd/jaeger/grpc_config.yaml @@ -17,7 +17,6 @@ extensions: external-storage: server: localhost:17271 connection-timeout: 5s - compression: gzip external-storage-archive: server: localhost:17281 connection-timeout: 5s From 940f02c1a9470d4fe637d3b885f3ca2261844f20 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Mon, 8 Apr 2024 19:27:09 +0530 Subject: [PATCH 05/22] log not supported when using auth Signed-off-by: Harshvir Potpose --- plugin/storage/grpc/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index b6af3323a1e..829b3597278 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -96,6 +96,11 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.WaitForReady(c.WaitForReady)), } + + if c.ClientConfig.Auth.AuthenticatorID.String() != "" { + return nil, fmt.Errorf("authenticator is not supported") + } + c.ClientConfig.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if c.RemoteTLS.Enabled { tlsCfg, err := c.RemoteTLS.Config(logger) From 9edf36a5cbf6ac038e8a479b39051dab88935f64 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Mon, 8 Apr 2024 19:43:47 +0530 Subject: [PATCH 06/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/grpc_config.yaml | 8 ++++---- plugin/storage/grpc/config/config.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/jaeger/grpc_config.yaml b/cmd/jaeger/grpc_config.yaml index c982b796646..d3647cea5c8 100644 --- a/cmd/jaeger/grpc_config.yaml +++ b/cmd/jaeger/grpc_config.yaml @@ -9,7 +9,7 @@ service: extensions: jaeger_query: trace_storage: external-storage - trace_storage_archive: external-storage-archive + # trace_storage_archive: external-storage-archive ui_config: ./cmd/jaeger/config-ui.json jaeger_storage: @@ -17,9 +17,9 @@ extensions: external-storage: server: localhost:17271 connection-timeout: 5s - external-storage-archive: - server: localhost:17281 - connection-timeout: 5s + # external-storage-archive: + # server: localhost:17281 + # connection-timeout: 5s receivers: otlp: diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 829b3597278..e2c6cd96089 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -97,7 +97,7 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra grpc.WithDefaultCallOptions(grpc.WaitForReady(c.WaitForReady)), } - if c.ClientConfig.Auth.AuthenticatorID.String() != "" { + if c.ClientConfig.Auth != nil { return nil, fmt.Errorf("authenticator is not supported") } From b4ba2403d731e6c131396428e3c7d3ee572e6d44 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Mon, 8 Apr 2024 19:46:40 +0530 Subject: [PATCH 07/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/grpc_config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/jaeger/grpc_config.yaml b/cmd/jaeger/grpc_config.yaml index d3647cea5c8..c982b796646 100644 --- a/cmd/jaeger/grpc_config.yaml +++ b/cmd/jaeger/grpc_config.yaml @@ -9,7 +9,7 @@ service: extensions: jaeger_query: trace_storage: external-storage - # trace_storage_archive: external-storage-archive + trace_storage_archive: external-storage-archive ui_config: ./cmd/jaeger/config-ui.json jaeger_storage: @@ -17,9 +17,9 @@ extensions: external-storage: server: localhost:17271 connection-timeout: 5s - # external-storage-archive: - # server: localhost:17281 - # connection-timeout: 5s + external-storage-archive: + server: localhost:17281 + connection-timeout: 5s receivers: otlp: From 947501edb9ffdcf35e68f0005c62ccbe7d3a2d5b Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sat, 11 May 2024 04:46:50 +0530 Subject: [PATCH 08/22] add config V2 Signed-off-by: Harshvir Potpose --- .../extension/jaegerstorage/config.go | 2 +- .../extension/jaegerstorage/extension.go | 2 +- plugin/storage/grpc/config/config.go | 65 +++++++++++++++---- plugin/storage/grpc/factory.go | 2 +- plugin/storage/grpc/factory_test.go | 8 ++- plugin/storage/grpc/options.go | 2 +- 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/cmd/jaeger/internal/extension/jaegerstorage/config.go b/cmd/jaeger/internal/extension/jaegerstorage/config.go index 542c5a6437a..1e6128cda93 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/config.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/config.go @@ -18,7 +18,7 @@ import ( type Config struct { Memory map[string]memoryCfg.Configuration `mapstructure:"memory"` Badger map[string]badgerCfg.NamespaceConfig `mapstructure:"badger"` - GRPC map[string]grpcCfg.Configuration `mapstructure:"grpc"` + GRPC map[string]grpcCfg.ConfigV2 `mapstructure:"grpc"` Opensearch map[string]esCfg.Configuration `mapstructure:"opensearch"` Elasticsearch map[string]esCfg.Configuration `mapstructure:"elasticsearch"` Cassandra map[string]cassandra.Options `mapstructure:"cassandra"` diff --git a/cmd/jaeger/internal/extension/jaegerstorage/extension.go b/cmd/jaeger/internal/extension/jaegerstorage/extension.go index a5442b82ff1..23709c00d3b 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/extension.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/extension.go @@ -117,7 +117,7 @@ func (s *storageExt) Start(ctx context.Context, host component.Host) error { cfg: s.config.Badger, builder: badger.NewFactoryWithConfig, } - grpcStarter := &starter[grpcCfg.Configuration, *grpc.Factory]{ + grpcStarter := &starter[grpcCfg.ConfigV2, *grpc.Factory]{ ext: s, storageKind: "grpc", cfg: s.config.GRPC, diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index d55eaea72e1..376df0d70b6 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -25,6 +25,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configgrpc" + "go.opentelemetry.io/collector/config/configtls" + "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -49,11 +51,47 @@ type Configuration struct { RemoteConnectTimeout time.Duration `yaml:"connection-timeout" mapstructure:"connection-timeout"` TenancyOpts tenancy.Options - pluginHealthCheck *time.Ticker - pluginHealthCheckDone chan bool - pluginRPCClient plugin.ClientProtocol - remoteConn *grpc.ClientConn - configgrpc.ClientConfig `mapstructure:",squash"` + pluginHealthCheck *time.Ticker + pluginHealthCheckDone chan bool + pluginRPCClient plugin.ClientProtocol + remoteConn *grpc.ClientConn +} + +type ConfigV2 struct { + Configuration `mapstructure:",squash"` + + configgrpc.ClientConfig `mapstructure:",squash"` + exporterhelper.TimeoutSettings `mapstructure:",squash"` +} + +func translateToConfigV2(v1 Configuration) *ConfigV2 { + return &ConfigV2{ + Configuration: v1, + + ClientConfig: configgrpc.ClientConfig{ + Endpoint: v1.RemoteServerAddr, + + TLSSetting: configtls.ClientConfig{ + Config: configtls.Config{ + CAFile: v1.RemoteTLS.CAPath, + CertFile: v1.RemoteTLS.CertPath, + KeyFile: v1.RemoteTLS.KeyPath, + CipherSuites: v1.RemoteTLS.CipherSuites, + MinVersion: v1.RemoteTLS.MinVersion, + MaxVersion: v1.RemoteTLS.MaxVersion, + ReloadInterval: v1.RemoteTLS.ReloadInterval, + }, + + ServerName: v1.RemoteTLS.ServerName, + InsecureSkipVerify: v1.RemoteTLS.SkipHostVerify, + }, + }, + + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: v1.RemoteConnectTimeout, + }, + } + } // ClientPluginServices defines services plugin can expose and its capabilities @@ -77,7 +115,7 @@ type PluginBuilder interface { } // Build instantiates a PluginServices -func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { +func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { if c.PluginBinary != "" { return c.buildPlugin(logger, tracerProvider) } else { @@ -97,18 +135,17 @@ func (c *Configuration) Close() error { return c.RemoteTLS.Close() } -func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { +func (c *ConfigV2) buildRemote(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { + c = translateToConfigV2(c.Configuration) opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), grpc.WithBlock(), - grpc.WithDefaultCallOptions(grpc.WaitForReady(c.WaitForReady)), } - if c.ClientConfig.Auth != nil { + if c.Auth != nil { return nil, fmt.Errorf("authenticator is not supported") } - c.ClientConfig.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if c.RemoteTLS.Enabled { tlsCfg, err := c.RemoteTLS.Config(logger) if err != nil { @@ -128,9 +165,9 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra opts = append(opts, grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tenancyMgr))) opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) } + var err error - // TODO: Need to replace grpc.DialContext with grpc.NewClient and pass test - c.remoteConn, err = grpc.DialContext(ctx, c.RemoteServerAddr, opts...) + c.remoteConn, err = c.ToClientConn(ctx, componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if err != nil { return nil, fmt.Errorf("error connecting to remote storage: %w", err) } @@ -146,7 +183,7 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra }, nil } -func (c *Configuration) buildPlugin(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { +func (c *ConfigV2) buildPlugin(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), } @@ -219,7 +256,7 @@ func (c *Configuration) buildPlugin(logger *zap.Logger, tracerProvider trace.Tra }, nil } -func (c *Configuration) startPluginHealthCheck(rpcClient plugin.ClientProtocol, logger *zap.Logger) error { +func (c *ConfigV2) startPluginHealthCheck(rpcClient plugin.ClientProtocol, logger *zap.Logger) error { c.pluginRPCClient = rpcClient c.pluginHealthCheckDone = make(chan bool) c.pluginHealthCheck = time.NewTicker(pluginHealthCheckInterval) diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index e5ae279541d..f0aeb78ca22 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -65,7 +65,7 @@ func NewFactory() *Factory { // NewFactoryWithConfig is used from jaeger(v2). func NewFactoryWithConfig( - cfg config.Configuration, + cfg config.ConfigV2, metricsFactory metrics.Factory, logger *zap.Logger, ) (*Factory, error) { diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 2dae30fe202..ebb4ae3734f 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -148,7 +148,7 @@ func TestGRPCStorageFactory(t *testing.T) { } func TestGRPCStorageFactoryWithConfig(t *testing.T) { - cfg := grpcConfig.Configuration{} + cfg := grpcConfig.ConfigV2{} _, err := NewFactoryWithConfig(cfg, metrics.NullFactory, zap.NewNop()) require.ErrorContains(t, err, "grpc-plugin builder failed to create a store: error connecting to remote storage") @@ -318,8 +318,10 @@ func TestWithConfiguration(t *testing.T) { func TestConfigureFromOptions(t *testing.T) { f := Factory{} o := Options{ - Configuration: grpcConfig.Configuration{ - PluginLogLevel: "info", + Configuration: grpcConfig.ConfigV2{ + Configuration: grpcConfig.Configuration{ + PluginLogLevel: "info", + }, }, } f.configureFromOptions(o) diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index b3b8d9210b2..d46bd61c0a6 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -43,7 +43,7 @@ const ( // Options contains GRPC plugins configs and provides the ability // to bind them to command line flags type Options struct { - Configuration config.Configuration `mapstructure:",squash"` + Configuration config.ConfigV2 `mapstructure:",squash"` } func tlsFlagsConfig() tlscfg.ClientFlagsConfig { From e476ecee3da78bd0d8d6102b184f2fcaa30816a3 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 12 May 2024 18:46:42 +0530 Subject: [PATCH 09/22] fix Signed-off-by: Harshvir Potpose --- plugin/storage/grpc/config/config.go | 63 +++++++++-------------- plugin/storage/grpc/config/config_test.go | 8 +-- plugin/storage/grpc/factory_test.go | 13 +++-- 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 0b527b4ddb5..218ed81bb91 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -15,13 +15,14 @@ package config import ( + "context" "errors" "fmt" "time" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configgrpc" - "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/trace" @@ -52,34 +53,21 @@ type ConfigV2 struct { exporterhelper.TimeoutSettings `mapstructure:",squash"` } -func translateToConfigV2(v1 Configuration) *ConfigV2 { - return &ConfigV2{ - Configuration: v1, - - ClientConfig: configgrpc.ClientConfig{ - Endpoint: v1.RemoteServerAddr, - - TLSSetting: configtls.ClientConfig{ - Config: configtls.Config{ - CAFile: v1.RemoteTLS.CAPath, - CertFile: v1.RemoteTLS.CertPath, - KeyFile: v1.RemoteTLS.KeyPath, - CipherSuites: v1.RemoteTLS.CipherSuites, - MinVersion: v1.RemoteTLS.MinVersion, - MaxVersion: v1.RemoteTLS.MaxVersion, - ReloadInterval: v1.RemoteTLS.ReloadInterval, - }, - - ServerName: v1.RemoteTLS.ServerName, - InsecureSkipVerify: v1.RemoteTLS.SkipHostVerify, - }, - }, - - TimeoutSettings: exporterhelper.TimeoutSettings{ - Timeout: v1.RemoteConnectTimeout, - }, - } - +func (c *ConfigV2) translateToConfigV2(v1 Configuration) *ConfigV2 { + c.Endpoint = v1.RemoteServerAddr + c.Timeout = v1.RemoteConnectTimeout + + c.ClientConfig.TLSSetting.ServerName = v1.RemoteTLS.ServerName + c.ClientConfig.TLSSetting.InsecureSkipVerify = v1.RemoteTLS.SkipHostVerify + c.ClientConfig.TLSSetting.CAFile = v1.RemoteTLS.CAPath + c.ClientConfig.TLSSetting.CertFile = v1.RemoteTLS.CertPath + c.ClientConfig.TLSSetting.KeyFile = v1.RemoteTLS.KeyPath + c.ClientConfig.TLSSetting.CipherSuites = v1.RemoteTLS.CipherSuites + c.ClientConfig.TLSSetting.MinVersion = v1.RemoteTLS.MinVersion + c.ClientConfig.TLSSetting.MaxVersion = v1.RemoteTLS.MaxVersion + c.ClientConfig.TLSSetting.ReloadInterval = v1.RemoteTLS.ReloadInterval + + return c } // ClientPluginServices defines services plugin can expose and its capabilities @@ -96,14 +84,12 @@ type PluginBuilder interface { } // Build instantiates a PluginServices -func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - return c.buildRemote(logger, tracerProvider, grpc.NewClient) +func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { + return c.buildRemote(logger, tracerProvider) } -type newClientFn func(target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) - -func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.TracerProvider, newClient newClientFn) (*ClientPluginServices, error) { -c = translateToConfigV2(c.Configuration) +func (c *ConfigV2) buildRemote(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { + c = c.translateToConfigV2(c.Configuration) opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), grpc.WithBlock(), @@ -129,11 +115,8 @@ c = translateToConfigV2(c.Configuration) opts = append(opts, grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tenancyMgr))) opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) } - var err error - c.remoteConn, err = c.ToClientConn(ctx, componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) - c.remoteConn, err = newClient(c.RemoteServerAddr, opts...) - + c.remoteConn, err = c.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if err != nil { return nil, fmt.Errorf("error creating remote storage client: %w", err) } @@ -149,7 +132,7 @@ c = translateToConfigV2(c.Configuration) }, nil } -func (c *Configuration) Close() error { +func (c *ConfigV2) Close() error { var errs []error if c.remoteConn != nil { errs = append(errs, c.remoteConn.Close()) diff --git a/plugin/storage/grpc/config/config_test.go b/plugin/storage/grpc/config/config_test.go index 64f54e58418..ff818e1e696 100644 --- a/plugin/storage/grpc/config/config_test.go +++ b/plugin/storage/grpc/config/config_test.go @@ -4,20 +4,16 @@ package config import ( - "errors" "testing" "github.com/stretchr/testify/require" "go.uber.org/zap" - "google.golang.org/grpc" ) func TestBuildRemoteNewClientError(t *testing.T) { // this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params. - c := &Configuration{} - _, err := c.buildRemote(zap.NewNop(), nil, func(target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) { - return nil, errors.New("test error") - }) + c := &ConfigV2{} + _, err := c.buildRemote(zap.NewNop(), nil) require.Error(t, err) require.Contains(t, err.Error(), "error creating remote storage client") } diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 56e7270c6fa..1f5c1f69d0a 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -162,9 +162,11 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { }() defer s.Stop() - cfg := grpcConfig.Configuration{ - RemoteServerAddr: lis.Addr().String(), - RemoteConnectTimeout: 1 * time.Second, + cfg = grpcConfig.ConfigV2{ + Configuration: grpcConfig.Configuration{ + RemoteServerAddr: lis.Addr().String(), + RemoteConnectTimeout: 1 * time.Second, + }, } f, err := NewFactoryWithConfig(cfg, metrics.NullFactory, zap.NewNop()) require.NoError(t, err) @@ -316,8 +318,9 @@ func TestConfigureFromOptions(t *testing.T) { f := Factory{} o := Options{ Configuration: grpcConfig.ConfigV2{ - Configuration: grpcConfig.Configuration{ - RemoteServerAddr: "foo:1234", + Configuration: grpcConfig.Configuration{ + RemoteServerAddr: "foo:1234", + }, }, } f.configureFromOptions(o) From 54736cc4fdd7e582d0ea3cc860f3c902cbb7c6e4 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Tue, 14 May 2024 04:06:48 +0530 Subject: [PATCH 10/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/config-remote-storage.yaml | 4 ++-- cmd/remote-storage/app/server.go | 3 ++- go.mod | 8 ------- go.sum | 34 --------------------------- plugin/storage/grpc/config/config.go | 8 +++---- 5 files changed, 8 insertions(+), 49 deletions(-) diff --git a/cmd/jaeger/config-remote-storage.yaml b/cmd/jaeger/config-remote-storage.yaml index 0da873500bd..e8215c9e4c5 100644 --- a/cmd/jaeger/config-remote-storage.yaml +++ b/cmd/jaeger/config-remote-storage.yaml @@ -14,8 +14,8 @@ extensions: jaeger_storage: grpc: external-storage: - server: localhost:17271 - connection-timeout: 5s + endpoint: localhost:17271 + timeout: 5s receivers: otlp: diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go index 1c133aba1fd..54c82a3b2de 100644 --- a/cmd/remote-storage/app/server.go +++ b/cmd/remote-storage/app/server.go @@ -22,7 +22,8 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - _ "google.golang.org/grpc/encoding" + + // _ "google.golang.org/grpc/encoding" "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" diff --git a/go.mod b/go.mod index d7a6b737f5a..663f7e023de 100644 --- a/go.mod +++ b/go.mod @@ -22,8 +22,6 @@ require ( github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 - github.com/hashicorp/go-hclog v1.6.3 - github.com/hashicorp/go-plugin v1.6.0 github.com/kr/pretty v0.3.1 github.com/olivere/elastic v6.2.37+incompatible github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.100.0 @@ -100,7 +98,6 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/elastic/elastic-transport-go/v8 v8.5.0 // indirect - github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -120,7 +117,6 @@ require ( github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/yamux v0.1.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect @@ -139,16 +135,12 @@ require ( github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.2 // indirect - github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.100.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.100.0 // indirect diff --git a/go.sum b/go.sum index b5dde134ca8..b0e7d0459a2 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,6 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bsm/sarama-cluster v2.1.13+incompatible h1:bqU3gMJbWZVxLZ9PGWVKP05yOmFXUlfw61RBwuE3PYU= github.com/bsm/sarama-cluster v2.1.13+incompatible/go.mod h1:r7ao+4tTNXvWm+VRpRJchr2kQhqxgmAp2iEX5W96gMM= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -81,9 +79,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -181,12 +176,8 @@ github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMW github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= -github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -196,8 +187,6 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= -github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -216,8 +205,6 @@ github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh6 github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -261,20 +248,9 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -293,8 +269,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= -github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olivere/elastic v6.2.37+incompatible h1:UfSGJem5czY+x/LqxgeCBgjDn6St+z8OnsCuxwD3L0U= github.com/olivere/elastic v6.2.37+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -431,7 +405,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -681,8 +654,6 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -690,17 +661,12 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 218ed81bb91..0376b96abfe 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -42,15 +42,15 @@ type Configuration struct { RemoteTLS tlscfg.Options RemoteConnectTimeout time.Duration `yaml:"connection-timeout" mapstructure:"connection-timeout"` TenancyOpts tenancy.Options - - remoteConn *grpc.ClientConn } type ConfigV2 struct { - Configuration `mapstructure:",squash"` - + Configuration + TenancyOpts tenancy.Options configgrpc.ClientConfig `mapstructure:",squash"` exporterhelper.TimeoutSettings `mapstructure:",squash"` + + remoteConn *grpc.ClientConn } func (c *ConfigV2) translateToConfigV2(v1 Configuration) *ConfigV2 { From e14a3f23e84a4599d063fc8622feff6fd5ce0912 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Tue, 14 May 2024 04:17:10 +0530 Subject: [PATCH 11/22] fix Signed-off-by: Harshvir Potpose --- cmd/remote-storage/app/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go index 54c82a3b2de..80685513888 100644 --- a/cmd/remote-storage/app/server.go +++ b/cmd/remote-storage/app/server.go @@ -23,7 +23,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - // _ "google.golang.org/grpc/encoding" "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" From 15be346d41fd951f5704448ad36dbbe796d0125a Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Thu, 16 May 2024 17:41:10 +0530 Subject: [PATCH 12/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/config-remote-storage.yaml | 3 + cmd/remote-storage/app/server.go | 1 - plugin/storage/grpc/config/config.go | 94 ++++++++++------------- plugin/storage/grpc/config/config_test.go | 4 +- plugin/storage/grpc/factory.go | 17 +++- plugin/storage/grpc/factory_test.go | 22 +++--- plugin/storage/grpc/options.go | 3 +- 7 files changed, 72 insertions(+), 72 deletions(-) diff --git a/cmd/jaeger/config-remote-storage.yaml b/cmd/jaeger/config-remote-storage.yaml index e8215c9e4c5..212f1d7dab9 100644 --- a/cmd/jaeger/config-remote-storage.yaml +++ b/cmd/jaeger/config-remote-storage.yaml @@ -16,6 +16,9 @@ extensions: external-storage: endpoint: localhost:17271 timeout: 5s + # read_buffer_size: 200 + tls: + insecure: true receivers: otlp: diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go index 80685513888..ecc29f0ff9b 100644 --- a/cmd/remote-storage/app/server.go +++ b/cmd/remote-storage/app/server.go @@ -22,7 +22,6 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 0376b96abfe..83d9bc933eb 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -16,7 +16,6 @@ package config import ( "context" - "errors" "fmt" "time" @@ -28,8 +27,6 @@ import ( "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" "github.com/jaegertracing/jaeger/pkg/config/tlscfg" "github.com/jaegertracing/jaeger/pkg/tenancy" @@ -45,29 +42,27 @@ type Configuration struct { } type ConfigV2 struct { - Configuration TenancyOpts tenancy.Options configgrpc.ClientConfig `mapstructure:",squash"` exporterhelper.TimeoutSettings `mapstructure:",squash"` - - remoteConn *grpc.ClientConn } -func (c *ConfigV2) translateToConfigV2(v1 Configuration) *ConfigV2 { - c.Endpoint = v1.RemoteServerAddr - c.Timeout = v1.RemoteConnectTimeout - - c.ClientConfig.TLSSetting.ServerName = v1.RemoteTLS.ServerName - c.ClientConfig.TLSSetting.InsecureSkipVerify = v1.RemoteTLS.SkipHostVerify - c.ClientConfig.TLSSetting.CAFile = v1.RemoteTLS.CAPath - c.ClientConfig.TLSSetting.CertFile = v1.RemoteTLS.CertPath - c.ClientConfig.TLSSetting.KeyFile = v1.RemoteTLS.KeyPath - c.ClientConfig.TLSSetting.CipherSuites = v1.RemoteTLS.CipherSuites - c.ClientConfig.TLSSetting.MinVersion = v1.RemoteTLS.MinVersion - c.ClientConfig.TLSSetting.MaxVersion = v1.RemoteTLS.MaxVersion - c.ClientConfig.TLSSetting.ReloadInterval = v1.RemoteTLS.ReloadInterval - - return c +func (c *Configuration) translateToConfigV2() *ConfigV2 { + V2 := &ConfigV2{} + V2.Endpoint = c.RemoteServerAddr + V2.Timeout = c.RemoteConnectTimeout + + V2.ClientConfig.TLSSetting.ServerName = c.RemoteTLS.ServerName + V2.ClientConfig.TLSSetting.InsecureSkipVerify = c.RemoteTLS.SkipHostVerify + V2.ClientConfig.TLSSetting.CAFile = c.RemoteTLS.CAPath + V2.ClientConfig.TLSSetting.CertFile = c.RemoteTLS.CertPath + V2.ClientConfig.TLSSetting.KeyFile = c.RemoteTLS.KeyPath + V2.ClientConfig.TLSSetting.CipherSuites = c.RemoteTLS.CipherSuites + V2.ClientConfig.TLSSetting.MinVersion = c.RemoteTLS.MinVersion + V2.ClientConfig.TLSSetting.MaxVersion = c.RemoteTLS.MaxVersion + V2.ClientConfig.TLSSetting.ReloadInterval = c.RemoteTLS.ReloadInterval + + return V2 } // ClientPluginServices defines services plugin can expose and its capabilities @@ -79,35 +74,34 @@ type ClientPluginServices struct { // PluginBuilder is used to create storage plugins. Implemented by Configuration. // TODO this interface should be removed and the building capability moved to Factory. type PluginBuilder interface { - Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) - Close() error + Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) } // Build instantiates a PluginServices -func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - return c.buildRemote(logger, tracerProvider) +func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { + v2Cfg := c.translateToConfigV2() + s, remoteConn, err := newRemoteStorage(v2Cfg, tracerProvider) + if err != nil { + return nil, nil, err + } + return s, remoteConn, nil +} + +func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { + s, remoteConn, err := newRemoteStorage(c, tracerProvider) + if err != nil { + return nil, nil, err + } + return s, remoteConn, nil } -func (c *ConfigV2) buildRemote(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - c = c.translateToConfigV2(c.Configuration) +func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), grpc.WithBlock(), } - if c.Auth != nil { - return nil, fmt.Errorf("authenticator is not supported") - } - - if c.RemoteTLS.Enabled { - tlsCfg, err := c.RemoteTLS.Config(logger) - if err != nil { - return nil, err - } - creds := credentials.NewTLS(tlsCfg) - opts = append(opts, grpc.WithTransportCredentials(creds)) - } else { - opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + return nil, nil, fmt.Errorf("authenticator is not supported") } tenancyMgr := tenancy.NewManager(&c.TenancyOpts) @@ -115,13 +109,12 @@ func (c *ConfigV2) buildRemote(logger *zap.Logger, tracerProvider trace.TracerPr opts = append(opts, grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tenancyMgr))) opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) } - var err error - c.remoteConn, err = c.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) + + remoteConn, err := c.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if err != nil { - return nil, fmt.Errorf("error creating remote storage client: %w", err) + return nil, nil, fmt.Errorf("error creating remote storage client: %w", err) } - - grpcClient := shared.NewGRPCClient(c.remoteConn) + grpcClient := shared.NewGRPCClient(remoteConn) return &ClientPluginServices{ PluginServices: shared.PluginServices{ Store: grpcClient, @@ -129,14 +122,5 @@ func (c *ConfigV2) buildRemote(logger *zap.Logger, tracerProvider trace.TracerPr StreamingSpanWriter: grpcClient, }, Capabilities: grpcClient, - }, nil -} - -func (c *ConfigV2) Close() error { - var errs []error - if c.remoteConn != nil { - errs = append(errs, c.remoteConn.Close()) - } - errs = append(errs, c.RemoteTLS.Close()) - return errors.Join(errs...) + }, remoteConn, nil } diff --git a/plugin/storage/grpc/config/config_test.go b/plugin/storage/grpc/config/config_test.go index ff818e1e696..4f57563ea3f 100644 --- a/plugin/storage/grpc/config/config_test.go +++ b/plugin/storage/grpc/config/config_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.uber.org/zap" + "go.opentelemetry.io/otel/trace/noop" ) func TestBuildRemoteNewClientError(t *testing.T) { // this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params. c := &ConfigV2{} - _, err := c.buildRemote(zap.NewNop(), nil) + _, _, err := newRemoteStorage(c, noop.NewTracerProvider()) require.Error(t, err) require.Contains(t, err.Error(), "error creating remote storage client") } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index 6c8e86ce92a..2e211104b28 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -15,6 +15,7 @@ package grpc import ( + "errors" "flag" "fmt" "io" @@ -23,6 +24,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/grpc" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" @@ -53,6 +55,7 @@ type Factory struct { archiveStore shared.ArchiveStoragePlugin streamingSpanWriter shared.StreamingSpanWriterPlugin capabilities shared.PluginCapabilities + remoteConn *grpc.ClientConn } // NewFactory creates a new Factory. @@ -67,7 +70,7 @@ func NewFactoryWithConfig( logger *zap.Logger, ) (*Factory, error) { f := NewFactory() - f.configureFromOptions(Options{Configuration: cfg}) + f.configureFromOptions(Options{ConfigV2: cfg}) err := f.Initialize(metricsFactory, logger) if err != nil { return nil, err @@ -92,6 +95,7 @@ func (f *Factory) InitFromViper(v *viper.Viper, logger *zap.Logger) { func (f *Factory) configureFromOptions(opts Options) { f.options = opts f.builder = &f.options.Configuration + f.builder = &f.options.ConfigV2 } // Initialize implements storage.Factory @@ -99,7 +103,9 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) f.metricsFactory, f.logger = metricsFactory, logger f.tracerProvider = otel.GetTracerProvider() - services, err := f.builder.Build(logger, f.tracerProvider) + var err error + var services *config.ClientPluginServices + services, f.remoteConn, err = f.builder.Build(logger, f.tracerProvider) if err != nil { return fmt.Errorf("grpc storage builder failed to create a store: %w", err) } @@ -165,5 +171,10 @@ func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error) { // Close closes the resources held by the factory func (f *Factory) Close() error { // TODO Close should move into Services type, instead of being in the Config. - return f.builder.Close() + var errs []error + if f.remoteConn != nil { + errs = append(errs, f.remoteConn.Close()) + } + errs = append(errs, f.options.Configuration.RemoteTLS.Close()) + return errors.Join(errs...) } diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 1f5c1f69d0a..437cf5da7f5 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -24,6 +24,8 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/config/configgrpc" + "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" @@ -46,9 +48,9 @@ type mockPluginBuilder struct { err error } -func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvider) (*grpcConfig.ClientPluginServices, error) { +func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvider) (*grpcConfig.ClientPluginServices, *grpc.ClientConn, error) { if b.err != nil { - return nil, b.err + return nil, nil, b.err } services := &grpcConfig.ClientPluginServices{ @@ -64,7 +66,7 @@ func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvide services.Capabilities = b.plugin } - return services, nil + return services, nil, nil } func (b *mockPluginBuilder) Close() error { @@ -163,9 +165,11 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { defer s.Stop() cfg = grpcConfig.ConfigV2{ - Configuration: grpcConfig.Configuration{ - RemoteServerAddr: lis.Addr().String(), - RemoteConnectTimeout: 1 * time.Second, + ClientConfig: configgrpc.ClientConfig{ + Endpoint: lis.Addr().String(), + }, + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: 1 * time.Second, }, } f, err := NewFactoryWithConfig(cfg, metrics.NullFactory, zap.NewNop()) @@ -317,10 +321,8 @@ func TestWithConfiguration(t *testing.T) { func TestConfigureFromOptions(t *testing.T) { f := Factory{} o := Options{ - Configuration: grpcConfig.ConfigV2{ - Configuration: grpcConfig.Configuration{ - RemoteServerAddr: "foo:1234", - }, + Configuration: grpcConfig.Configuration{ + RemoteServerAddr: "foo:1234", }, } f.configureFromOptions(o) diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index 5b86a68b603..b30a3a59d6d 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -36,7 +36,8 @@ const ( // Options contains GRPC plugins configs and provides the ability // to bind them to command line flags type Options struct { - Configuration config.ConfigV2 `mapstructure:",squash"` + Configuration config.Configuration `mapstructure:",squash"` + ConfigV2 config.ConfigV2 `mapstructure:",squash"` } func tlsFlagsConfig() tlscfg.ClientFlagsConfig { From 71baf5153e5a9443af35c547973d917c97659096 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Thu, 16 May 2024 17:49:35 +0530 Subject: [PATCH 13/22] fix Signed-off-by: Harshvir Potpose --- cmd/jaeger/config-remote-storage.yaml | 1 - plugin/storage/grpc/config/config.go | 32 ++++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/cmd/jaeger/config-remote-storage.yaml b/cmd/jaeger/config-remote-storage.yaml index 212f1d7dab9..98a438bd779 100644 --- a/cmd/jaeger/config-remote-storage.yaml +++ b/cmd/jaeger/config-remote-storage.yaml @@ -16,7 +16,6 @@ extensions: external-storage: endpoint: localhost:17271 timeout: 5s - # read_buffer_size: 200 tls: insecure: true diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 83d9bc933eb..10ab3613c5a 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -48,21 +48,23 @@ type ConfigV2 struct { } func (c *Configuration) translateToConfigV2() *ConfigV2 { - V2 := &ConfigV2{} - V2.Endpoint = c.RemoteServerAddr - V2.Timeout = c.RemoteConnectTimeout - - V2.ClientConfig.TLSSetting.ServerName = c.RemoteTLS.ServerName - V2.ClientConfig.TLSSetting.InsecureSkipVerify = c.RemoteTLS.SkipHostVerify - V2.ClientConfig.TLSSetting.CAFile = c.RemoteTLS.CAPath - V2.ClientConfig.TLSSetting.CertFile = c.RemoteTLS.CertPath - V2.ClientConfig.TLSSetting.KeyFile = c.RemoteTLS.KeyPath - V2.ClientConfig.TLSSetting.CipherSuites = c.RemoteTLS.CipherSuites - V2.ClientConfig.TLSSetting.MinVersion = c.RemoteTLS.MinVersion - V2.ClientConfig.TLSSetting.MaxVersion = c.RemoteTLS.MaxVersion - V2.ClientConfig.TLSSetting.ReloadInterval = c.RemoteTLS.ReloadInterval - - return V2 + v2 := &ConfigV2{} + v2.Endpoint = c.RemoteServerAddr + v2.Timeout = c.RemoteConnectTimeout + + v2.ClientConfig.TLSSetting.Insecure = !c.RemoteTLS.Enabled + + v2.ClientConfig.TLSSetting.ServerName = c.RemoteTLS.ServerName + v2.ClientConfig.TLSSetting.InsecureSkipVerify = c.RemoteTLS.SkipHostVerify + v2.ClientConfig.TLSSetting.CAFile = c.RemoteTLS.CAPath + v2.ClientConfig.TLSSetting.CertFile = c.RemoteTLS.CertPath + v2.ClientConfig.TLSSetting.KeyFile = c.RemoteTLS.KeyPath + v2.ClientConfig.TLSSetting.CipherSuites = c.RemoteTLS.CipherSuites + v2.ClientConfig.TLSSetting.MinVersion = c.RemoteTLS.MinVersion + v2.ClientConfig.TLSSetting.MaxVersion = c.RemoteTLS.MaxVersion + v2.ClientConfig.TLSSetting.ReloadInterval = c.RemoteTLS.ReloadInterval + + return v2 } // ClientPluginServices defines services plugin can expose and its capabilities From c4a34b07a312799b4d6fb2b1dae442aff7fbafe4 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 19 May 2024 15:27:11 +0530 Subject: [PATCH 14/22] add ToOtelClientConfig() Signed-off-by: Harshvir Potpose --- pkg/config/tlscfg/options.go | 17 +++++++++++++++++ plugin/storage/grpc/config/config.go | 13 +------------ plugin/storage/grpc/factory.go | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/pkg/config/tlscfg/options.go b/pkg/config/tlscfg/options.go index 2707887831d..c0cc7bb8304 100644 --- a/pkg/config/tlscfg/options.go +++ b/pkg/config/tlscfg/options.go @@ -23,6 +23,7 @@ import ( "path/filepath" "time" + "go.opentelemetry.io/collector/config/configtls" "go.uber.org/zap" ) @@ -135,6 +136,22 @@ func (p Options) loadCertPool() (*x509.CertPool, error) { return certPool, nil } +func (o *Options) ToOtelClientConfig(v2 *configtls.ClientConfig) configtls.ClientConfig { + v2.Insecure = !o.Enabled + + v2.ServerName = o.ServerName + v2.InsecureSkipVerify = o.SkipHostVerify + v2.CAFile = o.CAPath + v2.CertFile = o.CertPath + v2.KeyFile = o.KeyPath + v2.CipherSuites = o.CipherSuites + v2.MinVersion = o.MinVersion + v2.MaxVersion = o.MaxVersion + v2.ReloadInterval = o.ReloadInterval + + return *v2 +} + func addCertToPool(caPath string, certPool *x509.CertPool) error { caPEM, err := os.ReadFile(filepath.Clean(caPath)) if err != nil { diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 54fd85fb9cd..e5782093961 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -51,18 +51,7 @@ func (c *Configuration) translateToConfigV2() *ConfigV2 { v2 := &ConfigV2{} v2.Endpoint = c.RemoteServerAddr v2.Timeout = c.RemoteConnectTimeout - - v2.ClientConfig.TLSSetting.Insecure = !c.RemoteTLS.Enabled - - v2.ClientConfig.TLSSetting.ServerName = c.RemoteTLS.ServerName - v2.ClientConfig.TLSSetting.InsecureSkipVerify = c.RemoteTLS.SkipHostVerify - v2.ClientConfig.TLSSetting.CAFile = c.RemoteTLS.CAPath - v2.ClientConfig.TLSSetting.CertFile = c.RemoteTLS.CertPath - v2.ClientConfig.TLSSetting.KeyFile = c.RemoteTLS.KeyPath - v2.ClientConfig.TLSSetting.CipherSuites = c.RemoteTLS.CipherSuites - v2.ClientConfig.TLSSetting.MinVersion = c.RemoteTLS.MinVersion - v2.ClientConfig.TLSSetting.MaxVersion = c.RemoteTLS.MaxVersion - v2.ClientConfig.TLSSetting.ReloadInterval = c.RemoteTLS.ReloadInterval + v2.TLSSetting = c.RemoteTLS.ToOtelClientConfig(&v2.TLSSetting) return v2 } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index 2e211104b28..17023b49460 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -114,7 +114,7 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) f.archiveStore = services.ArchiveStore f.capabilities = services.Capabilities f.streamingSpanWriter = services.StreamingSpanWriter - logger.Info("Remote storage configuration", zap.Any("configuration", f.options.Configuration)) + logger.Info("Remote storage configuration", zap.Any("configuration", f.options.ConfigV2)) return nil } From ba44b7f4af2f6c52727da1ab0617148efbcb907e Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 19 May 2024 15:31:22 +0530 Subject: [PATCH 15/22] fix Signed-off-by: Harshvir Potpose --- plugin/storage/grpc/config/config.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index e5782093961..bbb4b94b2ab 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -71,11 +71,7 @@ type PluginBuilder interface { // Build instantiates a PluginServices func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { v2Cfg := c.translateToConfigV2() - s, remoteConn, err := newRemoteStorage(v2Cfg, tracerProvider) - if err != nil { - return nil, nil, err - } - return s, remoteConn, nil + return v2Cfg.Build(logger, tracerProvider) } func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { From a2143b3254da9193a616a3ad1ac415edd870536a Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Sun, 19 May 2024 16:06:23 +0530 Subject: [PATCH 16/22] add remote conn in *ClientPluginServices Signed-off-by: Harshvir Potpose --- plugin/storage/grpc/config/config.go | 32 ++++++++++++++++------- plugin/storage/grpc/config/config_test.go | 2 +- plugin/storage/grpc/factory.go | 19 +++++++------- plugin/storage/grpc/factory_test.go | 6 ++--- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index bbb4b94b2ab..4f170e297cf 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -60,34 +60,35 @@ func (c *Configuration) translateToConfigV2() *ConfigV2 { type ClientPluginServices struct { shared.PluginServices Capabilities shared.PluginCapabilities + remoteConn *grpc.ClientConn } // PluginBuilder is used to create storage plugins. Implemented by Configuration. // TODO this interface should be removed and the building capability moved to Factory. type PluginBuilder interface { - Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) + Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) } // Build instantiates a PluginServices -func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { +func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { v2Cfg := c.translateToConfigV2() return v2Cfg.Build(logger, tracerProvider) } -func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { - s, remoteConn, err := newRemoteStorage(c, tracerProvider) +func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { + s, err := newRemoteStorage(c, tracerProvider) if err != nil { - return nil, nil, err + return nil, err } - return s, remoteConn, nil + return s, nil } -func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*ClientPluginServices, *grpc.ClientConn, error) { +func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { opts := []grpc.DialOption{ grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), } if c.Auth != nil { - return nil, nil, fmt.Errorf("authenticator is not supported") + return nil, fmt.Errorf("authenticator is not supported") } tenancyMgr := tenancy.NewManager(&c.TenancyOpts) @@ -98,7 +99,7 @@ func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*Client remoteConn, err := c.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) if err != nil { - return nil, nil, fmt.Errorf("error creating remote storage client: %w", err) + return nil, fmt.Errorf("error creating remote storage client: %w", err) } grpcClient := shared.NewGRPCClient(remoteConn) return &ClientPluginServices{ @@ -108,5 +109,16 @@ func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*Client StreamingSpanWriter: grpcClient, }, Capabilities: grpcClient, - }, remoteConn, nil + remoteConn: remoteConn, + }, nil +} + +func (c *ClientPluginServices) Close() error { + if c.remoteConn != nil { + err := c.remoteConn.Close() + if err != nil { + return err + } + } + return nil } diff --git a/plugin/storage/grpc/config/config_test.go b/plugin/storage/grpc/config/config_test.go index 4f57563ea3f..94e987cf237 100644 --- a/plugin/storage/grpc/config/config_test.go +++ b/plugin/storage/grpc/config/config_test.go @@ -13,7 +13,7 @@ import ( func TestBuildRemoteNewClientError(t *testing.T) { // this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params. c := &ConfigV2{} - _, _, err := newRemoteStorage(c, noop.NewTracerProvider()) + _, err := newRemoteStorage(c, noop.NewTracerProvider()) require.Error(t, err) require.Contains(t, err.Error(), "error creating remote storage client") } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index 17023b49460..ac6fdf139c7 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" - "google.golang.org/grpc" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" @@ -55,7 +54,7 @@ type Factory struct { archiveStore shared.ArchiveStoragePlugin streamingSpanWriter shared.StreamingSpanWriterPlugin capabilities shared.PluginCapabilities - remoteConn *grpc.ClientConn + services *config.ClientPluginServices } // NewFactory creates a new Factory. @@ -104,16 +103,15 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) f.tracerProvider = otel.GetTracerProvider() var err error - var services *config.ClientPluginServices - services, f.remoteConn, err = f.builder.Build(logger, f.tracerProvider) + f.services, err = f.builder.Build(logger, f.tracerProvider) if err != nil { return fmt.Errorf("grpc storage builder failed to create a store: %w", err) } - f.store = services.Store - f.archiveStore = services.ArchiveStore - f.capabilities = services.Capabilities - f.streamingSpanWriter = services.StreamingSpanWriter + f.store = f.services.Store + f.archiveStore = f.services.ArchiveStore + f.capabilities = f.services.Capabilities + f.streamingSpanWriter = f.services.StreamingSpanWriter logger.Info("Remote storage configuration", zap.Any("configuration", f.options.ConfigV2)) return nil } @@ -172,8 +170,9 @@ func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error) { func (f *Factory) Close() error { // TODO Close should move into Services type, instead of being in the Config. var errs []error - if f.remoteConn != nil { - errs = append(errs, f.remoteConn.Close()) + err := f.services.Close() + if err != nil { + errs = append(errs, err) } errs = append(errs, f.options.Configuration.RemoteTLS.Close()) return errors.Join(errs...) diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 437cf5da7f5..2c144add663 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -48,9 +48,9 @@ type mockPluginBuilder struct { err error } -func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvider) (*grpcConfig.ClientPluginServices, *grpc.ClientConn, error) { +func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvider) (*grpcConfig.ClientPluginServices, error) { if b.err != nil { - return nil, nil, b.err + return nil, b.err } services := &grpcConfig.ClientPluginServices{ @@ -66,7 +66,7 @@ func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvide services.Capabilities = b.plugin } - return services, nil, nil + return services, nil } func (b *mockPluginBuilder) Close() error { From 148000c14333bd8a01efafd6c90f2d0fc596c5c1 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 19 May 2024 20:31:41 -0400 Subject: [PATCH 17/22] refactor Signed-off-by: Yuri Shkuro --- plugin/storage/grpc/config/config.go | 59 ++-- plugin/storage/grpc/config/config_test.go | 9 +- plugin/storage/grpc/factory.go | 73 ++--- plugin/storage/grpc/factory_test.go | 351 +++++++++------------- plugin/storage/grpc/options.go | 20 +- plugin/storage/grpc/options_test.go | 43 +-- 6 files changed, 238 insertions(+), 317 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 4f170e297cf..4c1e59dd1c5 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -47,13 +47,17 @@ type ConfigV2 struct { exporterhelper.TimeoutSettings `mapstructure:",squash"` } -func (c *Configuration) translateToConfigV2() *ConfigV2 { - v2 := &ConfigV2{} - v2.Endpoint = c.RemoteServerAddr - v2.Timeout = c.RemoteConnectTimeout - v2.TLSSetting = c.RemoteTLS.ToOtelClientConfig(&v2.TLSSetting) - - return v2 +func (c *Configuration) TranslateToConfigV2() *ConfigV2 { + temp := &ConfigV2{} // TODO there is no need to pass this + return &ConfigV2{ + ClientConfig: configgrpc.ClientConfig{ + Endpoint: c.RemoteServerAddr, + TLSSetting: c.RemoteTLS.ToOtelClientConfig(&temp.TLSSetting), + }, + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: c.RemoteConnectTimeout, + }, + } } // ClientPluginServices defines services plugin can expose and its capabilities @@ -63,29 +67,35 @@ type ClientPluginServices struct { remoteConn *grpc.ClientConn } -// PluginBuilder is used to create storage plugins. Implemented by Configuration. -// TODO this interface should be removed and the building capability moved to Factory. -type PluginBuilder interface { - Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) -} +// // PluginBuilder is used to create storage plugins. Implemented by Configuration. +// // TODO this interface should be removed and the building capability moved to Factory. +// type PluginBuilder interface { +// Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) +// } -// Build instantiates a PluginServices -func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - v2Cfg := c.translateToConfigV2() - return v2Cfg.Build(logger, tracerProvider) -} +// // Build instantiates a PluginServices +// func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { +// v2Cfg := c.translateToConfigV2() +// return v2Cfg.Build(logger, tracerProvider) +// } +// TODO move this to factory.go func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - s, err := newRemoteStorage(c, tracerProvider) - if err != nil { - return nil, err + telset := component.TelemetrySettings{ + Logger: logger, + TracerProvider: tracerProvider, } - return s, nil + newClientFn := func(opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) { + return c.ToClientConn(context.Background(), componenttest.NewNopHost(), telset, opts...) + } + return newRemoteStorage(c, telset, newClientFn) } -func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { +type newClientFn func(opts ...grpc.DialOption) (*grpc.ClientConn, error) + +func newRemoteStorage(c *ConfigV2, telset component.TelemetrySettings, newClient newClientFn) (*ClientPluginServices, error) { opts := []grpc.DialOption{ - grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(telset.TracerProvider))), } if c.Auth != nil { return nil, fmt.Errorf("authenticator is not supported") @@ -97,7 +107,8 @@ func newRemoteStorage(c *ConfigV2, tracerProvider trace.TracerProvider) (*Client opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) } - remoteConn, err := c.ToClientConn(context.Background(), componenttest.NewNopHost(), component.TelemetrySettings{}, opts...) + //remoteConn, err := c.ToClientConn(context.Background(), componenttest.NewNopHost(), telset, opts...) + remoteConn, err := newClient(opts...) if err != nil { return nil, fmt.Errorf("error creating remote storage client: %w", err) } diff --git a/plugin/storage/grpc/config/config_test.go b/plugin/storage/grpc/config/config_test.go index 94e987cf237..dc6bf298ac9 100644 --- a/plugin/storage/grpc/config/config_test.go +++ b/plugin/storage/grpc/config/config_test.go @@ -4,16 +4,21 @@ package config import ( + "errors" "testing" "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/trace/noop" + "go.opentelemetry.io/collector/component" + "google.golang.org/grpc" ) func TestBuildRemoteNewClientError(t *testing.T) { // this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params. c := &ConfigV2{} - _, err := newRemoteStorage(c, noop.NewTracerProvider()) + newClientFn := func(opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) { + return nil, errors.New("test error") + } + _, err := newRemoteStorage(c, component.TelemetrySettings{}, newClientFn) require.Error(t, err) require.Contains(t, err.Error(), "error creating remote storage client") } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index ac6fdf139c7..fd39208f750 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -28,7 +28,6 @@ import ( "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" "github.com/jaegertracing/jaeger/plugin/storage/grpc/config" - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" @@ -43,18 +42,14 @@ var ( // interface comformance checks // Factory implements storage.Factory and creates storage components backed by a storage plugin. type Factory struct { - options Options metricsFactory metrics.Factory logger *zap.Logger tracerProvider trace.TracerProvider - builder config.PluginBuilder + configV1 config.Configuration + configV2 *config.ConfigV2 - store shared.StoragePlugin - archiveStore shared.ArchiveStoragePlugin - streamingSpanWriter shared.StreamingSpanWriterPlugin - capabilities shared.PluginCapabilities - services *config.ClientPluginServices + services *config.ClientPluginServices } // NewFactory creates a new Factory. @@ -69,9 +64,8 @@ func NewFactoryWithConfig( logger *zap.Logger, ) (*Factory, error) { f := NewFactory() - f.configureFromOptions(Options{ConfigV2: cfg}) - err := f.Initialize(metricsFactory, logger) - if err != nil { + f.configV2 = &cfg + if err := f.Initialize(metricsFactory, logger); err != nil { return nil, err } return f, nil @@ -79,22 +73,14 @@ func NewFactoryWithConfig( // AddFlags implements plugin.Configurable func (f *Factory) AddFlags(flagSet *flag.FlagSet) { - f.options.AddFlags(flagSet) + v1AddFlags(flagSet) } // InitFromViper implements plugin.Configurable func (f *Factory) InitFromViper(v *viper.Viper, logger *zap.Logger) { - if err := f.options.InitFromViper(v); err != nil { + if err := v1InitFromViper(&f.configV1, v); err != nil { logger.Fatal("unable to initialize gRPC storage factory", zap.Error(err)) } - f.builder = &f.options.Configuration -} - -// configureFromOptions initializes factory from options -func (f *Factory) configureFromOptions(opts Options) { - f.options = opts - f.builder = &f.options.Configuration - f.builder = &f.options.ConfigV2 } // Initialize implements storage.Factory @@ -102,78 +88,75 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) f.metricsFactory, f.logger = metricsFactory, logger f.tracerProvider = otel.GetTracerProvider() + if f.configV2 == nil { + f.configV2 = f.configV1.TranslateToConfigV2() + } + var err error - f.services, err = f.builder.Build(logger, f.tracerProvider) + f.services, err = f.configV2.Build(logger, f.tracerProvider) if err != nil { return fmt.Errorf("grpc storage builder failed to create a store: %w", err) } - - f.store = f.services.Store - f.archiveStore = f.services.ArchiveStore - f.capabilities = f.services.Capabilities - f.streamingSpanWriter = f.services.StreamingSpanWriter - logger.Info("Remote storage configuration", zap.Any("configuration", f.options.ConfigV2)) + logger.Info("Remote storage configuration", zap.Any("configuration", f.configV2)) return nil } // CreateSpanReader implements storage.Factory func (f *Factory) CreateSpanReader() (spanstore.Reader, error) { - return f.store.SpanReader(), nil + return f.services.Store.SpanReader(), nil } // CreateSpanWriter implements storage.Factory func (f *Factory) CreateSpanWriter() (spanstore.Writer, error) { - if f.capabilities != nil && f.streamingSpanWriter != nil { - if capabilities, err := f.capabilities.Capabilities(); err == nil && capabilities.StreamingSpanWriter { - return f.streamingSpanWriter.StreamingSpanWriter(), nil + if f.services.Capabilities != nil && f.services.StreamingSpanWriter != nil { + if capabilities, err := f.services.Capabilities.Capabilities(); err == nil && capabilities.StreamingSpanWriter { + return f.services.StreamingSpanWriter.StreamingSpanWriter(), nil } } - return f.store.SpanWriter(), nil + return f.services.Store.SpanWriter(), nil } // CreateDependencyReader implements storage.Factory func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error) { - return f.store.DependencyReader(), nil + return f.services.Store.DependencyReader(), nil } // CreateArchiveSpanReader implements storage.ArchiveFactory func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) { - if f.capabilities == nil { + if f.services.Capabilities == nil { return nil, storage.ErrArchiveStorageNotSupported } - capabilities, err := f.capabilities.Capabilities() + capabilities, err := f.services.Capabilities.Capabilities() if err != nil { return nil, err } if capabilities == nil || !capabilities.ArchiveSpanReader { return nil, storage.ErrArchiveStorageNotSupported } - return f.archiveStore.ArchiveSpanReader(), nil + return f.services.ArchiveStore.ArchiveSpanReader(), nil } // CreateArchiveSpanWriter implements storage.ArchiveFactory func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error) { - if f.capabilities == nil { + if f.services.Capabilities == nil { return nil, storage.ErrArchiveStorageNotSupported } - capabilities, err := f.capabilities.Capabilities() + capabilities, err := f.services.Capabilities.Capabilities() if err != nil { return nil, err } if capabilities == nil || !capabilities.ArchiveSpanWriter { return nil, storage.ErrArchiveStorageNotSupported } - return f.archiveStore.ArchiveSpanWriter(), nil + return f.services.ArchiveStore.ArchiveSpanWriter(), nil } // Close closes the resources held by the factory func (f *Factory) Close() error { - // TODO Close should move into Services type, instead of being in the Config. var errs []error - err := f.services.Close() - if err != nil { - errs = append(errs, err) + if f.services != nil { + errs = append(errs, f.services.Close()) } - errs = append(errs, f.options.Configuration.RemoteTLS.Close()) + errs = append(errs, f.configV1.RemoteTLS.Close()) return errors.Join(errs...) } diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 2c144add663..00f08437be5 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -24,9 +24,9 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/config/configauth" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/exporter/exporterhelper" - "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" @@ -42,117 +42,90 @@ import ( spanStoreMocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" ) -type mockPluginBuilder struct { - plugin *mockPlugin - writerType string - err error +type store struct { + reader spanstore.Reader + writer spanstore.Writer + deps dependencystore.Reader } -func (b *mockPluginBuilder) Build(logger *zap.Logger, tracer trace.TracerProvider) (*grpcConfig.ClientPluginServices, error) { - if b.err != nil { - return nil, b.err - } - - services := &grpcConfig.ClientPluginServices{ - PluginServices: shared.PluginServices{ - Store: b.plugin, - ArchiveStore: b.plugin, - }, - } - if b.writerType == "streaming" { - services.PluginServices.StreamingSpanWriter = b.plugin - } - if b.plugin.capabilities != nil { - services.Capabilities = b.plugin - } - - return services, nil -} - -func (b *mockPluginBuilder) Close() error { - return nil +func (s *store) SpanReader() spanstore.Reader { + return s.reader } -type mockPlugin struct { - spanReader spanstore.Reader - spanWriter spanstore.Writer - archiveReader spanstore.Reader - archiveWriter spanstore.Writer - streamingSpanWriter spanstore.Writer - capabilities shared.PluginCapabilities - dependencyReader dependencystore.Reader +func (s *store) SpanWriter() spanstore.Writer { + return s.writer } -func (mp *mockPlugin) Capabilities() (*shared.Capabilities, error) { - return mp.capabilities.Capabilities() +func (s *store) ArchiveSpanReader() spanstore.Reader { + return s.reader } -func (mp *mockPlugin) ArchiveSpanReader() spanstore.Reader { - return mp.archiveReader +func (s *store) ArchiveSpanWriter() spanstore.Writer { + return s.writer } -func (mp *mockPlugin) ArchiveSpanWriter() spanstore.Writer { - return mp.archiveWriter +func (s *store) DependencyReader() dependencystore.Reader { + return s.deps } -func (mp *mockPlugin) SpanReader() spanstore.Reader { - return mp.spanReader +func makeMockServices() *grpcConfig.ClientPluginServices { + return &grpcConfig.ClientPluginServices{ + PluginServices: shared.PluginServices{ + Store: &store{ + writer: new(spanStoreMocks.Writer), + reader: new(spanStoreMocks.Reader), + deps: new(dependencyStoreMocks.Reader), + }, + ArchiveStore: &store{ + writer: new(spanStoreMocks.Writer), + reader: new(spanStoreMocks.Reader), + }, + }, + Capabilities: new(mocks.PluginCapabilities), + } } -func (mp *mockPlugin) SpanWriter() spanstore.Writer { - return mp.spanWriter -} +func TestNewFactoryError(t *testing.T) { + cfg := &grpcConfig.ConfigV2{ + ClientConfig: configgrpc.ClientConfig{ + // non-empty Auth is currently not supported + Auth: &configauth.Authentication{}, + }, + } + _, err := NewFactoryWithConfig(*cfg, metrics.NullFactory, zap.NewNop()) + require.Error(t, err) + assert.Contains(t, err.Error(), "authenticator") -func (mp *mockPlugin) StreamingSpanWriter() spanstore.Writer { - return mp.streamingSpanWriter -} + f := NewFactory() + f.InitFromViper(viper.New(), zap.NewNop()) -func (mp *mockPlugin) DependencyReader() dependencystore.Reader { - return mp.dependencyReader + f.configV2 = cfg + err = f.Initialize(metrics.NullFactory, zap.NewNop()) + require.Error(t, err) + assert.Contains(t, err.Error(), "authenticator") } -func TestGRPCStorageFactory(t *testing.T) { +func TestInitFactory(t *testing.T) { f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) - - // after InitFromViper, f.builder points to a real plugin builder that will fail in unit tests, - // so we override it with a mock. - f.builder = &mockPluginBuilder{ - err: errors.New("made-up error"), - } - err := f.Initialize(metrics.NullFactory, zap.NewNop()) - require.Error(t, err) - assert.Contains(t, err.Error(), "made-up error") - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - spanWriter: new(spanStoreMocks.Writer), - spanReader: new(spanStoreMocks.Reader), - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - capabilities: new(mocks.PluginCapabilities), - dependencyReader: new(dependencyStoreMocks.Reader), - }, - } + f.InitFromViper(viper.New(), zap.NewNop()) + f.services = makeMockServices() require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + defer f.Close() - assert.NotNil(t, f.store) reader, err := f.CreateSpanReader() require.NoError(t, err) - assert.Equal(t, f.store.SpanReader(), reader) + assert.Equal(t, f.services.Store.SpanReader(), reader) + writer, err := f.CreateSpanWriter() require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) + assert.Equal(t, f.services.Store.SpanWriter(), writer) + depReader, err := f.CreateDependencyReader() require.NoError(t, err) - assert.Equal(t, f.store.DependencyReader(), depReader) + assert.Equal(t, f.services.Store.DependencyReader(), depReader) } func TestGRPCStorageFactoryWithConfig(t *testing.T) { - cfg := grpcConfig.ConfigV2{} - _, err := NewFactoryWithConfig(cfg, metrics.NullFactory, zap.NewNop()) - require.ErrorContains(t, err, "grpc-plugin builder failed to create a store: error connecting to remote storage") lis, err := net.Listen("tcp", ":0") require.NoError(t, err, "failed to listen") @@ -164,7 +137,7 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { }() defer s.Stop() - cfg = grpcConfig.ConfigV2{ + cfg := grpcConfig.ConfigV2{ ClientConfig: configgrpc.ClientConfig{ Endpoint: lis.Addr().String(), }, @@ -177,12 +150,25 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { require.NoError(t, f.Close()) } -func TestGRPCStorageFactory_Capabilities(t *testing.T) { +func makeFactory(t *testing.T) *Factory { f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) + f.InitFromViper(viper.New(), zap.NewNop()) + require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - capabilities := new(mocks.PluginCapabilities) + keepServices := f.services + t.Cleanup(func() { + keepServices.Close() + f.Close() + }) + + return f +} + +func TestGRPCStorageFactory_Capabilities(t *testing.T) { + f := makeFactory(t) + + f.services = makeMockServices() + capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) capabilities.On("Capabilities"). Return(&shared.Capabilities{ ArchiveSpanReader: true, @@ -190,53 +176,31 @@ func TestGRPCStorageFactory_Capabilities(t *testing.T) { StreamingSpanWriter: true, }, nil).Times(3) - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - capabilities: capabilities, - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - streamingSpanWriter: new(spanStoreMocks.Writer), - }, - writerType: "streaming", - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - - assert.NotNil(t, f.store) reader, err := f.CreateArchiveSpanReader() require.NoError(t, err) assert.NotNil(t, reader) + writer, err := f.CreateArchiveSpanWriter() require.NoError(t, err) assert.NotNil(t, writer) + writer, err = f.CreateSpanWriter() require.NoError(t, err) - assert.Equal(t, f.streamingSpanWriter.StreamingSpanWriter(), writer) + assert.NotNil(t, writer) } func TestGRPCStorageFactory_CapabilitiesDisabled(t *testing.T) { - f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) + f := makeFactory(t) - capabilities := new(mocks.PluginCapabilities) + f.services = makeMockServices() + capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) capabilities.On("Capabilities"). Return(&shared.Capabilities{ ArchiveSpanReader: false, ArchiveSpanWriter: false, StreamingSpanWriter: false, - }, nil) - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - capabilities: capabilities, - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - spanWriter: new(spanStoreMocks.Writer), - }, - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + }, nil).Times(3) - assert.NotNil(t, f.store) reader, err := f.CreateArchiveSpanReader() require.EqualError(t, err, storage.ErrArchiveStorageNotSupported.Error()) assert.Nil(t, reader) @@ -245,30 +209,17 @@ func TestGRPCStorageFactory_CapabilitiesDisabled(t *testing.T) { assert.Nil(t, writer) writer, err = f.CreateSpanWriter() require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) + assert.NotNil(t, writer, "regular span writer is available") } func TestGRPCStorageFactory_CapabilitiesError(t *testing.T) { - f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) + f := makeFactory(t) - capabilities := new(mocks.PluginCapabilities) + f.services = makeMockServices() + capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) customError := errors.New("made-up error") - capabilities.On("Capabilities"). - Return(nil, customError) - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - capabilities: capabilities, - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - spanWriter: new(spanStoreMocks.Writer), - }, - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + capabilities.On("Capabilities").Return(nil, customError) - assert.NotNil(t, f.store) reader, err := f.CreateArchiveSpanReader() require.EqualError(t, err, customError.Error()) assert.Nil(t, reader) @@ -277,24 +228,14 @@ func TestGRPCStorageFactory_CapabilitiesError(t *testing.T) { assert.Nil(t, writer) writer, err = f.CreateSpanWriter() require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) + assert.NotNil(t, writer, "regular span writer is available") } func TestGRPCStorageFactory_CapabilitiesNil(t *testing.T) { - f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - spanWriter: new(spanStoreMocks.Writer), - }, - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + f := makeFactory(t) + f.services = makeMockServices() + f.services.Capabilities = nil - assert.NotNil(t, f.store) reader, err := f.CreateArchiveSpanReader() assert.Equal(t, err, storage.ErrArchiveStorageNotSupported) assert.Nil(t, reader) @@ -303,10 +244,10 @@ func TestGRPCStorageFactory_CapabilitiesNil(t *testing.T) { assert.Nil(t, writer) writer, err = f.CreateSpanWriter() require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) + assert.NotNil(t, writer, "regular span writer is available") } -func TestWithConfiguration(t *testing.T) { +func TestWithCLIFlags(t *testing.T) { f := NewFactory() v, command := config.Viperize(f.AddFlags) err := command.ParseFlags([]string{ @@ -314,67 +255,55 @@ func TestWithConfiguration(t *testing.T) { }) require.NoError(t, err) f.InitFromViper(v, zap.NewNop()) - assert.Equal(t, "foo:1234", f.options.Configuration.RemoteServerAddr) + assert.Equal(t, "foo:1234", f.configV1.RemoteServerAddr) require.NoError(t, f.Close()) } -func TestConfigureFromOptions(t *testing.T) { - f := Factory{} - o := Options{ - Configuration: grpcConfig.Configuration{ - RemoteServerAddr: "foo:1234", - }, - } - f.configureFromOptions(o) - assert.Equal(t, o, f.options) - assert.Equal(t, &o.Configuration, f.builder) -} - -func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { - f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - spanWriter: new(spanStoreMocks.Writer), - }, - writerType: "streaming", - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - writer, err := f.CreateSpanWriter() - require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) -} - -func TestStreamingSpanWriterFactory_Capabilities(t *testing.T) { - f := NewFactory() - v := viper.New() - f.InitFromViper(v, zap.NewNop()) - - capabilities := new(mocks.PluginCapabilities) - customError := errors.New("made-up error") - capabilities.On("Capabilities"). - Return(nil, customError).Once(). - On("Capabilities").Return(&shared.Capabilities{}, nil).Once() - - f.builder = &mockPluginBuilder{ - plugin: &mockPlugin{ - archiveWriter: new(spanStoreMocks.Writer), - archiveReader: new(spanStoreMocks.Reader), - spanWriter: new(spanStoreMocks.Writer), - capabilities: capabilities, - }, - writerType: "streaming", - } - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - writer, err := f.CreateSpanWriter() - require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return error - - writer, err = f.CreateSpanWriter() - require.NoError(t, err) - assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return false -} +// func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { +// f := NewFactory() +// v := viper.New() +// f.InitFromViper(v, zap.NewNop()) + +// f.builder = &mockPluginBuilder{ +// plugin: &mockPlugin{ +// archiveWriter: new(spanStoreMocks.Writer), +// archiveReader: new(spanStoreMocks.Reader), +// spanWriter: new(spanStoreMocks.Writer), +// }, +// writerType: "streaming", +// } +// require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) +// writer, err := f.CreateSpanWriter() +// require.NoError(t, err) +// assert.Equal(t, f.store.SpanWriter(), writer) +// } + +// func TestStreamingSpanWriterFactory_Capabilities(t *testing.T) { +// f := NewFactory() +// v := viper.New() +// f.InitFromViper(v, zap.NewNop()) + +// capabilities := new(mocks.PluginCapabilities) +// customError := errors.New("made-up error") +// capabilities.On("Capabilities"). +// Return(nil, customError).Once(). +// On("Capabilities").Return(&shared.Capabilities{}, nil).Once() + +// f.builder = &mockPluginBuilder{ +// plugin: &mockPlugin{ +// archiveWriter: new(spanStoreMocks.Writer), +// archiveReader: new(spanStoreMocks.Reader), +// spanWriter: new(spanStoreMocks.Writer), +// capabilities: capabilities, +// }, +// writerType: "streaming", +// } +// require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) +// writer, err := f.CreateSpanWriter() +// require.NoError(t, err) +// assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return error + +// writer, err = f.CreateSpanWriter() +// require.NoError(t, err) +// assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return false +// } diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index b30a3a59d6d..b70290baf23 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -33,13 +33,6 @@ const ( defaultConnectionTimeout = time.Duration(5 * time.Second) ) -// Options contains GRPC plugins configs and provides the ability -// to bind them to command line flags -type Options struct { - Configuration config.Configuration `mapstructure:",squash"` - ConfigV2 config.ConfigV2 `mapstructure:",squash"` -} - func tlsFlagsConfig() tlscfg.ClientFlagsConfig { return tlscfg.ClientFlagsConfig{ Prefix: remotePrefix, @@ -47,22 +40,21 @@ func tlsFlagsConfig() tlscfg.ClientFlagsConfig { } // AddFlags adds flags for Options -func (opt *Options) AddFlags(flagSet *flag.FlagSet) { +func v1AddFlags(flagSet *flag.FlagSet) { tlsFlagsConfig().AddFlags(flagSet) flagSet.String(remoteServer, "", "The remote storage gRPC server address as host:port") flagSet.Duration(remoteConnectionTimeout, defaultConnectionTimeout, "The remote storage gRPC server connection timeout") } -// InitFromViper initializes Options with properties from viper -func (opt *Options) InitFromViper(v *viper.Viper) error { - opt.Configuration.RemoteServerAddr = v.GetString(remoteServer) +func v1InitFromViper(cfg *config.Configuration, v *viper.Viper) error { + cfg.RemoteServerAddr = v.GetString(remoteServer) var err error - opt.Configuration.RemoteTLS, err = tlsFlagsConfig().InitFromViper(v) + cfg.RemoteTLS, err = tlsFlagsConfig().InitFromViper(v) if err != nil { return fmt.Errorf("failed to parse gRPC storage TLS options: %w", err) } - opt.Configuration.RemoteConnectTimeout = v.GetDuration(remoteConnectionTimeout) - opt.Configuration.TenancyOpts = tenancy.InitFromViper(v) + cfg.RemoteConnectTimeout = v.GetDuration(remoteConnectionTimeout) + cfg.TenancyOpts = tenancy.InitFromViper(v) return nil } diff --git a/plugin/storage/grpc/options_test.go b/plugin/storage/grpc/options_test.go index dce4e35d3ad..4d1670e97c2 100644 --- a/plugin/storage/grpc/options_test.go +++ b/plugin/storage/grpc/options_test.go @@ -23,64 +23,65 @@ import ( "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/tenancy" + grpccfg "github.com/jaegertracing/jaeger/plugin/storage/grpc/config" ) func TestOptionsWithFlags(t *testing.T) { - opts := &Options{} - v, command := config.Viperize(opts.AddFlags, tenancy.AddFlags) + v, command := config.Viperize(v1AddFlags, tenancy.AddFlags) err := command.ParseFlags([]string{ "--grpc-storage.server=foo:12345", "--multi-tenancy.header=x-scope-orgid", }) require.NoError(t, err) - opts.InitFromViper(v) + var cfg grpccfg.Configuration + require.NoError(t, v1InitFromViper(&cfg, v)) - assert.Equal(t, "foo:12345", opts.Configuration.RemoteServerAddr) - assert.False(t, opts.Configuration.TenancyOpts.Enabled) - assert.Equal(t, "x-scope-orgid", opts.Configuration.TenancyOpts.Header) + assert.Equal(t, "foo:12345", cfg.RemoteServerAddr) + assert.False(t, cfg.TenancyOpts.Enabled) + assert.Equal(t, "x-scope-orgid", cfg.TenancyOpts.Header) } func TestRemoteOptionsWithFlags(t *testing.T) { - opts := &Options{} - v, command := config.Viperize(opts.AddFlags) + v, command := config.Viperize(v1AddFlags) err := command.ParseFlags([]string{ "--grpc-storage.server=localhost:2001", "--grpc-storage.tls.enabled=true", "--grpc-storage.connection-timeout=60s", }) require.NoError(t, err) - opts.InitFromViper(v) + var cfg grpccfg.Configuration + require.NoError(t, v1InitFromViper(&cfg, v)) - assert.Equal(t, "localhost:2001", opts.Configuration.RemoteServerAddr) - assert.True(t, opts.Configuration.RemoteTLS.Enabled) - assert.Equal(t, 60*time.Second, opts.Configuration.RemoteConnectTimeout) + assert.Equal(t, "localhost:2001", cfg.RemoteServerAddr) + assert.True(t, cfg.RemoteTLS.Enabled) + assert.Equal(t, 60*time.Second, cfg.RemoteConnectTimeout) } func TestRemoteOptionsNoTLSWithFlags(t *testing.T) { - opts := &Options{} - v, command := config.Viperize(opts.AddFlags) + v, command := config.Viperize(v1AddFlags) err := command.ParseFlags([]string{ "--grpc-storage.server=localhost:2001", "--grpc-storage.tls.enabled=false", "--grpc-storage.connection-timeout=60s", }) require.NoError(t, err) - opts.InitFromViper(v) + var cfg grpccfg.Configuration + require.NoError(t, v1InitFromViper(&cfg, v)) - assert.Equal(t, "localhost:2001", opts.Configuration.RemoteServerAddr) - assert.False(t, opts.Configuration.RemoteTLS.Enabled) - assert.Equal(t, 60*time.Second, opts.Configuration.RemoteConnectTimeout) + assert.Equal(t, "localhost:2001", cfg.RemoteServerAddr) + assert.False(t, cfg.RemoteTLS.Enabled) + assert.Equal(t, 60*time.Second, cfg.RemoteConnectTimeout) } func TestFailedTLSFlags(t *testing.T) { - opts := &Options{} - v, command := config.Viperize(opts.AddFlags) + v, command := config.Viperize(v1AddFlags) err := command.ParseFlags([]string{ "--grpc-storage.tls.enabled=false", "--grpc-storage.tls.cert=blah", // invalid unless tls.enabled=true }) require.NoError(t, err) - err = opts.InitFromViper(v) + var cfg grpccfg.Configuration + err = v1InitFromViper(&cfg, v) require.Error(t, err) assert.Contains(t, err.Error(), "failed to parse gRPC storage TLS options") } From 14f9c94595aaf216bedca33a58c6acd133fcc068 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 19 May 2024 21:07:44 -0400 Subject: [PATCH 18/22] finish-tests Signed-off-by: Yuri Shkuro --- plugin/storage/grpc/config/config.go | 13 --- plugin/storage/grpc/factory_test.go | 169 +++++++++++++++------------ 2 files changed, 93 insertions(+), 89 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 4c1e59dd1c5..c958fcd22f4 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -67,18 +67,6 @@ type ClientPluginServices struct { remoteConn *grpc.ClientConn } -// // PluginBuilder is used to create storage plugins. Implemented by Configuration. -// // TODO this interface should be removed and the building capability moved to Factory. -// type PluginBuilder interface { -// Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) -// } - -// // Build instantiates a PluginServices -// func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { -// v2Cfg := c.translateToConfigV2() -// return v2Cfg.Build(logger, tracerProvider) -// } - // TODO move this to factory.go func (c *ConfigV2) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { telset := component.TelemetrySettings{ @@ -107,7 +95,6 @@ func newRemoteStorage(c *ConfigV2, telset component.TelemetrySettings, newClient opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) } - //remoteConn, err := c.ToClientConn(context.Background(), componenttest.NewNopHost(), telset, opts...) remoteConn, err := newClient(opts...) if err != nil { return nil, fmt.Errorf("error creating remote storage client: %w", err) diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 00f08437be5..0d4e5253a69 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -15,6 +15,7 @@ package grpc import ( + "context" "errors" "log" "net" @@ -23,6 +24,7 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/config/configauth" "go.opentelemetry.io/collector/config/configgrpc" @@ -68,6 +70,10 @@ func (s *store) DependencyReader() dependencystore.Reader { return s.deps } +func (s *store) StreamingSpanWriter() spanstore.Writer { + return s.writer +} + func makeMockServices() *grpcConfig.ClientPluginServices { return &grpcConfig.ClientPluginServices{ PluginServices: shared.PluginServices{ @@ -80,11 +86,28 @@ func makeMockServices() *grpcConfig.ClientPluginServices { writer: new(spanStoreMocks.Writer), reader: new(spanStoreMocks.Reader), }, + StreamingSpanWriter: &store{ + writer: new(spanStoreMocks.Writer), + }, }, Capabilities: new(mocks.PluginCapabilities), } } +func makeFactory(t *testing.T) *Factory { + f := NewFactory() + f.InitFromViper(viper.New(), zap.NewNop()) + require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + + keepServices := f.services + t.Cleanup(func() { + keepServices.Close() + f.Close() + }) + + return f +} + func TestNewFactoryError(t *testing.T) { cfg := &grpcConfig.ConfigV2{ ClientConfig: configgrpc.ClientConfig{ @@ -92,25 +115,27 @@ func TestNewFactoryError(t *testing.T) { Auth: &configauth.Authentication{}, }, } - _, err := NewFactoryWithConfig(*cfg, metrics.NullFactory, zap.NewNop()) - require.Error(t, err) - assert.Contains(t, err.Error(), "authenticator") - - f := NewFactory() - f.InitFromViper(viper.New(), zap.NewNop()) + t.Run("with_config", func(t *testing.T) { + _, err := NewFactoryWithConfig(*cfg, metrics.NullFactory, zap.NewNop()) + require.Error(t, err) + assert.Contains(t, err.Error(), "authenticator") + }) - f.configV2 = cfg - err = f.Initialize(metrics.NullFactory, zap.NewNop()) - require.Error(t, err) - assert.Contains(t, err.Error(), "authenticator") + t.Run("viper", func(t *testing.T) { + f := NewFactory() + f.InitFromViper(viper.New(), zap.NewNop()) + f.configV2 = cfg + err := f.Initialize(metrics.NullFactory, zap.NewNop()) + require.Error(t, err) + assert.Contains(t, err.Error(), "authenticator") + }) } func TestInitFactory(t *testing.T) { - f := NewFactory() - f.InitFromViper(viper.New(), zap.NewNop()) + f := makeFactory(t) + f.services = makeMockServices() - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - defer f.Close() + f.services.Capabilities = nil reader, err := f.CreateSpanReader() require.NoError(t, err) @@ -150,20 +175,6 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { require.NoError(t, f.Close()) } -func makeFactory(t *testing.T) *Factory { - f := NewFactory() - f.InitFromViper(viper.New(), zap.NewNop()) - require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) - - keepServices := f.services - t.Cleanup(func() { - keepServices.Close() - f.Close() - }) - - return f -} - func TestGRPCStorageFactory_Capabilities(t *testing.T) { f := makeFactory(t) @@ -259,51 +270,57 @@ func TestWithCLIFlags(t *testing.T) { require.NoError(t, f.Close()) } -// func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { -// f := NewFactory() -// v := viper.New() -// f.InitFromViper(v, zap.NewNop()) - -// f.builder = &mockPluginBuilder{ -// plugin: &mockPlugin{ -// archiveWriter: new(spanStoreMocks.Writer), -// archiveReader: new(spanStoreMocks.Reader), -// spanWriter: new(spanStoreMocks.Writer), -// }, -// writerType: "streaming", -// } -// require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) -// writer, err := f.CreateSpanWriter() -// require.NoError(t, err) -// assert.Equal(t, f.store.SpanWriter(), writer) -// } - -// func TestStreamingSpanWriterFactory_Capabilities(t *testing.T) { -// f := NewFactory() -// v := viper.New() -// f.InitFromViper(v, zap.NewNop()) - -// capabilities := new(mocks.PluginCapabilities) -// customError := errors.New("made-up error") -// capabilities.On("Capabilities"). -// Return(nil, customError).Once(). -// On("Capabilities").Return(&shared.Capabilities{}, nil).Once() - -// f.builder = &mockPluginBuilder{ -// plugin: &mockPlugin{ -// archiveWriter: new(spanStoreMocks.Writer), -// archiveReader: new(spanStoreMocks.Reader), -// spanWriter: new(spanStoreMocks.Writer), -// capabilities: capabilities, -// }, -// writerType: "streaming", -// } -// require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) -// writer, err := f.CreateSpanWriter() -// require.NoError(t, err) -// assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return error - -// writer, err = f.CreateSpanWriter() -// require.NoError(t, err) -// assert.Equal(t, f.store.SpanWriter(), writer) // get unary writer when Capabilities return false -// } +func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { + f := makeFactory(t) + + f.services = makeMockServices() + f.services.Capabilities = nil + mockWriter := f.services.Store.SpanWriter().(*spanStoreMocks.Writer) + mockWriter.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("not streaming writer")) + mockWriter2 := f.services.StreamingSpanWriter.StreamingSpanWriter().(*spanStoreMocks.Writer) + mockWriter2.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("I am streaming writer")) + + writer, err := f.CreateSpanWriter() + require.NoError(t, err) + err = writer.WriteSpan(context.Background(), nil) + require.Error(t, err) + require.Contains(t, err.Error(), "not streaming writer") +} + +func TestStreamingSpanWriterFactory_Capabilities(t *testing.T) { + f := makeFactory(t) + + f.services = makeMockServices() + capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) + customError := errors.New("made-up error") + capabilities. + // return error on the first call + On("Capabilities").Return(nil, customError).Once(). + // then return false on the second call + On("Capabilities").Return(&shared.Capabilities{}, nil).Once(). + // then return true on the second call + On("Capabilities").Return(&shared.Capabilities{StreamingSpanWriter: true}, nil).Once() + + mockWriter := f.services.Store.SpanWriter().(*spanStoreMocks.Writer) + mockWriter.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("not streaming writer")) + mockWriter2 := f.services.StreamingSpanWriter.StreamingSpanWriter().(*spanStoreMocks.Writer) + mockWriter2.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("I am streaming writer")) + + writer, err := f.CreateSpanWriter() + require.NoError(t, err) + err = writer.WriteSpan(context.Background(), nil) + require.Error(t, err) + require.Contains(t, err.Error(), "not streaming writer", "unary writer when Capabilities return error") + + writer, err = f.CreateSpanWriter() + require.NoError(t, err) + err = writer.WriteSpan(context.Background(), nil) + require.Error(t, err) + require.Contains(t, err.Error(), "not streaming writer", "unary writer when Capabilities return false") + + writer, err = f.CreateSpanWriter() + require.NoError(t, err) + err = writer.WriteSpan(context.Background(), nil) + require.Error(t, err) + require.Contains(t, err.Error(), "I am streaming writer", "streaming writer when Capabilities return true") +} From ff9ea189bcdda74add71b77d92583fad8bf42b60 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 19 May 2024 21:17:07 -0400 Subject: [PATCH 19/22] cleanup Signed-off-by: Yuri Shkuro --- plugin/storage/grpc/config/config.go | 5 +---- plugin/storage/grpc/factory_test.go | 9 +-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index c958fcd22f4..cfbbf1288f4 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -113,10 +113,7 @@ func newRemoteStorage(c *ConfigV2, telset component.TelemetrySettings, newClient func (c *ClientPluginServices) Close() error { if c.remoteConn != nil { - err := c.remoteConn.Close() - if err != nil { - return err - } + return c.remoteConn.Close() } return nil } diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 0d4e5253a69..dfc32f40612 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -105,6 +105,7 @@ func makeFactory(t *testing.T) *Factory { f.Close() }) + f.services = makeMockServices() return f } @@ -133,8 +134,6 @@ func TestNewFactoryError(t *testing.T) { func TestInitFactory(t *testing.T) { f := makeFactory(t) - - f.services = makeMockServices() f.services.Capabilities = nil reader, err := f.CreateSpanReader() @@ -178,7 +177,6 @@ func TestGRPCStorageFactoryWithConfig(t *testing.T) { func TestGRPCStorageFactory_Capabilities(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) capabilities.On("Capabilities"). Return(&shared.Capabilities{ @@ -203,7 +201,6 @@ func TestGRPCStorageFactory_Capabilities(t *testing.T) { func TestGRPCStorageFactory_CapabilitiesDisabled(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) capabilities.On("Capabilities"). Return(&shared.Capabilities{ @@ -226,7 +223,6 @@ func TestGRPCStorageFactory_CapabilitiesDisabled(t *testing.T) { func TestGRPCStorageFactory_CapabilitiesError(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) customError := errors.New("made-up error") capabilities.On("Capabilities").Return(nil, customError) @@ -244,7 +240,6 @@ func TestGRPCStorageFactory_CapabilitiesError(t *testing.T) { func TestGRPCStorageFactory_CapabilitiesNil(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() f.services.Capabilities = nil reader, err := f.CreateArchiveSpanReader() @@ -273,7 +268,6 @@ func TestWithCLIFlags(t *testing.T) { func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() f.services.Capabilities = nil mockWriter := f.services.Store.SpanWriter().(*spanStoreMocks.Writer) mockWriter.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("not streaming writer")) @@ -290,7 +284,6 @@ func TestStreamingSpanWriterFactory_CapabilitiesNil(t *testing.T) { func TestStreamingSpanWriterFactory_Capabilities(t *testing.T) { f := makeFactory(t) - f.services = makeMockServices() capabilities := f.services.Capabilities.(*mocks.PluginCapabilities) customError := errors.New("made-up error") capabilities. From dd8701e4f5ff59de36e8793da766b2406f2cee25 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 19 May 2024 21:21:41 -0400 Subject: [PATCH 20/22] simplify Signed-off-by: Yuri Shkuro --- pkg/config/tlscfg/options.go | 29 ++++++++++++++-------------- plugin/storage/grpc/config/config.go | 3 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/config/tlscfg/options.go b/pkg/config/tlscfg/options.go index c0cc7bb8304..68739e2470b 100644 --- a/pkg/config/tlscfg/options.go +++ b/pkg/config/tlscfg/options.go @@ -136,20 +136,21 @@ func (p Options) loadCertPool() (*x509.CertPool, error) { return certPool, nil } -func (o *Options) ToOtelClientConfig(v2 *configtls.ClientConfig) configtls.ClientConfig { - v2.Insecure = !o.Enabled - - v2.ServerName = o.ServerName - v2.InsecureSkipVerify = o.SkipHostVerify - v2.CAFile = o.CAPath - v2.CertFile = o.CertPath - v2.KeyFile = o.KeyPath - v2.CipherSuites = o.CipherSuites - v2.MinVersion = o.MinVersion - v2.MaxVersion = o.MaxVersion - v2.ReloadInterval = o.ReloadInterval - - return *v2 +func (o *Options) ToOtelClientConfig() configtls.ClientConfig { + return configtls.ClientConfig{ + Insecure: !o.Enabled, + InsecureSkipVerify: o.SkipHostVerify, + ServerName: o.ServerName, + Config: configtls.Config{ + CAFile: o.CAPath, + CertFile: o.CertPath, + KeyFile: o.KeyPath, + CipherSuites: o.CipherSuites, + MinVersion: o.MinVersion, + MaxVersion: o.MaxVersion, + ReloadInterval: o.ReloadInterval, + }, + } } func addCertToPool(caPath string, certPool *x509.CertPool) error { diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index cfbbf1288f4..f510bcc291d 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -48,11 +48,10 @@ type ConfigV2 struct { } func (c *Configuration) TranslateToConfigV2() *ConfigV2 { - temp := &ConfigV2{} // TODO there is no need to pass this return &ConfigV2{ ClientConfig: configgrpc.ClientConfig{ Endpoint: c.RemoteServerAddr, - TLSSetting: c.RemoteTLS.ToOtelClientConfig(&temp.TLSSetting), + TLSSetting: c.RemoteTLS.ToOtelClientConfig(), }, TimeoutSettings: exporterhelper.TimeoutSettings{ Timeout: c.RemoteConnectTimeout, From cd7799582be519816544744559486754ca2cd0a5 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Mon, 20 May 2024 23:44:54 +0530 Subject: [PATCH 21/22] add tests Signed-off-by: Harshvir Potpose --- pkg/config/tlscfg/options_test.go | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/pkg/config/tlscfg/options_test.go b/pkg/config/tlscfg/options_test.go index 81d146c5210..44ad205fdc0 100644 --- a/pkg/config/tlscfg/options_test.go +++ b/pkg/config/tlscfg/options_test.go @@ -20,9 +20,11 @@ import ( "fmt" "path/filepath" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/config/configtls" "go.uber.org/zap" ) @@ -186,3 +188,57 @@ func TestOptionsToConfig(t *testing.T) { }) } } + +func TestToOtelClientConfig(t *testing.T) { + testCases := []struct { + name string + options Options + expected configtls.ClientConfig + }{ + { + name: "insecure", + options: Options{ + Enabled: false, + }, + expected: configtls.ClientConfig{ + Insecure: true, + }, + }, + { + name: "secure with skip host verify", + options: Options{ + Enabled: true, + SkipHostVerify: true, + ServerName: "example.com", + CAPath: "path/to/ca.pem", + CertPath: "path/to/cert.pem", + KeyPath: "path/to/key.pem", + CipherSuites: []string{"TLS_RSA_WITH_AES_128_CBC_SHA"}, + MinVersion: "1.2", + MaxVersion: "1.3", + ReloadInterval: 24 * time.Hour, + }, + expected: configtls.ClientConfig{ + Insecure: false, + InsecureSkipVerify: true, + ServerName: "example.com", + Config: configtls.Config{ + CAFile: "path/to/ca.pem", + CertFile: "path/to/cert.pem", + KeyFile: "path/to/key.pem", + CipherSuites: []string{"TLS_RSA_WITH_AES_128_CBC_SHA"}, + MinVersion: "1.2", + MaxVersion: "1.3", + ReloadInterval: 24 * time.Hour, + }, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + actual := tc.options.ToOtelClientConfig() + assert.Equal(t, tc.expected, actual) + }) + } +} From 7c6e51374359b18ad5ab089331e5fb732323ce59 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Mon, 20 May 2024 23:46:20 +0530 Subject: [PATCH 22/22] fix Signed-off-by: Harshvir Potpose --- plugin/storage/grpc/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index f510bcc291d..33b274a8873 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -42,7 +42,7 @@ type Configuration struct { } type ConfigV2 struct { - TenancyOpts tenancy.Options + Tenancy tenancy.Options `mapstructure:"multi_tenancy"` configgrpc.ClientConfig `mapstructure:",squash"` exporterhelper.TimeoutSettings `mapstructure:",squash"` } @@ -88,7 +88,7 @@ func newRemoteStorage(c *ConfigV2, telset component.TelemetrySettings, newClient return nil, fmt.Errorf("authenticator is not supported") } - tenancyMgr := tenancy.NewManager(&c.TenancyOpts) + tenancyMgr := tenancy.NewManager(&c.Tenancy) if tenancyMgr.Enabled { opts = append(opts, grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tenancyMgr))) opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr)))