Skip to content

Commit

Permalink
chore: bump opentelemetry libraries to version v1.21.0 and collector …
Browse files Browse the repository at this point in the history
…to v0.80.0 (#3195)

* fix: build issue with go.work

* fix: agent grpc connection

* fix: semconv version
  • Loading branch information
mathnogueira authored Sep 29, 2023
1 parent 3077155 commit 373afc2
Show file tree
Hide file tree
Showing 10 changed files with 512 additions and 160 deletions.
6 changes: 4 additions & 2 deletions agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0
github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery v1.1.0
github.com/Code-Hex/go-generics-cache v1.3.1
github.com/aws/aws-sdk-go v1.44.196
github.com/davecgh/go-spew v1.1.1
github.com/elastic/go-elasticsearch/v8 v8.4.0-alpha.1.0.20221227164349-c40d762a40ad
github.com/fluidtruck/deepcopy v1.0.0
github.com/fullstorydev/grpcurl v1.8.6
Expand All @@ -22,6 +24,7 @@ require (
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.1
go.opencensus.io v0.24.0
go.opentelemetry.io/collector v0.44.0
go.opentelemetry.io/collector/semconv v0.71.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0
Expand All @@ -41,13 +44,11 @@ require (
require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
github.com/Code-Hex/go-generics-cache v1.3.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/alecthomas/participle/v2 v2.0.0-alpha8 // indirect
github.com/brianvoe/gofakeit/v6 v6.17.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/elastic/elastic-transport-go/v8 v8.0.0-20211216131617-bbee439d559c // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
Expand All @@ -56,6 +57,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-yaml v1.11.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
Expand Down
29 changes: 29 additions & 0 deletions agent/go.sum

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions agent/workers/datastores/datasource/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"github.com/kubeshop/tracetest/server/tracedb/connection"
"github.com/kubeshop/tracetest/server/traces"
"github.com/pkg/errors"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configcompression"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configtls"
"google.golang.org/grpc"
)
Expand All @@ -24,13 +25,18 @@ type GrpcClient struct {
}

func convertDomainConfigToOpenTelemetryConfig(config *datastore.GRPCClientSettings) *configgrpc.GRPCClientSettings {
headers := make(map[string]configopaque.String)
for name, value := range config.Headers {
headers[name] = configopaque.String(value)
}

// manual map domain fields to OTel fields
otelConfig := &configgrpc.GRPCClientSettings{
Endpoint: config.Endpoint,
ReadBufferSize: config.ReadBufferSize,
WriteBufferSize: config.WriteBufferSize,
WaitForReady: config.WaitForReady,
Headers: config.Headers,
Headers: headers,
BalancerName: config.BalancerName,

Compression: configcompression.CompressionType(config.Compression),
Expand Down Expand Up @@ -84,12 +90,7 @@ func (client *GrpcClient) Endpoint() string {
}

func (client *GrpcClient) Connect(ctx context.Context) error {
opts, err := client.config.ToDialOptions(nil, componenttest.NewNopTelemetrySettings())
if err != nil {
return errors.Wrap(connection.ErrInvalidConfiguration, err.Error())
}

conn, err := grpc.DialContext(ctx, client.config.Endpoint, opts...)
conn, err := client.config.ToClientConn(ctx, nil, component.TelemetrySettings{})
if err != nil {
return errors.Wrap(connection.ErrConnectionFailed, err.Error())
}
Expand Down
266 changes: 255 additions & 11 deletions go.work.sum

Large diffs are not rendered by default.

82 changes: 47 additions & 35 deletions server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/goccy/go-yaml v1.11.0
github.com/gogo/protobuf v1.3.2
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
Expand All @@ -33,35 +33,39 @@ require (
github.com/jhump/protoreflect v1.12.0
github.com/json-iterator/go v1.1.12
github.com/labstack/gommon v0.3.0
github.com/mitchellh/mapstructure v1.5.0
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
github.com/ohler55/ojg v1.14.4
github.com/opensearch-project/opensearch-go v1.1.0
github.com/orlangure/gnomock v0.20.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/prometheus v1.8.2-0.20211217191541-41f1a8125e66
github.com/segmentio/analytics-go/v3 v3.2.1
github.com/spf13/cobra v1.6.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.4
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569
go.opentelemetry.io/collector v0.44.0
go.opentelemetry.io/collector/pdata v0.49.0
go.opentelemetry.io/collector/semconv v0.71.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0
go.opentelemetry.io/collector/component v0.80.0
go.opentelemetry.io/collector/config/configcompression v0.80.0
go.opentelemetry.io/collector/config/configgrpc v0.80.0
go.opentelemetry.io/collector/config/configopaque v0.80.0
go.opentelemetry.io/collector/config/configtls v0.80.0
go.opentelemetry.io/collector/pdata v1.0.0-rcv0015
go.opentelemetry.io/collector/semconv v0.80.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.44.0
go.opentelemetry.io/contrib/propagators/aws v1.5.0
go.opentelemetry.io/contrib/propagators/b3 v1.5.0
go.opentelemetry.io/contrib/propagators/b3 v1.17.0
go.opentelemetry.io/contrib/propagators/jaeger v1.5.0
go.opentelemetry.io/contrib/propagators/ot v1.5.0
go.opentelemetry.io/otel v1.10.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.6.0
go.opentelemetry.io/otel/sdk v1.10.0
go.opentelemetry.io/otel/trace v1.10.0
go.opentelemetry.io/proto/otlp v0.19.0
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.1
google.golang.org/grpc v1.58.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.1.0
Expand All @@ -74,7 +78,7 @@ require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v20.10.24+incompatible // indirect
Expand All @@ -86,17 +90,17 @@ require (
github.com/elastic/elastic-transport-go/v8 v8.0.0-20211216131617-bbee439d559c // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-redis/redis/v7 v7.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.0 // indirect
Expand All @@ -106,8 +110,8 @@ require (
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/knadh/koanf v1.4.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lib/pq v1.10.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
Expand All @@ -117,10 +121,9 @@ 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.1.16 // indirect
github.com/mostynb/go-grpc-compression v1.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
Expand All @@ -136,20 +139,29 @@ require (
github.com/subosito/gotenv v1.4.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
go.opentelemetry.io/collector/model v0.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
go.opentelemetry.io/otel/metric v0.26.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
go.opentelemetry.io/collector v0.80.0 // indirect
go.opentelemetry.io/collector/config/configauth v0.80.0 // indirect
go.opentelemetry.io/collector/config/confignet v0.80.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.80.0 // indirect
go.opentelemetry.io/collector/config/internal v0.80.0 // indirect
go.opentelemetry.io/collector/confmap v0.80.0 // indirect
go.opentelemetry.io/collector/extension v0.80.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.80.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

Expand Down
Loading

0 comments on commit 373afc2

Please sign in to comment.