From 5a4169c098afd4708b66902ba72de55d59641912 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Sun, 29 Oct 2023 19:38:56 +0530 Subject: [PATCH 01/12] chore: add extension to components --- .github/dependabot.yml | 20 +- cmd/otelcontribcol/components.go | 10 + cmd/otelcontribcol/go.mod | 22 +- cmd/otelcontribcol/go.sum | 13 +- extension/encoding/Makefile | 1 + extension/encoding/encoding.go | 34 +++ extension/encoding/encoding_test.go | 330 ++++++++++++++++++++++++++++ extension/encoding/go.mod | 63 ++++++ extension/encoding/go.sum | 133 +++++++++++ 9 files changed, 602 insertions(+), 24 deletions(-) create mode 100644 extension/encoding/Makefile create mode 100644 extension/encoding/encoding.go create mode 100644 extension/encoding/encoding_test.go create mode 100644 extension/encoding/go.mod create mode 100644 extension/encoding/go.sum diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 68a06aaa070f..fab2545b6d99 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -302,6 +302,16 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/extension/encoding/textencodingextension" + schedule: + interval: "weekly" + day: "wednesday" + - package-ecosystem: "gomod" + directory: "/extension/encoding/zipkinencodingextension" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/extension/headerssetterextension" schedule: @@ -452,16 +462,6 @@ updates: schedule: interval: "weekly" day: "wednesday" - - package-ecosystem: "gomod" - directory: "/pkg/golden" - schedule: - interval: "weekly" - day: "wednesday" - - package-ecosystem: "gomod" - directory: "/pkg/ottl" - schedule: - interval: "weekly" - day: "wednesday" - package-ecosystem: "gomod" directory: "/pkg/pdatatest" schedule: diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 878d2914314c..b18eef142f9a 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -72,6 +72,11 @@ import ( awsproxy "github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy" basicauthextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension" bearertokenauthextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension" + otlpencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" + jaegerencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension" + jsonlogencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension" + textencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension" + zipkinencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension" headerssetterextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension" healthcheckextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension" httpforwarder "github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder" @@ -222,6 +227,11 @@ func components() (otelcol.Factories, error) { sigv4authextension.NewFactory(), filestorage.NewFactory(), dbstorage.NewFactory(), + otlpencodingextension.NewFactory(), + jaegerencodingextension.NewFactory(), + jsonlogencodingextension.NewFactory(), + textencodingextension.NewFactory(), + zipkinencodingextension.NewFactory(), ) if err != nil { return otelcol.Factories{}, err diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 809128e2c2d0..e461746414fc 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -57,6 +57,11 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder v0.88.0 @@ -369,7 +374,7 @@ require ( github.com/getsentry/sentry-go v0.25.0 // indirect github.com/go-faster/city v1.0.1 // indirect github.com/go-faster/errors v0.6.1 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.2.4 // indirect @@ -451,7 +456,7 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect github.com/jackc/pgx/v4 v4.18.1 // indirect - github.com/jaegertracing/jaeger v1.48.0 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect github.com/jcmturner/gofork v1.7.6 // indirect @@ -549,7 +554,6 @@ require ( github.com/opencontainers/selinux v1.10.0 // indirect github.com/openshift/api v3.9.0+incompatible // indirect github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/outcaste-io/ristretto v0.2.1 // indirect github.com/ovh/go-ovh v1.4.1 // indirect @@ -610,8 +614,6 @@ require ( github.com/tinylib/msgp v1.1.8 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/vincent-petithory/dataurl v1.0.0 // indirect github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 // indirect github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect @@ -1137,3 +1139,13 @@ replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api replace github.com/outcaste-io/ristretto v0.2.0 => github.com/outcaste-io/ristretto v0.2.1 replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 47b2c36c948b..66511fc85116 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -601,8 +601,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -984,8 +984,8 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jaegertracing/jaeger v1.48.0 h1:YuKooQ7qJsjgxws9xuf8C/BLNTPx8qTAJz4wv7IHhSc= -github.com/jaegertracing/jaeger v1.48.0/go.mod h1:BoAPkdCAIEuLsVz/EDhjXd+GSVpHtJhiGqWoFEvBCKg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc= github.com/jawher/mow.cli v1.0.4/go.mod h1:5hQj2V8g+qYmLUVWqu4Wuja1pI57M83EChYLVZ0sMKk= github.com/jawher/mow.cli v1.2.0/go.mod h1:y+pcA3jBAdo/GIZx/0rFjw/K2bVEODP9rfZOfaiq8Ko= @@ -1264,7 +1264,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -1530,10 +1529,6 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= -github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vincent-petithory/dataurl v1.0.0 h1:cXw+kPto8NLuJtlMsI152irrVw9fRDX8AbShPRpg2CI= diff --git a/extension/encoding/Makefile b/extension/encoding/Makefile new file mode 100644 index 000000000000..bdd863a203be --- /dev/null +++ b/extension/encoding/Makefile @@ -0,0 +1 @@ +include ../../../Makefile.Common diff --git a/extension/encoding/encoding.go b/extension/encoding/encoding.go new file mode 100644 index 000000000000..2cdae7f55983 --- /dev/null +++ b/extension/encoding/encoding.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package encoding // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding" + +import ( + "fmt" + + "go.opentelemetry.io/collector/component" +) + +var errNoExtensionFound = "no extension found: %s" +var errNotAnEncodingExtension = "extension %q doesn't implement %T" + +/* +Receivers wanting to Unmarshal can use the GetEncoding like following: + + unmarshaler, err := GetEncoding[(pmetric|ptrace|plog).Unmarshaler](host.GetExtensions(), id) + +Exporters wanting to Marshal can use the GetEncoding like following: + + marshaler, err := GetEncoding[(pmetric|ptrace|plog).Marshaler](host.GetExtensions(), id) +*/ +func GetEncoding[T any](extensions map[component.ID]component.Component, componentID component.ID) (T, error) { + var val T + if ext, ok := extensions[componentID]; ok { + unmarshaler, ok := ext.(T) + if !ok { + return val, fmt.Errorf(errNotAnEncodingExtension, componentID, &val) + } + return unmarshaler, nil + } + return val, fmt.Errorf(errNoExtensionFound, componentID) +} diff --git a/extension/encoding/encoding_test.go b/extension/encoding/encoding_test.go new file mode 100644 index 000000000000..33ff6d300e21 --- /dev/null +++ b/extension/encoding/encoding_test.go @@ -0,0 +1,330 @@ +package encoding + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensiontest" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension" +) + +type mockHost struct { + component.Host + ext map[component.ID]component.Component +} + +func (mh mockHost) GetExtensions() map[component.ID]component.Component { + return mh.ext +} + +func TestEncodingStart(t *testing.T) { + tests := []struct { + name string + getExtension func() (extension.Extension, error) + expectedErr string + }{ + { + name: "otlpJson", + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*otlpencodingextension.Config).Protocol = "otlp_json" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "otlpProtobuf", + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*otlpencodingextension.Config).Protocol = "otlp_proto" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "zipkinJSON", + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*zipkinencodingextension.Config).Protocol = "zipkin_json" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "zipkinProtobuf", + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*zipkinencodingextension.Config).Protocol = "zipkin_proto" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "zipkinProtobuf", + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*zipkinencodingextension.Config).Protocol = "zipkin_thrift" + cfg.(*zipkinencodingextension.Config).Version = "v1" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "jaegerProtobuf", + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "jsonLog", + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "text", + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "text_gbk", + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*textencodingextension.Config).Encoding = "gbk" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + }, + { + name: "otlpProtocol_invalid", + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*otlpencodingextension.Config).Protocol = "otlp_xyz" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + expectedErr: "unsupported protocol: \"otlp_xyz\"", + }, + { + name: "zipkinThriftVersion_invalid", + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*zipkinencodingextension.Config).Protocol = "zipkin_thrift" + cfg.(*zipkinencodingextension.Config).Version = "v2" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + expectedErr: "unsupported version: \"v2\"", + }, + { + name: "jaeger_invalid", + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*jaegerencodingextension.Config).Protocol = "xyz" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + expectedErr: "unsupported protocol: \"xyz\"", + }, + { + name: "text_invalid", + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + cfg := factory.CreateDefaultConfig() + cfg.(*textencodingextension.Config).Encoding = "invalid" + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + }, + expectedErr: "unsupported encoding 'invalid'", + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ext, err := test.getExtension() + if test.expectedErr != "" && err != nil { + require.ErrorContains(t, err, test.expectedErr) + } else { + require.NoError(t, err) + } + err = ext.Start(context.Background(), componenttest.NewNopHost()) + if test.expectedErr != "" && err != nil { + require.ErrorContains(t, err, test.expectedErr) + } else { + require.NoError(t, err) + } + }) + } +} + +type getEncodingFunc func(map[component.ID]component.Component, component.ID) error + +func getEncoding[T any](extensions map[component.ID]component.Component, id component.ID) error { + _, err := GetEncoding[T](extensions, id) + return err +} + +func TestMarshalUnmarshal(t *testing.T) { + tests := []struct { + name string + expectedErr string + id component.ID + getExtension func() (extension.Extension, error) + cases []getEncodingFunc + }{ + { + name: "otlp", + id: component.NewIDWithName(component.DataTypeTraces, "otlpencoding"), + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports logs, traces, metrics + cases: []getEncodingFunc{ + getEncoding[ptrace.Marshaler], + getEncoding[pmetric.Marshaler], + getEncoding[plog.Marshaler], + getEncoding[ptrace.Unmarshaler], + getEncoding[pmetric.Unmarshaler], + getEncoding[plog.Unmarshaler], + }, + }, + { + name: "jaeger", + id: component.NewIDWithName(component.DataTypeTraces, "jaegerencoding"), + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only traces (only unmarshaling) + cases: []getEncodingFunc{ + getEncoding[ptrace.Unmarshaler], + }, + }, + { + name: "zipkin", + id: component.NewIDWithName(component.DataTypeTraces, "zipkinencoding"), + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only traces + cases: []getEncodingFunc{ + getEncoding[ptrace.Unmarshaler], + getEncoding[ptrace.Marshaler], + }, + }, + { + name: "zipkin", + id: component.NewIDWithName(component.DataTypeTraces, "zipkinencoding"), + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only traces, should raise error for logs/metrics + expectedErr: "extension \"traces/zipkinencoding\" doesn't implement", + cases: []getEncodingFunc{ + getEncoding[plog.Unmarshaler], + getEncoding[plog.Marshaler], + getEncoding[pmetric.Marshaler], + getEncoding[pmetric.Marshaler], + }, + }, + { + name: "jsonlog", + id: component.NewIDWithName(component.DataTypeLogs, "jsonlogencoding"), + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only logs + cases: []getEncodingFunc{ + getEncoding[plog.Marshaler], + getEncoding[plog.Unmarshaler], + }, + }, + { + name: "jsonlogError", + id: component.NewIDWithName(component.DataTypeLogs, "jsonlogencoding"), + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only logs, should raise error for trace/metrics + expectedErr: "extension \"logs/jsonlogencoding\" doesn't implement", + cases: []getEncodingFunc{ + getEncoding[ptrace.Marshaler], + getEncoding[ptrace.Unmarshaler], + getEncoding[pmetric.Unmarshaler], + getEncoding[pmetric.Unmarshaler], + }, + }, + { + name: "text", + id: component.NewIDWithName(component.DataTypeLogs, "textencoding"), + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only logs + cases: []getEncodingFunc{ + getEncoding[plog.Marshaler], + getEncoding[plog.Unmarshaler], + }, + }, + { + name: "textError", + id: component.NewIDWithName(component.DataTypeLogs, "textencoding"), + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + // Supports only logs, should raise error for trace/metrics + expectedErr: "extension \"logs/textencoding\" doesn't implement", + cases: []getEncodingFunc{ + getEncoding[ptrace.Marshaler], + getEncoding[ptrace.Unmarshaler], + getEncoding[pmetric.Unmarshaler], + getEncoding[pmetric.Unmarshaler], + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ext, err := test.getExtension() + host := mockHost{ + ext: map[component.ID]component.Component{ + test.id: ext, + }, + } + if test.expectedErr != "" && err != nil { + require.ErrorContains(t, err, test.expectedErr) + } else { + require.NoError(t, err) + } + for _, c := range test.cases { + err := c(host.ext, test.id) + if test.expectedErr != "" { + require.ErrorContains(t, err, test.expectedErr) + } else { + require.NoError(t, err) + } + } + }) + } +} diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod new file mode 100644 index 000000000000..d522bc516fc3 --- /dev/null +++ b/extension/encoding/go.mod @@ -0,0 +1,63 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding + +go 1.21.2 + +require ( + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.1-0.20231026220224-6405e152a2d9 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.1-0.20231026220224-6405e152a2d9 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.1-0.20231026220224-6405e152a2d9 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.1-0.20231026220224-6405e152a2d9 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.1-0.20231026220224-6405e152a2d9 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 +) + +require ( + github.com/apache/thrift v0.19.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.0.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum new file mode 100644 index 000000000000..d6cf6d4daef5 --- /dev/null +++ b/extension/encoding/go.sum @@ -0,0 +1,133 @@ +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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +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/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= +github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 h1:2HoGcjmHHIDMafd3Uj3flQJrV8TC2FAnUiTKD8FH0G8= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0/go.mod h1:JvXKcDtcOQRkz/Sw1m27K4QA3OwMbUvifoeEX2NQC6k= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 h1:STZGszub1FE1KK2aUd7G3ug7NPZHG0jsJyXFqZqT/oM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0/go.mod h1:96TdUZaiZ8Lc7tb0DLm+HnlcxAdoWpxQsgfACCzB5bQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 h1:CbOphuqtAEBGxekn4UWER3sSTJV+svj81cCKb/C0zeA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0/go.mod h1:e6YWJ8qc6a7oSa3b8YB+uDZkblXYl6KVUFwHPPVzDCs= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= +go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From b83727ca044f858072ba5f40233b5f3a92761e77 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Sun, 29 Oct 2023 20:20:00 +0530 Subject: [PATCH 02/12] chore: update githubgen --- .github/ALLOWLIST | 1 + .github/CODEOWNERS | 4 ++-- .github/dependabot.yml | 20 ++++++++++---------- cmd/checkapi/allowlist.txt | 1 + cmd/githubgen/main.go | 1 + cmd/otelcontribcol/builder-config.yaml | 15 +++++++++++++++ cmd/otelcontribcol/components.go | 2 +- cmd/otelcontribcol/extensions_test.go | 20 ++++++++++++++++++++ extension/encoding/Makefile | 2 +- extension/encoding/encoding_test.go | 4 +++- extension/encoding/go.mod | 14 +++++++++++++- extension/encoding/go.sum | 14 -------------- versions.yaml | 1 + 13 files changed, 69 insertions(+), 30 deletions(-) diff --git a/.github/ALLOWLIST b/.github/ALLOWLIST index 10f7f9d51107..8e7f6bee3da0 100644 --- a/.github/ALLOWLIST +++ b/.github/ALLOWLIST @@ -20,6 +20,7 @@ ## COMMON & SHARED components internal/common +extension/encoding ## DEPRECATED components diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cd47996e7d09..8e1984d0fffc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -93,9 +93,9 @@ extension/basicauthextension/ @open-te extension/bearertokenauthextension/ @open-telemetry/collector-contrib-approvers @jpkrohling @frzifus extension/encoding/jaegerencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @atoulme extension/encoding/jsonlogencodingextension/ @open-telemetry/collector-contrib-approvers @VihasMakwana @atoulme +extension/encoding/otlpencodingextension/ @open-telemetry/collector-contrib-approvers @dao-jun @VihasMakwana extension/encoding/textencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @atoulme -extension/encoding/zipkinencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun -extension/encoding/otlpencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun +extension/encoding/zipkinencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun extension/headerssetterextension/ @open-telemetry/collector-contrib-approvers @jpkrohling extension/healthcheckextension/ @open-telemetry/collector-contrib-approvers @jpkrohling extension/httpforwarder/ @open-telemetry/collector-contrib-approvers @atoulme @rmfitzpatrick diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fab2545b6d99..68a06aaa070f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -302,16 +302,6 @@ updates: schedule: interval: "weekly" day: "wednesday" - - package-ecosystem: "gomod" - directory: "/extension/encoding/textencodingextension" - schedule: - interval: "weekly" - day: "wednesday" - - package-ecosystem: "gomod" - directory: "/extension/encoding/zipkinencodingextension" - schedule: - interval: "weekly" - day: "wednesday" - package-ecosystem: "gomod" directory: "/extension/headerssetterextension" schedule: @@ -462,6 +452,16 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/pkg/golden" + schedule: + interval: "weekly" + day: "wednesday" + - package-ecosystem: "gomod" + directory: "/pkg/ottl" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/pkg/pdatatest" schedule: diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index feb33d18c7d3..683be95a7acd 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -1,4 +1,5 @@ connector/servicegraphconnector +extension/encoding extension/observer processor/servicegraphprocessor receiver/carbonreceiver diff --git a/cmd/githubgen/main.go b/cmd/githubgen/main.go index 7de47722cd4a..f2a60f0a5992 100644 --- a/cmd/githubgen/main.go +++ b/cmd/githubgen/main.go @@ -76,6 +76,7 @@ const allowlistHeader = `# Code generated by githubgen. DO NOT EDIT. ## COMMON & SHARED components internal/common +extension/encoding ` diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index d7ef114d26c3..4afaf7d54456 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -29,6 +29,16 @@ extensions: import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.88.0 import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/dbstorage + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension exporters: - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.88.1-0.20231026220224-6405e152a2d9 @@ -418,3 +428,8 @@ replaces: - github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api v0.0.0-20180801171038-322a19404e37 - github.com/outcaste-io/ristretto v0.2.0 => github.com/outcaste-io/ristretto v0.2.1 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index b18eef142f9a..ebf9501986a8 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -72,9 +72,9 @@ import ( awsproxy "github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy" basicauthextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension" bearertokenauthextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension" - otlpencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" jaegerencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension" jsonlogencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension" + otlpencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" textencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension" zipkinencodingextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension" headerssetterextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension" diff --git a/cmd/otelcontribcol/extensions_test.go b/cmd/otelcontribcol/extensions_test.go index b7b076be4db3..80be79bc7bae 100644 --- a/cmd/otelcontribcol/extensions_test.go +++ b/cmd/otelcontribcol/extensions_test.go @@ -217,6 +217,26 @@ func TestDefaultExtensions(t *testing.T) { return extFactories["jaegerremotesampling"].CreateDefaultConfig().(*jaegerremotesampling.Config) }, }, + { + extension: "otlp_encoding", + skipLifecycle: true, // Requires a docker api to interface and validate. + }, + { + extension: "text_encoding", + skipLifecycle: true, // Requires a docker api to interface and validate. + }, + { + extension: "jaeger_encoding", + skipLifecycle: true, // Requires a docker api to interface and validate. + }, + { + extension: "json_log_encoding", + skipLifecycle: true, // Requires a docker api to interface and validate. + }, + { + extension: "zipkin_encoding", + skipLifecycle: true, // Requires a docker api to interface and validate. + }, } extensionCount := 0 diff --git a/extension/encoding/Makefile b/extension/encoding/Makefile index bdd863a203be..ded7a36092dc 100644 --- a/extension/encoding/Makefile +++ b/extension/encoding/Makefile @@ -1 +1 @@ -include ../../../Makefile.Common +include ../../Makefile.Common diff --git a/extension/encoding/encoding_test.go b/extension/encoding/encoding_test.go index 33ff6d300e21..de5b7bebdf56 100644 --- a/extension/encoding/encoding_test.go +++ b/extension/encoding/encoding_test.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package encoding import ( @@ -5,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod index d522bc516fc3..f268ad0722a1 100644 --- a/extension/encoding/go.mod +++ b/extension/encoding/go.mod @@ -1,6 +1,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding -go 1.21.2 +go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.1-0.20231026220224-6405e152a2d9 @@ -61,3 +61,15 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/enco replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum index d6cf6d4daef5..43c3a7118512 100644 --- a/extension/encoding/go.sum +++ b/extension/encoding/go.sum @@ -4,9 +4,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -14,7 +12,6 @@ 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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= @@ -29,9 +26,7 @@ github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= @@ -43,18 +38,11 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 h1:2HoGcjmHHIDMafd3Uj3flQJrV8TC2FAnUiTKD8FH0G8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0/go.mod h1:JvXKcDtcOQRkz/Sw1m27K4QA3OwMbUvifoeEX2NQC6k= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 h1:STZGszub1FE1KK2aUd7G3ug7NPZHG0jsJyXFqZqT/oM= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0/go.mod h1:96TdUZaiZ8Lc7tb0DLm+HnlcxAdoWpxQsgfACCzB5bQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 h1:CbOphuqtAEBGxekn4UWER3sSTJV+svj81cCKb/C0zeA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0/go.mod h1:e6YWJ8qc6a7oSa3b8YB+uDZkblXYl6KVUFwHPPVzDCs= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -82,7 +70,6 @@ go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319 go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -128,6 +115,5 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/versions.yaml b/versions.yaml index 82001c21e2ee..894a4d1e3880 100644 --- a/versions.yaml +++ b/versions.yaml @@ -70,6 +70,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy - github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension From a791a0064481192f78748fcd633942b8bc6c6ba2 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Mon, 30 Oct 2023 14:25:38 +0530 Subject: [PATCH 03/12] chore: remove utility functions --- extension/encoding/Makefile | 1 - extension/encoding/encoding.go | 34 ---------- extension/encoding/go.mod | 75 --------------------- extension/encoding/go.sum | 119 --------------------------------- 4 files changed, 229 deletions(-) delete mode 100644 extension/encoding/Makefile delete mode 100644 extension/encoding/encoding.go delete mode 100644 extension/encoding/go.mod delete mode 100644 extension/encoding/go.sum diff --git a/extension/encoding/Makefile b/extension/encoding/Makefile deleted file mode 100644 index ded7a36092dc..000000000000 --- a/extension/encoding/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common diff --git a/extension/encoding/encoding.go b/extension/encoding/encoding.go deleted file mode 100644 index 2cdae7f55983..000000000000 --- a/extension/encoding/encoding.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package encoding // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding" - -import ( - "fmt" - - "go.opentelemetry.io/collector/component" -) - -var errNoExtensionFound = "no extension found: %s" -var errNotAnEncodingExtension = "extension %q doesn't implement %T" - -/* -Receivers wanting to Unmarshal can use the GetEncoding like following: - - unmarshaler, err := GetEncoding[(pmetric|ptrace|plog).Unmarshaler](host.GetExtensions(), id) - -Exporters wanting to Marshal can use the GetEncoding like following: - - marshaler, err := GetEncoding[(pmetric|ptrace|plog).Marshaler](host.GetExtensions(), id) -*/ -func GetEncoding[T any](extensions map[component.ID]component.Component, componentID component.ID) (T, error) { - var val T - if ext, ok := extensions[componentID]; ok { - unmarshaler, ok := ext.(T) - if !ok { - return val, fmt.Errorf(errNotAnEncodingExtension, componentID, &val) - } - return unmarshaler, nil - } - return val, fmt.Errorf(errNoExtensionFound, componentID) -} diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod deleted file mode 100644 index f268ad0722a1..000000000000 --- a/extension/encoding/go.mod +++ /dev/null @@ -1,75 +0,0 @@ -module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding - -go 1.20 - -require ( - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.1-0.20231026220224-6405e152a2d9 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.1-0.20231026220224-6405e152a2d9 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.1-0.20231026220224-6405e152a2d9 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.1-0.20231026220224-6405e152a2d9 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.1-0.20231026220224-6405e152a2d9 - github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 - go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 - go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 -) - -require ( - github.com/apache/thrift v0.19.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/jaegertracing/jaeger v1.49.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.0.1 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 // indirect - github.com/openzipkin/zipkin-go v0.4.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum deleted file mode 100644 index 43c3a7118512..000000000000 --- a/extension/encoding/go.sum +++ /dev/null @@ -1,119 +0,0 @@ -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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= -github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= -github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -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/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= -github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= -github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= -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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 73115cc4c4356f045bbfe7b312e5f2c1751a15e4 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Mon, 30 Oct 2023 14:35:05 +0530 Subject: [PATCH 04/12] chore: add go.mod --- cmd/otelcontribcol/extensions_test.go | 15 ++-- extension/encoding/Makefile | 1 + extension/encoding/encoding_test.go | 90 ++++++++++--------- extension/encoding/go.mod | 75 ++++++++++++++++ extension/encoding/go.sum | 119 ++++++++++++++++++++++++++ 5 files changed, 248 insertions(+), 52 deletions(-) create mode 100644 extension/encoding/Makefile create mode 100644 extension/encoding/go.mod create mode 100644 extension/encoding/go.sum diff --git a/cmd/otelcontribcol/extensions_test.go b/cmd/otelcontribcol/extensions_test.go index 80be79bc7bae..4799e5e9443b 100644 --- a/cmd/otelcontribcol/extensions_test.go +++ b/cmd/otelcontribcol/extensions_test.go @@ -218,24 +218,19 @@ func TestDefaultExtensions(t *testing.T) { }, }, { - extension: "otlp_encoding", - skipLifecycle: true, // Requires a docker api to interface and validate. + extension: "otlp_encoding", }, { - extension: "text_encoding", - skipLifecycle: true, // Requires a docker api to interface and validate. + extension: "text_encoding", }, { - extension: "jaeger_encoding", - skipLifecycle: true, // Requires a docker api to interface and validate. + extension: "jaeger_encoding", }, { - extension: "json_log_encoding", - skipLifecycle: true, // Requires a docker api to interface and validate. + extension: "json_log_encoding", }, { - extension: "zipkin_encoding", - skipLifecycle: true, // Requires a docker api to interface and validate. + extension: "zipkin_encoding", }, } diff --git a/extension/encoding/Makefile b/extension/encoding/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/extension/encoding/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/extension/encoding/encoding_test.go b/extension/encoding/encoding_test.go index de5b7bebdf56..f2bb8a95ee15 100644 --- a/extension/encoding/encoding_test.go +++ b/extension/encoding/encoding_test.go @@ -5,6 +5,7 @@ package encoding import ( "context" + "fmt" "testing" "github.com/stretchr/testify/require" @@ -174,11 +175,16 @@ func TestEncodingStart(t *testing.T) { } } -type getEncodingFunc func(map[component.ID]component.Component, component.ID) error +type marshalUnmarshalFn func(*testing.T, map[component.ID]component.Component, component.ID) error -func getEncoding[T any](extensions map[component.ID]component.Component, id component.ID) error { - _, err := GetEncoding[T](extensions, id) - return err +func marshalUnmarshal[T any](t *testing.T, extensions map[component.ID]component.Component, id component.ID) error { + ext, ok := extensions[id] + require.NotNil(t, ext) + require.True(t, ok) + if _, ok := ext.(T); !ok { + return fmt.Errorf("%s doesn't implement %T", id, (*T)(nil)) + } + return nil } func TestMarshalUnmarshal(t *testing.T) { @@ -187,7 +193,7 @@ func TestMarshalUnmarshal(t *testing.T) { expectedErr string id component.ID getExtension func() (extension.Extension, error) - cases []getEncodingFunc + cases []marshalUnmarshalFn }{ { name: "otlp", @@ -197,13 +203,13 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports logs, traces, metrics - cases: []getEncodingFunc{ - getEncoding[ptrace.Marshaler], - getEncoding[pmetric.Marshaler], - getEncoding[plog.Marshaler], - getEncoding[ptrace.Unmarshaler], - getEncoding[pmetric.Unmarshaler], - getEncoding[plog.Unmarshaler], + cases: []marshalUnmarshalFn{ + marshalUnmarshal[ptrace.Marshaler], + marshalUnmarshal[pmetric.Marshaler], + marshalUnmarshal[plog.Marshaler], + marshalUnmarshal[ptrace.Unmarshaler], + marshalUnmarshal[pmetric.Unmarshaler], + marshalUnmarshal[plog.Unmarshaler], }, }, { @@ -214,8 +220,8 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only traces (only unmarshaling) - cases: []getEncodingFunc{ - getEncoding[ptrace.Unmarshaler], + cases: []marshalUnmarshalFn{ + marshalUnmarshal[ptrace.Unmarshaler], }, }, { @@ -226,9 +232,9 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only traces - cases: []getEncodingFunc{ - getEncoding[ptrace.Unmarshaler], - getEncoding[ptrace.Marshaler], + cases: []marshalUnmarshalFn{ + marshalUnmarshal[ptrace.Unmarshaler], + marshalUnmarshal[ptrace.Marshaler], }, }, { @@ -239,12 +245,12 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only traces, should raise error for logs/metrics - expectedErr: "extension \"traces/zipkinencoding\" doesn't implement", - cases: []getEncodingFunc{ - getEncoding[plog.Unmarshaler], - getEncoding[plog.Marshaler], - getEncoding[pmetric.Marshaler], - getEncoding[pmetric.Marshaler], + expectedErr: "traces/zipkinencoding doesn't implement", + cases: []marshalUnmarshalFn{ + marshalUnmarshal[plog.Unmarshaler], + marshalUnmarshal[plog.Marshaler], + marshalUnmarshal[pmetric.Marshaler], + marshalUnmarshal[pmetric.Marshaler], }, }, { @@ -255,9 +261,9 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only logs - cases: []getEncodingFunc{ - getEncoding[plog.Marshaler], - getEncoding[plog.Unmarshaler], + cases: []marshalUnmarshalFn{ + marshalUnmarshal[plog.Marshaler], + marshalUnmarshal[plog.Unmarshaler], }, }, { @@ -268,12 +274,12 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only logs, should raise error for trace/metrics - expectedErr: "extension \"logs/jsonlogencoding\" doesn't implement", - cases: []getEncodingFunc{ - getEncoding[ptrace.Marshaler], - getEncoding[ptrace.Unmarshaler], - getEncoding[pmetric.Unmarshaler], - getEncoding[pmetric.Unmarshaler], + expectedErr: "logs/jsonlogencoding doesn't implement", + cases: []marshalUnmarshalFn{ + marshalUnmarshal[ptrace.Marshaler], + marshalUnmarshal[ptrace.Unmarshaler], + marshalUnmarshal[pmetric.Unmarshaler], + marshalUnmarshal[pmetric.Unmarshaler], }, }, { @@ -284,9 +290,9 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only logs - cases: []getEncodingFunc{ - getEncoding[plog.Marshaler], - getEncoding[plog.Unmarshaler], + cases: []marshalUnmarshalFn{ + marshalUnmarshal[plog.Marshaler], + marshalUnmarshal[plog.Unmarshaler], }, }, { @@ -297,12 +303,12 @@ func TestMarshalUnmarshal(t *testing.T) { return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) }, // Supports only logs, should raise error for trace/metrics - expectedErr: "extension \"logs/textencoding\" doesn't implement", - cases: []getEncodingFunc{ - getEncoding[ptrace.Marshaler], - getEncoding[ptrace.Unmarshaler], - getEncoding[pmetric.Unmarshaler], - getEncoding[pmetric.Unmarshaler], + expectedErr: "logs/textencoding doesn't implement", + cases: []marshalUnmarshalFn{ + marshalUnmarshal[ptrace.Marshaler], + marshalUnmarshal[ptrace.Unmarshaler], + marshalUnmarshal[pmetric.Unmarshaler], + marshalUnmarshal[pmetric.Unmarshaler], }, }, } @@ -320,7 +326,7 @@ func TestMarshalUnmarshal(t *testing.T) { require.NoError(t, err) } for _, c := range test.cases { - err := c(host.ext, test.id) + err := c(t, host.ext, test.id) if test.expectedErr != "" { require.ErrorContains(t, err, test.expectedErr) } else { diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod new file mode 100644 index 000000000000..b203ad3c7509 --- /dev/null +++ b/extension/encoding/go.mod @@ -0,0 +1,75 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding + +go 1.20 + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension + +require ( + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.0.0-00010101000000-000000000000 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.0.0-00010101000000-000000000000 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.0.0-00010101000000-000000000000 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.0.0-00010101000000-000000000000 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.0.0-00010101000000-000000000000 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 +) + +require ( + github.com/apache/thrift v0.19.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.0.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum new file mode 100644 index 000000000000..43c3a7118512 --- /dev/null +++ b/extension/encoding/go.sum @@ -0,0 +1,119 @@ +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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +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/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= +github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= +go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From cd9521bee95df7dc1641c11e67a7bcc9487d438c Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Tue, 7 Nov 2023 16:23:30 +0530 Subject: [PATCH 05/12] fix: go mod tidy, crosslink --- .github/ALLOWLIST | 1 - cmd/githubgen/main.go | 1 - cmd/otelcontribcol/builder-config.yaml | 1 + cmd/otelcontribcol/go.mod | 13 ++++++ .../{ => encodingtest}/encoding_test.go | 2 +- extension/encoding/go.mod | 40 ++++++++++++++++++- extension/encoding/go.sum | 15 +++++++ .../encoding/jaegerencodingextension/go.mod | 10 +++++ .../encoding/jsonlogencodingextension/go.mod | 20 ++++++++++ .../encoding/otlpencodingextension/go.mod | 20 ++++++++++ .../encoding/textencodingextension/go.mod | 12 ++++++ .../encoding/zipkinencodingextension/go.mod | 16 +++++--- .../encoding/zipkinencodingextension/go.sum | 14 +------ 13 files changed, 144 insertions(+), 21 deletions(-) rename extension/encoding/{ => encodingtest}/encoding_test.go (99%) diff --git a/.github/ALLOWLIST b/.github/ALLOWLIST index 8e7f6bee3da0..10f7f9d51107 100644 --- a/.github/ALLOWLIST +++ b/.github/ALLOWLIST @@ -20,7 +20,6 @@ ## COMMON & SHARED components internal/common -extension/encoding ## DEPRECATED components diff --git a/cmd/githubgen/main.go b/cmd/githubgen/main.go index f2a60f0a5992..7de47722cd4a 100644 --- a/cmd/githubgen/main.go +++ b/cmd/githubgen/main.go @@ -76,7 +76,6 @@ const allowlistHeader = `# Code generated by githubgen. DO NOT EDIT. ## COMMON & SHARED components internal/common -extension/encoding ` diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index a46cf413afb0..368ef0247d13 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -432,6 +432,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking => ../../pkg/translator/skywalking - github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../../extension/encoding - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 3ce50871b119..7cf8ac6f29bf 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -516,6 +516,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nginxinc/nginx-prometheus-exporter v0.8.1-0.20201110005315-f5a5f8086c19 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.0.0-00010101000000-000000000000 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.88.0 // indirect @@ -1148,3 +1149,15 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking => ../../pkg/translator/skywalking replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../../extension/encoding + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension diff --git a/extension/encoding/encoding_test.go b/extension/encoding/encodingtest/encoding_test.go similarity index 99% rename from extension/encoding/encoding_test.go rename to extension/encoding/encodingtest/encoding_test.go index f2bb8a95ee15..7e83e49d0c7d 100644 --- a/extension/encoding/encoding_test.go +++ b/extension/encoding/encodingtest/encoding_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package encoding +package encodingtest import ( "context" diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod index 8ebd8972a4e4..87c2e0f5b4f4 100644 --- a/extension/encoding/go.mod +++ b/extension/encoding/go.mod @@ -3,13 +3,23 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encod go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.0 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 ) require ( + github.com/apache/thrift v0.19.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -19,10 +29,15 @@ 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 - go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect @@ -34,4 +49,27 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum index 544af05fef61..43c3a7118512 100644 --- a/extension/encoding/go.sum +++ b/extension/encoding/go.sum @@ -1,3 +1,5 @@ +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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -11,6 +13,8 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -21,6 +25,8 @@ github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPgh github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 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/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= @@ -32,11 +38,15 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= @@ -51,6 +61,8 @@ go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e1 go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= @@ -101,4 +113,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/extension/encoding/jaegerencodingextension/go.mod b/extension/encoding/jaegerencodingextension/go.mod index 21a15fcf912d..b2d50a11fad9 100644 --- a/extension/encoding/jaegerencodingextension/go.mod +++ b/extension/encoding/jaegerencodingextension/go.mod @@ -57,3 +57,13 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../ + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../textencodingextension diff --git a/extension/encoding/jsonlogencodingextension/go.mod b/extension/encoding/jsonlogencodingextension/go.mod index efd6c2490ba4..8254e06b3f9a 100644 --- a/extension/encoding/jsonlogencodingextension/go.mod +++ b/extension/encoding/jsonlogencodingextension/go.mod @@ -42,3 +42,23 @@ require ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../ + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../../pkg/translator/zipkin diff --git a/extension/encoding/otlpencodingextension/go.mod b/extension/encoding/otlpencodingextension/go.mod index b154e3ee5a03..b551cf1a73aa 100644 --- a/extension/encoding/otlpencodingextension/go.mod +++ b/extension/encoding/otlpencodingextension/go.mod @@ -42,3 +42,23 @@ require ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../ + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../../pkg/pdatatest diff --git a/extension/encoding/textencodingextension/go.mod b/extension/encoding/textencodingextension/go.mod index 9aa992301976..6eb41c99688f 100644 --- a/extension/encoding/textencodingextension/go.mod +++ b/extension/encoding/textencodingextension/go.mod @@ -51,3 +51,15 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../ + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../../pkg/translator/zipkin + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../jsonlogencodingextension diff --git a/extension/encoding/zipkinencodingextension/go.mod b/extension/encoding/zipkinencodingextension/go.mod index 36abaa83da2a..9107b7f11c28 100644 --- a/extension/encoding/zipkinencodingextension/go.mod +++ b/extension/encoding/zipkinencodingextension/go.mod @@ -16,7 +16,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/jaegertracing/jaeger v1.48.0 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -27,11 +27,8 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect @@ -39,7 +36,6 @@ require ( go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect - go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.17.0 // indirect @@ -62,3 +58,13 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../ + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../jaegerencodingextension diff --git a/extension/encoding/zipkinencodingextension/go.sum b/extension/encoding/zipkinencodingextension/go.sum index 0b6e1ede20d0..43c3a7118512 100644 --- a/extension/encoding/zipkinencodingextension/go.sum +++ b/extension/encoding/zipkinencodingextension/go.sum @@ -1,4 +1,3 @@ -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= 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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -14,8 +13,8 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jaegertracing/jaeger v1.48.0 h1:YuKooQ7qJsjgxws9xuf8C/BLNTPx8qTAJz4wv7IHhSc= -github.com/jaegertracing/jaeger v1.48.0/go.mod h1:BoAPkdCAIEuLsVz/EDhjXd+GSVpHtJhiGqWoFEvBCKg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -39,22 +38,15 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= -github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= @@ -77,8 +69,6 @@ go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPi go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= From e07c8ac578073438b231e3ba50c946c06496a173 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Wed, 15 Nov 2023 18:59:23 +0530 Subject: [PATCH 06/12] fix: go mod --- extension/encoding/go.mod | 22 +++++----- extension/encoding/go.sum | 44 +++++++++---------- .../encoding/zipkinencodingextension/go.mod | 16 +++---- .../encoding/zipkinencodingextension/go.sum | 44 +++++++++---------- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/extension/encoding/go.mod b/extension/encoding/go.mod index 6a4cd1ebe18c..99c726c94387 100644 --- a/extension/encoding/go.mod +++ b/extension/encoding/go.mod @@ -9,9 +9,9 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.0 github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 - go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 - go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/component v0.88.1-0.20231112151805-b570812b1e06 + go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06 ) require ( @@ -19,8 +19,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -35,13 +35,13 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/otel v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/trace v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/extension/encoding/go.sum b/extension/encoding/go.sum index 887fda82352d..a80c56e958ef 100644 --- a/extension/encoding/go.sum +++ b/extension/encoding/go.sum @@ -13,10 +13,10 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= -github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -51,26 +51,26 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/collector/component v0.88.1-0.20231112151805-b570812b1e06 h1:5w3fOLjVNLGGGoMdGbXtN80Dfr92gqt7UnLINzWqCdQ= +go.opentelemetry.io/collector/component v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:lLxzUrBDALsu5Q7wLgCbIW/ecwWHaly1TefV5V2ul7E= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06 h1:KiH1YDZMnlOKmTRNps5frm5pCUxj/edqlV4Vgn5cIyg= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06 h1:e2yi0l+neYfRQbgP9nidcWXCQJUpvAL4/ujeHPUmL34= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:0+216q042fYieVdFxb4VlGwSLpJWKjDPwiL/9M43/x4= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06 h1:wg72oOT/cv1QLDf8TxTdZdKuFtalWYHtmS9Fr6HJQeo= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:EchLJPPxr68ezhgXMUZWGQFjoy/sD9PD/Bf22pP/k8I= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:+TYJkgSrAGAXUij6wSh2d3vuitmS9DLCJCej78LjgsI= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:/P0V4ef6OF6jZU+BRUE59akrVhReQoQCN7SPsPE/Mq4= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06/go.mod h1:oNIcTRyEJYIfMcRYyyh5lquDU0Vl+ktTL6ka+p+dYvg= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06 h1:0WAUFf9e/j1LKoiWZ3LEHfsvWmBvZ+JCFEsGuGOCaZo= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= +go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= +go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= +go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= +go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= +go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= diff --git a/extension/encoding/zipkinencodingextension/go.mod b/extension/encoding/zipkinencodingextension/go.mod index 25a692c1b2ef..b60ea08b751c 100644 --- a/extension/encoding/zipkinencodingextension/go.mod +++ b/extension/encoding/zipkinencodingextension/go.mod @@ -16,8 +16,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/jaegertracing/jaeger v1.49.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -30,13 +30,13 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/otel v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/trace v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/extension/encoding/zipkinencodingextension/go.sum b/extension/encoding/zipkinencodingextension/go.sum index 887fda82352d..a80c56e958ef 100644 --- a/extension/encoding/zipkinencodingextension/go.sum +++ b/extension/encoding/zipkinencodingextension/go.sum @@ -13,10 +13,10 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= -github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -51,26 +51,26 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= -go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= -go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= -go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9 h1:iRAs+Zp4jmwVXRNAqgl5x8of2zuFty3QWNSqNNQY0NQ= -go.opentelemetry.io/collector/semconv v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/collector/component v0.88.1-0.20231112151805-b570812b1e06 h1:5w3fOLjVNLGGGoMdGbXtN80Dfr92gqt7UnLINzWqCdQ= +go.opentelemetry.io/collector/component v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:lLxzUrBDALsu5Q7wLgCbIW/ecwWHaly1TefV5V2ul7E= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06 h1:KiH1YDZMnlOKmTRNps5frm5pCUxj/edqlV4Vgn5cIyg= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06 h1:e2yi0l+neYfRQbgP9nidcWXCQJUpvAL4/ujeHPUmL34= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:0+216q042fYieVdFxb4VlGwSLpJWKjDPwiL/9M43/x4= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06 h1:wg72oOT/cv1QLDf8TxTdZdKuFtalWYHtmS9Fr6HJQeo= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:EchLJPPxr68ezhgXMUZWGQFjoy/sD9PD/Bf22pP/k8I= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:+TYJkgSrAGAXUij6wSh2d3vuitmS9DLCJCej78LjgsI= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:/P0V4ef6OF6jZU+BRUE59akrVhReQoQCN7SPsPE/Mq4= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06/go.mod h1:oNIcTRyEJYIfMcRYyyh5lquDU0Vl+ktTL6ka+p+dYvg= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06 h1:0WAUFf9e/j1LKoiWZ3LEHfsvWmBvZ+JCFEsGuGOCaZo= +go.opentelemetry.io/collector/semconv v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= +go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= +go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= +go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= +go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= +go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= From fc40965d110bf9631c25ce96ce82b99219082996 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Thu, 16 Nov 2023 15:34:49 +0530 Subject: [PATCH 07/12] chore: initial commit --- receiver/pulsarreceiver/config.go | 2 +- receiver/pulsarreceiver/config_test.go | 1 - receiver/pulsarreceiver/factory.go | 66 +-- receiver/pulsarreceiver/factory_test.go | 169 +------- receiver/pulsarreceiver/go.mod | 25 +- receiver/pulsarreceiver/go.sum | 14 +- receiver/pulsarreceiver/jaeger_unmarshaler.go | 59 --- .../pulsarreceiver/jaeger_unmarshaler_test.go | 76 ---- receiver/pulsarreceiver/pdata_unmarshaler.go | 71 --- .../pulsarreceiver/pdata_unmarshaler_test.go | 29 -- receiver/pulsarreceiver/pulsar_receiver.go | 84 ++-- .../pulsarreceiver/pulsar_receiver_test.go | 404 +++++++++++++++++- receiver/pulsarreceiver/unmarshaler.go | 74 ---- receiver/pulsarreceiver/unmarshaler_test.go | 62 --- receiver/pulsarreceiver/zipkin_unmarshaler.go | 28 -- .../pulsarreceiver/zipkin_unmarshaler_test.go | 109 ----- 16 files changed, 492 insertions(+), 781 deletions(-) delete mode 100644 receiver/pulsarreceiver/jaeger_unmarshaler.go delete mode 100644 receiver/pulsarreceiver/jaeger_unmarshaler_test.go delete mode 100644 receiver/pulsarreceiver/pdata_unmarshaler.go delete mode 100644 receiver/pulsarreceiver/pdata_unmarshaler_test.go delete mode 100644 receiver/pulsarreceiver/unmarshaler.go delete mode 100644 receiver/pulsarreceiver/unmarshaler_test.go delete mode 100644 receiver/pulsarreceiver/zipkin_unmarshaler.go delete mode 100644 receiver/pulsarreceiver/zipkin_unmarshaler_test.go diff --git a/receiver/pulsarreceiver/config.go b/receiver/pulsarreceiver/config.go index 20b799e0cd3c..edcda33a4b49 100644 --- a/receiver/pulsarreceiver/config.go +++ b/receiver/pulsarreceiver/config.go @@ -20,7 +20,7 @@ type Config struct { // The Subscription that receiver will be consuming messages from (default "otlp_subscription") Subscription string `mapstructure:"subscription"` // Encoding of the messages (default "otlp_proto") - Encoding string `mapstructure:"encoding"` + EncodingID *component.ID `mapstructure:"encoding"` // Name specifies the consumer name. ConsumerName string `mapstructure:"consumer_name"` // Set the path to the trusted TLS certificate file diff --git a/receiver/pulsarreceiver/config_test.go b/receiver/pulsarreceiver/config_test.go index dfa0ea121b2c..6fbd70ff4004 100644 --- a/receiver/pulsarreceiver/config_test.go +++ b/receiver/pulsarreceiver/config_test.go @@ -30,7 +30,6 @@ func TestLoadConfig(t *testing.T) { Endpoint: "pulsar://localhost:6500", ConsumerName: "otel-collector", Subscription: "otel-collector", - Encoding: defaultEncoding, TLSTrustCertsFilePath: "ca.pem", Authentication: Authentication{TLS: &TLS{CertFile: "cert.pem", KeyFile: "key.pem"}}, }, diff --git a/receiver/pulsarreceiver/factory.go b/receiver/pulsarreceiver/factory.go index e084d6473a31..470aebc64385 100644 --- a/receiver/pulsarreceiver/factory.go +++ b/receiver/pulsarreceiver/factory.go @@ -23,63 +23,18 @@ const ( defaultServiceURL = "pulsar://localhost:6650" ) -// FactoryOption applies changes to PulsarExporterFactory. -type FactoryOption func(factory *pulsarReceiverFactory) - -// withTracesUnmarshalers adds Unmarshalers. -func withTracesUnmarshalers(tracesUnmarshalers ...TracesUnmarshaler) FactoryOption { - return func(factory *pulsarReceiverFactory) { - for _, unmarshaler := range tracesUnmarshalers { - factory.tracesUnmarshalers[unmarshaler.Encoding()] = unmarshaler - } - } -} - -// withMetricsUnmarshalers adds MetricsUnmarshalers. -func withMetricsUnmarshalers(metricsUnmarshalers ...MetricsUnmarshaler) FactoryOption { - return func(factory *pulsarReceiverFactory) { - for _, unmarshaler := range metricsUnmarshalers { - factory.metricsUnmarshalers[unmarshaler.Encoding()] = unmarshaler - } - } -} - -// withLogsUnmarshalers adds LogsUnmarshalers. -func withLogsUnmarshalers(logsUnmarshalers ...LogsUnmarshaler) FactoryOption { - return func(factory *pulsarReceiverFactory) { - for _, unmarshaler := range logsUnmarshalers { - factory.logsUnmarshalers[unmarshaler.Encoding()] = unmarshaler - } - } -} - // NewFactory creates Pulsar receiver factory. -func NewFactory(options ...FactoryOption) receiver.Factory { - - f := &pulsarReceiverFactory{ - tracesUnmarshalers: defaultTracesUnmarshalers(), - metricsUnmarshalers: defaultMetricsUnmarshalers(), - logsUnmarshalers: defaultLogsUnmarshalers(), - } - for _, o := range options { - o(f) - } +func NewFactory() receiver.Factory { return receiver.NewFactory( metadata.Type, createDefaultConfig, - receiver.WithTraces(f.createTracesReceiver, metadata.TracesStability), - receiver.WithMetrics(f.createMetricsReceiver, metadata.MetricsStability), - receiver.WithLogs(f.createLogsReceiver, metadata.LogsStability), + receiver.WithTraces(createTracesReceiver, metadata.TracesStability), + receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability), + receiver.WithLogs(createLogsReceiver, metadata.LogsStability), ) } -type pulsarReceiverFactory struct { - tracesUnmarshalers map[string]TracesUnmarshaler - metricsUnmarshalers map[string]MetricsUnmarshaler - logsUnmarshalers map[string]LogsUnmarshaler -} - -func (f *pulsarReceiverFactory) createTracesReceiver( +func createTracesReceiver( _ context.Context, set receiver.CreateSettings, cfg component.Config, @@ -89,14 +44,14 @@ func (f *pulsarReceiverFactory) createTracesReceiver( if len(c.Topic) == 0 { c.Topic = defaultTraceTopic } - r, err := newTracesReceiver(c, set, f.tracesUnmarshalers, nextConsumer) + r, err := newTracesReceiver(c, set, nextConsumer) if err != nil { return nil, err } return r, nil } -func (f *pulsarReceiverFactory) createMetricsReceiver( +func createMetricsReceiver( _ context.Context, set receiver.CreateSettings, cfg component.Config, @@ -106,14 +61,14 @@ func (f *pulsarReceiverFactory) createMetricsReceiver( if len(c.Topic) == 0 { c.Topic = defaultMeticsTopic } - r, err := newMetricsReceiver(c, set, f.metricsUnmarshalers, nextConsumer) + r, err := newMetricsReceiver(c, set, nextConsumer) if err != nil { return nil, err } return r, nil } -func (f *pulsarReceiverFactory) createLogsReceiver( +func createLogsReceiver( _ context.Context, set receiver.CreateSettings, cfg component.Config, @@ -123,7 +78,7 @@ func (f *pulsarReceiverFactory) createLogsReceiver( if len(c.Topic) == 0 { c.Topic = defaultLogsTopic } - r, err := newLogsReceiver(c, set, f.logsUnmarshalers, nextConsumer) + r, err := newLogsReceiver(c, set, nextConsumer) if err != nil { return nil, err } @@ -132,7 +87,6 @@ func (f *pulsarReceiverFactory) createLogsReceiver( func createDefaultConfig() component.Config { return &Config{ - Encoding: defaultEncoding, ConsumerName: defaultConsumerName, Subscription: defaultSubscription, Endpoint: defaultServiceURL, diff --git a/receiver/pulsarreceiver/factory_test.go b/receiver/pulsarreceiver/factory_test.go index cffcd4840d87..2d42001bf439 100644 --- a/receiver/pulsarreceiver/factory_test.go +++ b/receiver/pulsarreceiver/factory_test.go @@ -9,9 +9,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/pdata/plog" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/receiver/receivertest" ) @@ -19,7 +16,6 @@ func TestCreateDefaultConfig(t *testing.T) { cfg := createDefaultConfig() assert.Equal(t, &Config{ Topic: "", - Encoding: defaultEncoding, ConsumerName: defaultConsumerName, Subscription: defaultSubscription, Endpoint: defaultServiceURL, @@ -27,182 +23,27 @@ func TestCreateDefaultConfig(t *testing.T) { }, cfg) } -// trace -func TestCreateTracesReceiver_err_addr(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = "invalid:6650" - - f := pulsarReceiverFactory{tracesUnmarshalers: defaultTracesUnmarshalers()} - r, err := f.createTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - -func TestCreateTracesReceiver_err_marshallers(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = defaultServiceURL - - f := pulsarReceiverFactory{tracesUnmarshalers: make(map[string]TracesUnmarshaler)} - r, err := f.createTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - func Test_CreateTraceReceiver(t *testing.T) { cfg := createDefaultConfig().(*Config) - f := pulsarReceiverFactory{tracesUnmarshalers: defaultTracesUnmarshalers()} - recv, err := f.createTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + + recv, err := createTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) require.NoError(t, err) assert.NotNil(t, recv) } -func TestWithTracesUnmarshalers(t *testing.T) { - unmarshaler := &customTracesUnmarshaler{} - f := NewFactory(withTracesUnmarshalers(unmarshaler)) - cfg := createDefaultConfig().(*Config) - - t.Run("custom_encoding", func(t *testing.T) { - cfg.Encoding = unmarshaler.Encoding() - receiver, err := f.CreateTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - require.NotNil(t, receiver) - }) - t.Run("default_encoding", func(t *testing.T) { - cfg.Encoding = defaultEncoding - receiver, err := f.CreateTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - assert.NotNil(t, receiver) - }) -} - -// metrics -func TestCreateMetricsReceiver_err_addr(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = "invalid:6650" - - f := pulsarReceiverFactory{metricsUnmarshalers: defaultMetricsUnmarshalers()} - r, err := f.createMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - -func TestCreateMetricsReceiver_err_marshallers(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = defaultServiceURL - - f := pulsarReceiverFactory{metricsUnmarshalers: make(map[string]MetricsUnmarshaler)} - r, err := f.createMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - func Test_CreateMetricsReceiver(t *testing.T) { cfg := createDefaultConfig().(*Config) - f := pulsarReceiverFactory{metricsUnmarshalers: defaultMetricsUnmarshalers()} - recv, err := f.createMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + recv, err := createMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) require.NoError(t, err) assert.NotNil(t, recv) } -func TestWithMetricsUnmarshalers(t *testing.T) { - unmarshaler := &customMetricsUnmarshaler{} - f := NewFactory(withMetricsUnmarshalers(unmarshaler)) - cfg := createDefaultConfig().(*Config) - - t.Run("custom_encoding", func(t *testing.T) { - cfg.Encoding = unmarshaler.Encoding() - receiver, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - require.NotNil(t, receiver) - }) - t.Run("default_encoding", func(t *testing.T) { - cfg.Encoding = defaultEncoding - receiver, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - assert.NotNil(t, receiver) - }) -} - -// logs -func TestCreateLogsReceiver_err_addr(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = "invalid:6650" - - f := pulsarReceiverFactory{logsUnmarshalers: defaultLogsUnmarshalers()} - r, err := f.createLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - -func TestCreateLogsReceiver_err_marshallers(t *testing.T) { - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = defaultServiceURL - - f := pulsarReceiverFactory{logsUnmarshalers: make(map[string]LogsUnmarshaler)} - r, err := f.createLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.Error(t, err) - assert.Nil(t, r) -} - func Test_CreateLogsReceiver(t *testing.T) { cfg := createDefaultConfig().(*Config) - cfg.Endpoint = defaultServiceURL - f := pulsarReceiverFactory{logsUnmarshalers: defaultLogsUnmarshalers()} - recv, err := f.createLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + cfg.Endpoint = defaultServiceURL + recv, err := createLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) require.NoError(t, err) assert.NotNil(t, recv) } - -func TestWithLogsUnmarshalers(t *testing.T) { - unmarshaler := &customLogsUnmarshaler{} - f := NewFactory(withLogsUnmarshalers(unmarshaler)) - cfg := createDefaultConfig().(*Config) - - t.Run("custom_encoding", func(t *testing.T) { - cfg.Encoding = unmarshaler.Encoding() - exporter, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - require.NotNil(t, exporter) - }) - t.Run("default_encoding", func(t *testing.T) { - cfg.Encoding = defaultEncoding - exporter, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) - require.NoError(t, err) - assert.NotNil(t, exporter) - }) -} - -type customTracesUnmarshaler struct { -} - -type customMetricsUnmarshaler struct { -} - -type customLogsUnmarshaler struct { -} - -func (c customTracesUnmarshaler) Unmarshal([]byte) (ptrace.Traces, error) { - panic("implement me") -} - -func (c customTracesUnmarshaler) Encoding() string { - return "custom" -} - -func (c customMetricsUnmarshaler) Unmarshal([]byte) (pmetric.Metrics, error) { - panic("implement me") -} - -func (c customMetricsUnmarshaler) Encoding() string { - return "custom" -} - -func (c customLogsUnmarshaler) Unmarshal([]byte) (plog.Logs, error) { - panic("implement me") -} - -func (c customLogsUnmarshaler) Encoding() string { - return "custom" -} diff --git a/receiver/pulsarreceiver/go.mod b/receiver/pulsarreceiver/go.mod index d77ce9b58433..3c05ef762649 100644 --- a/receiver/pulsarreceiver/go.mod +++ b/receiver/pulsarreceiver/go.mod @@ -6,7 +6,13 @@ require ( github.com/apache/pulsar-client-go v0.8.1 github.com/apache/thrift v0.19.0 github.com/gogo/protobuf v1.3.2 - github.com/jaegertracing/jaeger v1.48.0 + github.com/jaegertracing/jaeger v1.49.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.88.0 github.com/openzipkin/zipkin-go v0.4.2 @@ -55,7 +61,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -65,9 +70,8 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231112151805-b570812b1e06 // indirect + go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 // indirect go.opentelemetry.io/otel v1.20.0 // indirect go.opentelemetry.io/otel/metric v1.20.0 // indirect @@ -104,3 +108,16 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../../extension/encoding + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + diff --git a/receiver/pulsarreceiver/go.sum b/receiver/pulsarreceiver/go.sum index f86f40a2223a..27876e95e6af 100644 --- a/receiver/pulsarreceiver/go.sum +++ b/receiver/pulsarreceiver/go.sum @@ -45,7 +45,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -233,8 +232,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jaegertracing/jaeger v1.48.0 h1:YuKooQ7qJsjgxws9xuf8C/BLNTPx8qTAJz4wv7IHhSc= -github.com/jaegertracing/jaeger v1.48.0/go.mod h1:BoAPkdCAIEuLsVz/EDhjXd+GSVpHtJhiGqWoFEvBCKg= +github.com/jaegertracing/jaeger v1.49.0 h1:3XI8ZOK6oncyoAxCiKakC9sRaeDTdDwmxmaSN+KQBo8= +github.com/jaegertracing/jaeger v1.49.0/go.mod h1:gU5wCSJSwk5MJHO/uWEBYKklT80oqEc2ixj3ssbwloQ= github.com/jawher/mow.cli v1.0.4/go.mod h1:5hQj2V8g+qYmLUVWqu4Wuja1pI57M83EChYLVZ0sMKk= github.com/jawher/mow.cli v1.2.0/go.mod h1:y+pcA3jBAdo/GIZx/0rFjw/K2bVEODP9rfZOfaiq8Ko= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= @@ -315,11 +314,10 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= 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/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= @@ -395,10 +393,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= -github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -425,6 +419,8 @@ go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06 h1:e go.opentelemetry.io/collector/confmap v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:0+216q042fYieVdFxb4VlGwSLpJWKjDPwiL/9M43/x4= go.opentelemetry.io/collector/consumer v0.88.1-0.20231112151805-b570812b1e06 h1:8YA95ZUk6A1w2e6vkRR+yjr8xUghLVFFb51f6W7LnCQ= go.opentelemetry.io/collector/consumer v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:aM7h5bPQsTHO/rjcP0VzxR5iJz3uTzkQ7OYe5aOjClM= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06 h1:wg72oOT/cv1QLDf8TxTdZdKuFtalWYHtmS9Fr6HJQeo= +go.opentelemetry.io/collector/extension v0.88.1-0.20231112151805-b570812b1e06/go.mod h1:EchLJPPxr68ezhgXMUZWGQFjoy/sD9PD/Bf22pP/k8I= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:+TYJkgSrAGAXUij6wSh2d3vuitmS9DLCJCej78LjgsI= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231112151805-b570812b1e06/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231112151805-b570812b1e06 h1:/P0V4ef6OF6jZU+BRUE59akrVhReQoQCN7SPsPE/Mq4= diff --git a/receiver/pulsarreceiver/jaeger_unmarshaler.go b/receiver/pulsarreceiver/jaeger_unmarshaler.go deleted file mode 100644 index 28791ddb600e..000000000000 --- a/receiver/pulsarreceiver/jaeger_unmarshaler.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "bytes" - - "github.com/gogo/protobuf/jsonpb" - jaegerproto "github.com/jaegertracing/jaeger/model" - "go.opentelemetry.io/collector/pdata/ptrace" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" -) - -// copy from kafka receiver -type jaegerProtoSpanUnmarshaler struct { -} - -var _ TracesUnmarshaler = (*jaegerProtoSpanUnmarshaler)(nil) - -func (j jaegerProtoSpanUnmarshaler) Unmarshal(bytes []byte) (ptrace.Traces, error) { - span := &jaegerproto.Span{} - err := span.Unmarshal(bytes) - if err != nil { - return ptrace.NewTraces(), err - } - return jaegerSpanToTraces(span) -} - -func (j jaegerProtoSpanUnmarshaler) Encoding() string { - return "jaeger_proto" -} - -type jaegerJSONSpanUnmarshaler struct { -} - -var _ TracesUnmarshaler = (*jaegerJSONSpanUnmarshaler)(nil) - -func (j jaegerJSONSpanUnmarshaler) Unmarshal(data []byte) (ptrace.Traces, error) { - span := &jaegerproto.Span{} - err := jsonpb.Unmarshal(bytes.NewReader(data), span) - if err != nil { - return ptrace.NewTraces(), err - } - return jaegerSpanToTraces(span) -} - -func (j jaegerJSONSpanUnmarshaler) Encoding() string { - return "jaeger_json" -} - -func jaegerSpanToTraces(span *jaegerproto.Span) (ptrace.Traces, error) { - batch := jaegerproto.Batch{ - Spans: []*jaegerproto.Span{span}, - Process: span.Process, - } - return jaeger.ProtoToTraces([]*jaegerproto.Batch{&batch}) -} diff --git a/receiver/pulsarreceiver/jaeger_unmarshaler_test.go b/receiver/pulsarreceiver/jaeger_unmarshaler_test.go deleted file mode 100644 index 70849f70ba59..000000000000 --- a/receiver/pulsarreceiver/jaeger_unmarshaler_test.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "bytes" - "testing" - - "github.com/gogo/protobuf/jsonpb" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/ptrace" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" -) - -// copy from kafka receiver -func TestUnmarshalJaeger(t *testing.T) { - td := ptrace.NewTraces() - span := td.ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty().Spans().AppendEmpty() - span.SetName("foo") - span.SetStartTimestamp(pcommon.Timestamp(10)) - span.SetEndTimestamp(pcommon.Timestamp(20)) - span.SetTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}) - span.SetSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}) - batches, err := jaeger.ProtoFromTraces(td) - require.NoError(t, err) - - protoBytes, err := batches[0].Spans[0].Marshal() - require.NoError(t, err) - - jsonMarshaler := &jsonpb.Marshaler{} - jsonBytes := new(bytes.Buffer) - require.NoError(t, jsonMarshaler.Marshal(jsonBytes, batches[0].Spans[0])) - - tests := []struct { - unmarshaler TracesUnmarshaler - encoding string - bytes []byte - }{ - { - unmarshaler: jaegerProtoSpanUnmarshaler{}, - encoding: "jaeger_proto", - bytes: protoBytes, - }, - { - unmarshaler: jaegerJSONSpanUnmarshaler{}, - encoding: "jaeger_json", - bytes: jsonBytes.Bytes(), - }, - } - for _, test := range tests { - t.Run(test.encoding, func(t *testing.T) { - got, err := test.unmarshaler.Unmarshal(test.bytes) - require.NoError(t, err) - assert.Equal(t, td, got) - assert.Equal(t, test.encoding, test.unmarshaler.Encoding()) - }) - } -} - -func TestUnmarshalJaegerProto_error(t *testing.T) { - p := jaegerProtoSpanUnmarshaler{} - got, err := p.Unmarshal([]byte("+$%")) - assert.Equal(t, ptrace.NewTraces(), got) - assert.Error(t, err) -} - -func TestUnmarshalJaegerJSON_error(t *testing.T) { - p := jaegerJSONSpanUnmarshaler{} - got, err := p.Unmarshal([]byte("+$%")) - assert.Equal(t, ptrace.NewTraces(), got) - assert.Error(t, err) -} diff --git a/receiver/pulsarreceiver/pdata_unmarshaler.go b/receiver/pulsarreceiver/pdata_unmarshaler.go deleted file mode 100644 index 776e250499ff..000000000000 --- a/receiver/pulsarreceiver/pdata_unmarshaler.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "go.opentelemetry.io/collector/pdata/plog" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" -) - -// copy from kafka receiver -type pdataLogsUnmarshaler struct { - plog.Unmarshaler - encoding string -} - -func (p pdataLogsUnmarshaler) Unmarshal(buf []byte) (plog.Logs, error) { - return p.Unmarshaler.UnmarshalLogs(buf) -} - -func (p pdataLogsUnmarshaler) Encoding() string { - return p.encoding -} - -func newPdataLogsUnmarshaler(unmarshaler plog.Unmarshaler, encoding string) LogsUnmarshaler { - return pdataLogsUnmarshaler{ - Unmarshaler: unmarshaler, - encoding: encoding, - } -} - -type pdataTracesUnmarshaler struct { - ptrace.Unmarshaler - encoding string -} - -func (p pdataTracesUnmarshaler) Unmarshal(buf []byte) (ptrace.Traces, error) { - return p.Unmarshaler.UnmarshalTraces(buf) -} - -func (p pdataTracesUnmarshaler) Encoding() string { - return p.encoding -} - -func newPdataTracesUnmarshaler(unmarshaler ptrace.Unmarshaler, encoding string) TracesUnmarshaler { - return pdataTracesUnmarshaler{ - Unmarshaler: unmarshaler, - encoding: encoding, - } -} - -type pdataMetricsUnmarshaler struct { - pmetric.Unmarshaler - encoding string -} - -func (p pdataMetricsUnmarshaler) Unmarshal(buf []byte) (pmetric.Metrics, error) { - return p.Unmarshaler.UnmarshalMetrics(buf) -} - -func (p pdataMetricsUnmarshaler) Encoding() string { - return p.encoding -} - -func newPdataMetricsUnmarshaler(unmarshaler pmetric.Unmarshaler, encoding string) MetricsUnmarshaler { - return pdataMetricsUnmarshaler{ - Unmarshaler: unmarshaler, - encoding: encoding, - } -} diff --git a/receiver/pulsarreceiver/pdata_unmarshaler_test.go b/receiver/pulsarreceiver/pdata_unmarshaler_test.go deleted file mode 100644 index ba18e2869b0f..000000000000 --- a/receiver/pulsarreceiver/pdata_unmarshaler_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/pdata/plog" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" -) - -// copy from kafka receiver -func TestNewPdataTracesUnmarshaler(t *testing.T) { - um := newPdataTracesUnmarshaler(&ptrace.ProtoUnmarshaler{}, "test") - assert.Equal(t, "test", um.Encoding()) -} - -func TestNewPdataMetricsUnmarshaler(t *testing.T) { - um := newPdataMetricsUnmarshaler(&pmetric.ProtoUnmarshaler{}, "test") - assert.Equal(t, "test", um.Encoding()) -} - -func TestNewPdataLogsUnmarshaler(t *testing.T) { - um := newPdataLogsUnmarshaler(&plog.ProtoUnmarshaler{}, "test") - assert.Equal(t, "test", um.Encoding()) -} diff --git a/receiver/pulsarreceiver/pulsar_receiver.go b/receiver/pulsarreceiver/pulsar_receiver.go index c4b08991ce30..3264cd8dd2a7 100644 --- a/receiver/pulsarreceiver/pulsar_receiver.go +++ b/receiver/pulsarreceiver/pulsar_receiver.go @@ -6,9 +6,12 @@ package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collec import ( "context" "errors" + "fmt" "strings" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding" + "github.com/apache/pulsar-client-go/pulsar" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" @@ -16,7 +19,7 @@ import ( "go.uber.org/zap" ) -var errUnrecognizedEncoding = errors.New("unrecognized encoding") +var errIncorrectEncoding = "encoding %s doesn't implement %s" const alreadyClosedError = "AlreadyClosedError" @@ -26,17 +29,13 @@ type pulsarTracesConsumer struct { client pulsar.Client cancel context.CancelFunc consumer pulsar.Consumer - unmarshaler TracesUnmarshaler + unmarshaler encoding.TracesUnmarshalerExtension settings receiver.CreateSettings consumerOptions pulsar.ConsumerOptions + encoding *component.ID } -func newTracesReceiver(config Config, set receiver.CreateSettings, unmarshalers map[string]TracesUnmarshaler, nextConsumer consumer.Traces) (*pulsarTracesConsumer, error) { - unmarshaler := unmarshalers[config.Encoding] - if nil == unmarshaler { - return nil, errUnrecognizedEncoding - } - +func newTracesReceiver(config Config, set receiver.CreateSettings, nextConsumer consumer.Traces) (*pulsarTracesConsumer, error) { options := config.clientOptions() client, err := pulsar.NewClient(options) if err != nil { @@ -51,17 +50,27 @@ func newTracesReceiver(config Config, set receiver.CreateSettings, unmarshalers return &pulsarTracesConsumer{ tracesConsumer: nextConsumer, topic: config.Topic, - unmarshaler: unmarshaler, + encoding: config.EncodingID, settings: set, client: client, consumerOptions: consumerOptions, }, nil } -func (c *pulsarTracesConsumer) Start(context.Context, component.Host) error { +func (c *pulsarTracesConsumer) Start(_ context.Context, host component.Host) error { ctx, cancel := context.WithCancel(context.Background()) c.cancel = cancel + extension, ok := host.GetExtensions()[*c.encoding] + if !ok { + return fmt.Errorf("extension '%s' not found", c.encoding) + } + unmarshaler, ok := extension.(encoding.TracesUnmarshalerExtension) + if !ok { + return fmt.Errorf(errIncorrectEncoding, c.encoding, "TracesUnmarshaler") + } + c.unmarshaler = unmarshaler + _consumer, err := c.client.Subscribe(c.consumerOptions) if err == nil { c.consumer = _consumer @@ -94,7 +103,7 @@ func consumerTracesLoop(ctx context.Context, c *pulsarTracesConsumer) error { continue } - traces, err := unmarshaler.Unmarshal(message.Payload()) + traces, err := unmarshaler.UnmarshalTraces(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler traces message", zap.Error(err)) c.consumer.Ack(message) @@ -120,21 +129,17 @@ func (c *pulsarTracesConsumer) Shutdown(context.Context) error { type pulsarMetricsConsumer struct { metricsConsumer consumer.Metrics - unmarshaler MetricsUnmarshaler + unmarshaler encoding.MetricsUnmarshalerExtension topic string client pulsar.Client consumer pulsar.Consumer cancel context.CancelFunc settings receiver.CreateSettings consumerOptions pulsar.ConsumerOptions + encoding *component.ID } -func newMetricsReceiver(config Config, set receiver.CreateSettings, unmarshalers map[string]MetricsUnmarshaler, nextConsumer consumer.Metrics) (*pulsarMetricsConsumer, error) { - unmarshaler := unmarshalers[config.Encoding] - if nil == unmarshaler { - return nil, errUnrecognizedEncoding - } - +func newMetricsReceiver(config Config, set receiver.CreateSettings, nextConsumer consumer.Metrics) (*pulsarMetricsConsumer, error) { options := config.clientOptions() client, err := pulsar.NewClient(options) if err != nil { @@ -149,16 +154,26 @@ func newMetricsReceiver(config Config, set receiver.CreateSettings, unmarshalers return &pulsarMetricsConsumer{ metricsConsumer: nextConsumer, topic: config.Topic, - unmarshaler: unmarshaler, + encoding: config.EncodingID, settings: set, client: client, consumerOptions: consumerOptions, }, nil } -func (c *pulsarMetricsConsumer) Start(context.Context, component.Host) error { +func (c *pulsarMetricsConsumer) Start(_ context.Context, host component.Host) error { ctx, cancel := context.WithCancel(context.Background()) c.cancel = cancel + extension, ok := host.GetExtensions()[*c.encoding] + if !ok { + return fmt.Errorf("extension '%s' not found", c.encoding) + } + unmarshaler, ok := extension.(encoding.MetricsUnmarshalerExtension) + if !ok { + return fmt.Errorf(errIncorrectEncoding, c.encoding, "MetricsUnmarshaler") + + } + c.unmarshaler = unmarshaler _consumer, err := c.client.Subscribe(c.consumerOptions) if err == nil { @@ -194,7 +209,7 @@ func consumeMetricsLoop(ctx context.Context, c *pulsarMetricsConsumer) error { continue } - metrics, err := unmarshaler.Unmarshal(message.Payload()) + metrics, err := unmarshaler.UnmarshalMetrics(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler metrics message", zap.Error(err)) c.consumer.Ack(message) @@ -221,21 +236,17 @@ func (c *pulsarMetricsConsumer) Shutdown(context.Context) error { type pulsarLogsConsumer struct { logsConsumer consumer.Logs - unmarshaler LogsUnmarshaler + unmarshaler encoding.LogsUnmarshalerExtension topic string client pulsar.Client consumer pulsar.Consumer cancel context.CancelFunc settings receiver.CreateSettings consumerOptions pulsar.ConsumerOptions + encoding *component.ID } -func newLogsReceiver(config Config, set receiver.CreateSettings, unmarshalers map[string]LogsUnmarshaler, nextConsumer consumer.Logs) (*pulsarLogsConsumer, error) { - unmarshaler := unmarshalers[config.Encoding] - if nil == unmarshaler { - return nil, errUnrecognizedEncoding - } - +func newLogsReceiver(config Config, set receiver.CreateSettings, nextConsumer consumer.Logs) (*pulsarLogsConsumer, error) { options := config.clientOptions() client, err := pulsar.NewClient(options) if err != nil { @@ -250,18 +261,27 @@ func newLogsReceiver(config Config, set receiver.CreateSettings, unmarshalers ma return &pulsarLogsConsumer{ logsConsumer: nextConsumer, topic: config.Topic, - cancel: nil, - unmarshaler: unmarshaler, + encoding: config.EncodingID, settings: set, client: client, consumerOptions: consumerOptions, }, nil } -func (c *pulsarLogsConsumer) Start(context.Context, component.Host) error { +func (c *pulsarLogsConsumer) Start(_ context.Context, host component.Host) error { ctx, cancel := context.WithCancel(context.Background()) c.cancel = cancel + extension, ok := host.GetExtensions()[*c.encoding] + if !ok { + return fmt.Errorf("extension '%s' not found", c.encoding) + } + unmarshaler, ok := extension.(encoding.LogsUnmarshalerExtension) + if !ok { + return fmt.Errorf(errIncorrectEncoding, c.encoding, "LogsUnmarshaler") + } + c.unmarshaler = unmarshaler + _consumer, err := c.client.Subscribe(c.consumerOptions) if err == nil { c.consumer = _consumer @@ -294,7 +314,7 @@ func consumeLogsLoop(ctx context.Context, c *pulsarLogsConsumer) error { continue } - logs, err := unmarshaler.Unmarshal(message.Payload()) + logs, err := unmarshaler.UnmarshalLogs(message.Payload()) if err != nil { c.settings.Logger.Error("failed to unmarshaler logs message", zap.Error(err)) c.consumer.Ack(message) diff --git a/receiver/pulsarreceiver/pulsar_receiver_test.go b/receiver/pulsarreceiver/pulsar_receiver_test.go index a221c368c7ba..392b7ca42806 100644 --- a/receiver/pulsarreceiver/pulsar_receiver_test.go +++ b/receiver/pulsarreceiver/pulsar_receiver_test.go @@ -4,17 +4,409 @@ package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" import ( + "context" + "errors" "testing" + "time" + "github.com/apache/pulsar-client-go/pulsar" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensiontest" "go.opentelemetry.io/collector/receiver/receivertest" ) -func Test_newTracesReceiver_err(t *testing.T) { - c := Config{ - Encoding: defaultEncoding, +type mockHost struct { + component.Host + ext map[component.ID]component.Component +} + +func (mh mockHost) GetExtensions() map[component.ID]component.Component { + return mh.ext +} + +type mockPulsarConsumer struct { + messageChan chan pulsar.ConsumerMessage +} + +func (c mockPulsarConsumer) Subscription() string { + panic("implement me") +} + +func (c mockPulsarConsumer) Unsubscribe() error { + panic("implement me") +} + +func (c mockPulsarConsumer) Receive(_ context.Context) (pulsar.Message, error) { + msg, ok := <-c.messageChan + if !ok { + return nil, errors.New(alreadyClosedError) + } + return msg, nil +} + +func (c mockPulsarConsumer) Chan() <-chan pulsar.ConsumerMessage { + return c.messageChan +} + +func (c mockPulsarConsumer) Ack(_ pulsar.Message) { + // no-op +} + +func (c mockPulsarConsumer) ReconsumeLater(_ pulsar.Message, _ time.Duration) { + panic("implement me") +} + +func (c mockPulsarConsumer) AckID(_ pulsar.MessageID) { + panic("implement me") +} + +func (c mockPulsarConsumer) Nack(_ pulsar.Message) { + // no-op +} + +func (c mockPulsarConsumer) NackID(_ pulsar.MessageID) { + panic("implement me") +} + +func (c mockPulsarConsumer) Close() {} + +func (c mockPulsarConsumer) Seek(_ pulsar.MessageID) error { + panic("implement me") +} + +func (c mockPulsarConsumer) SeekByTime(_ time.Time) error { + panic("implement me") +} + +func (c mockPulsarConsumer) Name() string { + panic("implement me") +} + +type mockPulsarMessage struct { + payload []byte +} + +func (msg mockPulsarMessage) Topic() string { + panic("implement me") +} + +func (msg mockPulsarMessage) Properties() map[string]string { + panic("implement me") +} + +func (msg mockPulsarMessage) Payload() []byte { + return msg.payload +} + +func (msg mockPulsarMessage) ID() pulsar.MessageID { + panic("implement me") +} + +func (msg mockPulsarMessage) PublishTime() time.Time { + panic("implement me") +} + +func (msg mockPulsarMessage) EventTime() time.Time { + panic("implement me") +} + +func (msg mockPulsarMessage) Key() string { + panic("implement me") +} + +func (msg mockPulsarMessage) OrderingKey() string { + panic("implement me") +} + +func (msg mockPulsarMessage) RedeliveryCount() uint32 { + panic("implement me") +} + +func (msg mockPulsarMessage) IsReplicated() bool { + panic("implement me") +} + +func (msg mockPulsarMessage) GetReplicatedFrom() string { + panic("implement me") +} + +func (msg mockPulsarMessage) GetSchemaValue(_ interface{}) error { + panic("implement me") +} + +func (msg mockPulsarMessage) ProducerName() string { + panic("implement me") +} + +func (msg mockPulsarMessage) GetEncryptionContext() *pulsar.EncryptionContext { + panic("implement me") +} + +type mockPulsarClient struct{} + +func (_ mockPulsarClient) CreateProducer(pulsar.ProducerOptions) (pulsar.Producer, error) { + panic("implement me") +} + +func (_ mockPulsarClient) Subscribe(pulsar.ConsumerOptions) (pulsar.Consumer, error) { + return mockPulsarConsumer{}, nil +} + +func (_ mockPulsarClient) CreateReader(pulsar.ReaderOptions) (pulsar.Reader, error) { + panic("implement me") +} + +func (_ mockPulsarClient) TopicPartitions(topic string) ([]string, error) { + panic("implement me") +} + +func (_ mockPulsarClient) Close() {} + +func TestTracesReceiverCreate(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), factory.CreateDefaultConfig(), nil) + assert.Nil(t, err) +} + +func TestTracesReceiverEncoding(t *testing.T) { + tests := []struct { + name string + id component.ID + getExtension func() (extension.Extension, error) + expectedErr string + }{ + { + name: "otlp", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "jaeger", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "zipkin", + id: component.NewIDWithName(component.DataTypeTraces, "zipkin"), + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "jsonlog", + id: component.NewIDWithName(component.DataTypeTraces, "jsonlog"), + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement TracesUnmarshaler", + }, + { + name: "text", + id: component.NewIDWithName(component.DataTypeTraces, "text"), + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement TracesUnmarshaler", + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ext, err := test.getExtension() + assert.Nil(t, err) + host := mockHost{ + ext: map[component.ID]component.Component{ + test.id: ext, + }, + } + receiver := &pulsarTracesConsumer{ + tracesConsumer: nil, + encoding: &test.id, + settings: receivertest.NewNopCreateSettings(), + client: mockPulsarClient{}, + } + if test.expectedErr != "" { + assert.ErrorContains(t, receiver.Start(context.Background(), host), test.expectedErr) + } else { + assert.NoError(t, receiver.Start(context.Background(), host)) + } + }) + } +} + +func TestMetricsReceiverCreate(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), factory.CreateDefaultConfig(), nil) + assert.Nil(t, err) +} + +func TestMetricsReceiverEncoding(t *testing.T) { + tests := []struct { + name string + id component.ID + getExtension func() (extension.Extension, error) + expectedErr string + }{ + { + name: "otlp", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "jaeger", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement MetricsUnmarshaler", + }, + { + name: "zipkin", + id: component.NewIDWithName(component.DataTypeTraces, "zipkin"), + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement MetricsUnmarshaler", + }, + { + name: "jsonlog", + id: component.NewIDWithName(component.DataTypeTraces, "jsonlog"), + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement MetricsUnmarshaler", + }, + { + name: "text", + id: component.NewIDWithName(component.DataTypeTraces, "text"), + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement MetricsUnmarshaler", + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ext, err := test.getExtension() + assert.Nil(t, err) + host := mockHost{ + ext: map[component.ID]component.Component{ + test.id: ext, + }, + } + receiver := &pulsarMetricsConsumer{ + metricsConsumer: nil, + encoding: &test.id, + settings: receivertest.NewNopCreateSettings(), + client: mockPulsarClient{}, + } + if test.expectedErr != "" { + assert.ErrorContains(t, receiver.Start(context.Background(), host), test.expectedErr) + } else { + assert.NoError(t, receiver.Start(context.Background(), host)) + } + }) + } +} + +func TestLogsReceiverCreate(t *testing.T) { + factory := NewFactory() + _, err := factory.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), factory.CreateDefaultConfig(), nil) + assert.Nil(t, err) +} + +func TestLogsReceiverEncoding(t *testing.T) { + tests := []struct { + name string + id component.ID + getExtension func() (extension.Extension, error) + expectedErr string + }{ + { + name: "otlp", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := otlpencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "jaeger", + id: component.NewIDWithName(component.DataTypeTraces, "otlp"), + getExtension: func() (extension.Extension, error) { + factory := jaegerencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement LogsUnmarshaler", + }, + { + name: "zipkin", + id: component.NewIDWithName(component.DataTypeTraces, "zipkin"), + getExtension: func() (extension.Extension, error) { + factory := zipkinencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + expectedErr: "doesn't implement LogsUnmarshaler", + }, + { + name: "jsonlog", + id: component.NewIDWithName(component.DataTypeTraces, "jsonlog"), + getExtension: func() (extension.Extension, error) { + factory := jsonlogencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + { + name: "text", + id: component.NewIDWithName(component.DataTypeTraces, "text"), + getExtension: func() (extension.Extension, error) { + factory := textencodingextension.NewFactory() + return factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), factory.CreateDefaultConfig()) + }, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ext, err := test.getExtension() + assert.Nil(t, err) + host := mockHost{ + ext: map[component.ID]component.Component{ + test.id: ext, + }, + } + receiver := &pulsarLogsConsumer{ + logsConsumer: nil, + encoding: &test.id, + settings: receivertest.NewNopCreateSettings(), + client: mockPulsarClient{}, + } + if test.expectedErr != "" { + assert.ErrorContains(t, receiver.Start(context.Background(), host), test.expectedErr) + } else { + assert.NoError(t, receiver.Start(context.Background(), host)) + } + }) } - _, err := newTracesReceiver(c, receivertest.NewNopCreateSettings(), defaultTracesUnmarshalers(), consumertest.NewNop()) - assert.Error(t, err) } diff --git a/receiver/pulsarreceiver/unmarshaler.go b/receiver/pulsarreceiver/unmarshaler.go deleted file mode 100644 index 12ae7178b52f..000000000000 --- a/receiver/pulsarreceiver/unmarshaler.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "go.opentelemetry.io/collector/pdata/plog" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv1" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv2" -) - -// copy from kafka receiver - -// TracesUnmarshaler deserializes the message body. -type TracesUnmarshaler interface { - // Unmarshal deserializes the message body into tracesConsumer. - Unmarshal([]byte) (ptrace.Traces, error) - - // Encoding of the serialized messages. - Encoding() string -} - -// MetricsUnmarshaler deserializes the message body -type MetricsUnmarshaler interface { - // Unmarshal deserializes the message body into tracesConsumer - Unmarshal([]byte) (pmetric.Metrics, error) - - // Encoding of the serialized messages - Encoding() string -} - -// LogsUnmarshaler deserializes the message body. -type LogsUnmarshaler interface { - // Unmarshal deserializes the message body into tracesConsumer. - Unmarshal([]byte) (plog.Logs, error) - - // Encoding of the serialized messages. - Encoding() string -} - -// defaultTracesUnmarshalers returns map of supported encodings with TracesUnmarshaler. -func defaultTracesUnmarshalers() map[string]TracesUnmarshaler { - otlpPb := newPdataTracesUnmarshaler(&ptrace.ProtoUnmarshaler{}, defaultEncoding) - jaegerProto := jaegerProtoSpanUnmarshaler{} - jaegerJSON := jaegerJSONSpanUnmarshaler{} - zipkinProto := newPdataTracesUnmarshaler(zipkinv2.NewProtobufTracesUnmarshaler(false, false), "zipkin_proto") - zipkinJSON := newPdataTracesUnmarshaler(zipkinv2.NewJSONTracesUnmarshaler(false), "zipkin_json") - zipkinThrift := newPdataTracesUnmarshaler(zipkinv1.NewThriftTracesUnmarshaler(), "zipkin_thrift") - return map[string]TracesUnmarshaler{ - otlpPb.Encoding(): otlpPb, - jaegerProto.Encoding(): jaegerProto, - jaegerJSON.Encoding(): jaegerJSON, - zipkinProto.Encoding(): zipkinProto, - zipkinJSON.Encoding(): zipkinJSON, - zipkinThrift.Encoding(): zipkinThrift, - } -} - -func defaultMetricsUnmarshalers() map[string]MetricsUnmarshaler { - otlpPb := newPdataMetricsUnmarshaler(&pmetric.ProtoUnmarshaler{}, defaultEncoding) - return map[string]MetricsUnmarshaler{ - otlpPb.Encoding(): otlpPb, - } -} - -func defaultLogsUnmarshalers() map[string]LogsUnmarshaler { - otlpPb := newPdataLogsUnmarshaler(&plog.ProtoUnmarshaler{}, defaultEncoding) - return map[string]LogsUnmarshaler{ - otlpPb.Encoding(): otlpPb, - } -} diff --git a/receiver/pulsarreceiver/unmarshaler_test.go b/receiver/pulsarreceiver/unmarshaler_test.go deleted file mode 100644 index eacdc46eef0b..000000000000 --- a/receiver/pulsarreceiver/unmarshaler_test.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// copy from kafka receiver -func TestDefaultTracesUnMarshaler(t *testing.T) { - expectedEncodings := []string{ - "otlp_proto", - "jaeger_proto", - "jaeger_json", - "zipkin_proto", - "zipkin_json", - "zipkin_thrift", - } - marshalers := defaultTracesUnmarshalers() - assert.Equal(t, len(expectedEncodings), len(marshalers)) - for _, e := range expectedEncodings { - t.Run(e, func(t *testing.T) { - m, ok := marshalers[e] - require.True(t, ok) - assert.NotNil(t, m) - }) - } -} - -func TestDefaultMetricsUnMarshaler(t *testing.T) { - expectedEncodings := []string{ - "otlp_proto", - } - marshalers := defaultMetricsUnmarshalers() - assert.Equal(t, len(expectedEncodings), len(marshalers)) - for _, e := range expectedEncodings { - t.Run(e, func(t *testing.T) { - m, ok := marshalers[e] - require.True(t, ok) - assert.NotNil(t, m) - }) - } -} - -func TestDefaultLogsUnMarshaler(t *testing.T) { - expectedEncodings := []string{ - "otlp_proto", - } - marshalers := defaultLogsUnmarshalers() - assert.Equal(t, len(expectedEncodings), len(marshalers)) - for _, e := range expectedEncodings { - t.Run(e, func(t *testing.T) { - m, ok := marshalers[e] - require.True(t, ok) - assert.NotNil(t, m) - }) - } -} diff --git a/receiver/pulsarreceiver/zipkin_unmarshaler.go b/receiver/pulsarreceiver/zipkin_unmarshaler.go deleted file mode 100644 index 3a82b75cf028..000000000000 --- a/receiver/pulsarreceiver/zipkin_unmarshaler.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv1" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv2" -) - -// copy from kafka receiver -const ( - zipkinProtobufEncoding = "zipkin_proto" - zipkinJSONEncoding = "zipkin_json" - zipkinThriftEncoding = "zipkin_thrift" -) - -func newZipkinProtobufUnmarshaler() TracesUnmarshaler { - return newPdataTracesUnmarshaler(zipkinv2.NewProtobufTracesUnmarshaler(false, false), zipkinProtobufEncoding) -} - -func newZipkinJSONUnmarshaler() TracesUnmarshaler { - return newPdataTracesUnmarshaler(zipkinv2.NewJSONTracesUnmarshaler(false), zipkinJSONEncoding) -} - -func newZipkinThriftUnmarshaler() TracesUnmarshaler { - return newPdataTracesUnmarshaler(zipkinv1.NewThriftTracesUnmarshaler(), zipkinThriftEncoding) -} diff --git a/receiver/pulsarreceiver/zipkin_unmarshaler_test.go b/receiver/pulsarreceiver/zipkin_unmarshaler_test.go deleted file mode 100644 index 1e2765511c2e..000000000000 --- a/receiver/pulsarreceiver/zipkin_unmarshaler_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package pulsarreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver" - -import ( - "context" - "testing" - - "github.com/apache/thrift/lib/go/thrift" - "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" - "github.com/openzipkin/zipkin-go/proto/zipkin_proto3" - zipkinreporter "github.com/openzipkin/zipkin-go/reporter" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/ptrace" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinv2" -) - -// copy from kafka receiver -var v2FromTranslator zipkinv2.FromTranslator - -func TestUnmarshalZipkin(t *testing.T) { - td := ptrace.NewTraces() - rs := td.ResourceSpans().AppendEmpty() - rs.Resource().Attributes().PutStr(conventions.AttributeServiceName, "my_service") - span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() - span.SetName("foo") - span.SetStartTimestamp(pcommon.Timestamp(1597759000)) - span.SetEndTimestamp(pcommon.Timestamp(1597769000)) - span.SetTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}) - span.SetSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}) - span.SetParentSpanID([8]byte{0, 0, 0, 0, 0, 0, 0, 0}) - spans, err := v2FromTranslator.FromTraces(td) - require.NoError(t, err) - - serializer := zipkinreporter.JSONSerializer{} - jsonBytes, err := serializer.Serialize(spans) - require.NoError(t, err) - - tSpan := &zipkincore.Span{Name: "foo"} - thriftTransport := thrift.NewTMemoryBuffer() - protocolTransport := thrift.NewTBinaryProtocolConf(thriftTransport, nil) - require.NoError(t, protocolTransport.WriteListBegin(context.Background(), thrift.STRUCT, 1)) - err = tSpan.Write(context.Background(), protocolTransport) - require.NoError(t, err) - require.NoError(t, protocolTransport.WriteListEnd(context.Background())) - - tdThrift, err := newZipkinThriftUnmarshaler().Unmarshal(thriftTransport.Buffer.Bytes()) - require.NoError(t, err) - - protoBytes, err := new(zipkin_proto3.SpanSerializer).Serialize(spans) - require.NoError(t, err) - - tests := []struct { - unmarshaler TracesUnmarshaler - encoding string - bytes []byte - expected ptrace.Traces - }{ - { - unmarshaler: newZipkinProtobufUnmarshaler(), - encoding: "zipkin_proto", - bytes: protoBytes, - expected: td, - }, - { - unmarshaler: newZipkinJSONUnmarshaler(), - encoding: "zipkin_json", - bytes: jsonBytes, - expected: td, - }, - { - unmarshaler: newZipkinThriftUnmarshaler(), - encoding: "zipkin_thrift", - bytes: thriftTransport.Buffer.Bytes(), - expected: tdThrift, - }, - } - for _, test := range tests { - t.Run(test.encoding, func(t *testing.T) { - traces, err := test.unmarshaler.Unmarshal(test.bytes) - require.NoError(t, err) - assert.Equal(t, test.expected, traces) - assert.Equal(t, test.encoding, test.unmarshaler.Encoding()) - }) - } -} - -func TestUnmarshalZipkinThrift_error(t *testing.T) { - p := newZipkinThriftUnmarshaler() - _, err := p.Unmarshal([]byte("+$%")) - assert.Error(t, err) -} - -func TestUnmarshalZipkinJSON_error(t *testing.T) { - p := newZipkinJSONUnmarshaler() - _, err := p.Unmarshal([]byte("+$%")) - assert.Error(t, err) -} - -func TestUnmarshalZipkinProto_error(t *testing.T) { - p := newZipkinProtobufUnmarshaler() - _, err := p.Unmarshal([]byte("+$%")) - assert.Error(t, err) -} From e559f62ed78fd81571162ca9e8cb10e67c4874bf Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Thu, 11 Jan 2024 15:36:14 +0530 Subject: [PATCH 08/12] fix: go tidy --- receiver/pulsarreceiver/go.mod | 25 ++++++++++++++++--------- receiver/pulsarreceiver/go.sum | 5 ++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/receiver/pulsarreceiver/go.mod b/receiver/pulsarreceiver/go.mod index d07c6db8c9b6..c282453e9dd2 100644 --- a/receiver/pulsarreceiver/go.mod +++ b/receiver/pulsarreceiver/go.mod @@ -4,20 +4,19 @@ go 1.20 require ( github.com/apache/pulsar-client-go v0.8.1 - github.com/apache/thrift v0.19.0 - github.com/gogo/protobuf v1.3.2 - github.com/jaegertracing/jaeger v1.53.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.0 - github.com/openzipkin/zipkin-go v0.4.2 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.92.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.92.0 go.opentelemetry.io/collector/config/configopaque v0.92.0 go.opentelemetry.io/collector/confmap v0.92.0 go.opentelemetry.io/collector/consumer v0.92.0 - go.opentelemetry.io/collector/pdata v1.0.1 + go.opentelemetry.io/collector/extension v0.92.0 go.opentelemetry.io/collector/receiver v0.92.0 - go.opentelemetry.io/collector/semconv v0.92.0 go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 @@ -28,6 +27,7 @@ require ( github.com/AthenZ/athenz v1.10.39 // indirect github.com/DataDog/zstd v1.5.0 // indirect github.com/apache/pulsar-client-go/oauth2 v0.0.0-20220120090717-25e59572242e // indirect + github.com/apache/thrift v0.19.0 // indirect github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -36,11 +36,13 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/frankban/quicktest v1.14.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/jaegertracing/jaeger v1.53.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.17.4 // indirect @@ -56,7 +58,11 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/nxadm/tail v1.4.8 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.0 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -68,6 +74,8 @@ require ( github.com/spaolacci/murmur3 v1.1.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.92.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.1 // indirect + go.opentelemetry.io/collector/pdata v1.0.1 // indirect + go.opentelemetry.io/collector/semconv v0.92.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -113,4 +121,3 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/enco replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension - diff --git a/receiver/pulsarreceiver/go.sum b/receiver/pulsarreceiver/go.sum index 55a78cba871f..7715c1e120c3 100644 --- a/receiver/pulsarreceiver/go.sum +++ b/receiver/pulsarreceiver/go.sum @@ -312,8 +312,9 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= 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/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -424,6 +425,8 @@ go.opentelemetry.io/collector/confmap v0.92.0 h1:xz20zNIvF9ZA1eWE+MZmZunmdXPIP/f go.opentelemetry.io/collector/confmap v0.92.0/go.mod h1:CmqTszB2uwiJ9ieEqISdecuoVuyt3jMnJ/9kD53GYHs= go.opentelemetry.io/collector/consumer v0.92.0 h1:twa8T0iR9KVglvRbwZ5OPKLXPCC2DO6gVhrgDZ47MPE= go.opentelemetry.io/collector/consumer v0.92.0/go.mod h1:fBZqP7bou3I7pDhWjleBuzdaLfQgJBc92wPJVOcKaGU= +go.opentelemetry.io/collector/extension v0.92.0 h1:zaehgW+LXCMNEb1d6Af/VHWphh5ZwX9aZl+NuQLGhpQ= +go.opentelemetry.io/collector/extension v0.92.0/go.mod h1:5EYwiaGU6deSY8YWqT5gvlnD850yJXP3NqFRKVVbYLs= go.opentelemetry.io/collector/featuregate v1.0.1 h1:ok//hLSXttBbyu4sSV1pTx1nKdr5udSmrWy5sFMIIbM= go.opentelemetry.io/collector/featuregate v1.0.1/go.mod h1:QQXjP4etmJQhkQ20j4P/rapWuItYxoFozg/iIwuKnYg= go.opentelemetry.io/collector/pdata v1.0.1 h1:dGX2h7maA6zHbl5D3AsMnF1c3Nn+3EUftbVCLzeyNvA= From 43557e1c8c9fb7a6366c62058a96bb2e87aa73c8 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Sun, 14 Jan 2024 14:51:40 +0530 Subject: [PATCH 09/12] fix: go tidy --- receiver/pulsarreceiver/go.mod | 5 +++-- receiver/pulsarreceiver/go.sum | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/receiver/pulsarreceiver/go.mod b/receiver/pulsarreceiver/go.mod index 5a1c3f8e3f7a..e67eb90900ed 100644 --- a/receiver/pulsarreceiver/go.mod +++ b/receiver/pulsarreceiver/go.mod @@ -15,9 +15,8 @@ require ( go.opentelemetry.io/collector/config/configopaque v0.92.1-0.20240112172857-83d463ceba06 go.opentelemetry.io/collector/confmap v0.92.1-0.20240112172857-83d463ceba06 go.opentelemetry.io/collector/consumer v0.92.1-0.20240112172857-83d463ceba06 - go.opentelemetry.io/collector/pdata v1.0.2-0.20240112172857-83d463ceba06 + go.opentelemetry.io/collector/extension v0.92.1-0.20240112172857-83d463ceba06 go.opentelemetry.io/collector/receiver v0.92.1-0.20240112172857-83d463ceba06 - go.opentelemetry.io/collector/semconv v0.92.1-0.20240112172857-83d463ceba06 go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 @@ -84,6 +83,8 @@ require ( go.opentelemetry.io/collector v0.92.1-0.20240112172857-83d463ceba06 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.92.1-0.20240112172857-83d463ceba06 // indirect go.opentelemetry.io/collector/featuregate v1.0.2-0.20240112172857-83d463ceba06 // indirect + go.opentelemetry.io/collector/pdata v1.0.2-0.20240112172857-83d463ceba06 // indirect + go.opentelemetry.io/collector/semconv v0.92.1-0.20240112172857-83d463ceba06 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect diff --git a/receiver/pulsarreceiver/go.sum b/receiver/pulsarreceiver/go.sum index 85e5fcaa501d..fc2920743611 100644 --- a/receiver/pulsarreceiver/go.sum +++ b/receiver/pulsarreceiver/go.sum @@ -460,6 +460,8 @@ go.opentelemetry.io/collector/confmap v0.92.1-0.20240112172857-83d463ceba06 h1:i go.opentelemetry.io/collector/confmap v0.92.1-0.20240112172857-83d463ceba06/go.mod h1:CmqTszB2uwiJ9ieEqISdecuoVuyt3jMnJ/9kD53GYHs= go.opentelemetry.io/collector/consumer v0.92.1-0.20240112172857-83d463ceba06 h1:zf0Zy0DwiN9rBWyhg/WWrTJar3CULGziEUG6YTkCXOE= go.opentelemetry.io/collector/consumer v0.92.1-0.20240112172857-83d463ceba06/go.mod h1:KhNeje82anY3f123+R/RKtc2Q8/rdnYYi4tG2WSnxqk= +go.opentelemetry.io/collector/extension v0.92.1-0.20240112172857-83d463ceba06 h1:Hbzik+qRPGEkT0MTMIu9HHokPUnQvh44yWyIVNLDpQ8= +go.opentelemetry.io/collector/extension v0.92.1-0.20240112172857-83d463ceba06/go.mod h1:gCukg3D3VIzfp8NXAhuaPadDQhe2Hg3YGtsBuOr06+Q= go.opentelemetry.io/collector/featuregate v1.0.2-0.20240112172857-83d463ceba06 h1:LN4c/jJkIAOJYFRTapRigYDp3k+4BllH4Pqr7TT5b2w= go.opentelemetry.io/collector/featuregate v1.0.2-0.20240112172857-83d463ceba06/go.mod h1:QQXjP4etmJQhkQ20j4P/rapWuItYxoFozg/iIwuKnYg= go.opentelemetry.io/collector/pdata v1.0.2-0.20240112172857-83d463ceba06 h1:v2SnEUqor+9FuJK3pPRR6jd342lzzmicuafWCrfvQZ8= From ae71796116b52f2fe2c0b1b380fad4ba1abe3ce1 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Sun, 14 Jan 2024 14:55:15 +0530 Subject: [PATCH 10/12] chore: add changelog --- ...add-encoding-extension-pulsarreceiver.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .chloggen/add-encoding-extension-pulsarreceiver.yaml diff --git a/.chloggen/add-encoding-extension-pulsarreceiver.yaml b/.chloggen/add-encoding-extension-pulsarreceiver.yaml new file mode 100644 index 000000000000..9b9e4f9473db --- /dev/null +++ b/.chloggen/add-encoding-extension-pulsarreceiver.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pulsarreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add newly added encoding extension to pulsarreceiver + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29322] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] From 9edf91e1f87e009577c728f7b21ba7017d576445 Mon Sep 17 00:00:00 2001 From: Vihas Splunk Date: Tue, 16 Jan 2024 10:17:58 +0530 Subject: [PATCH 11/12] fix: go mod tidy --- cmd/configschema/go.mod | 19 ++++++++++++++++--- cmd/otelcontribcol/go.mod | 18 +++++++++--------- go.mod | 19 ++++++++++++++++--- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 000b221b0ff1..982b18d8673e 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -69,7 +69,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.92.0 // indirect @@ -82,14 +82,14 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogprocessor v0.92.0 // indirect @@ -495,6 +495,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.92.0 // indirect @@ -1160,3 +1161,15 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockda replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ../../testbed replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../../extension/encoding + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ../../extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ../../extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ../../extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ../../extension/encoding/otlpencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ../../extension/encoding/jaegerencodingextension diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 6957f4e084b8..2e8e351a2c52 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -59,11 +59,11 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension v0.92.1-0.20240112172857-83d463ceba06 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension v0.92.1-0.20240112172857-83d463ceba06 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.92.1-0.20240112172857-83d463ceba06 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension v0.92.1-0.20240112172857-83d463ceba06 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension v0.92.1-0.20240112172857-83d463ceba06 github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder v0.92.0 @@ -81,7 +81,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.92.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.1-0.20240112172857-83d463ceba06 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.92.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.92.0 @@ -529,7 +529,7 @@ require ( github.com/nginxinc/nginx-prometheus-exporter v0.8.1-0.20201110005315-f5a5f8086c19 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect github.com/open-telemetry/opamp-go v0.10.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.92.0 // indirect @@ -556,14 +556,14 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters v0.92.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect diff --git a/go.mod b/go.mod index 22ca73520fbb..1fd9fb5470da 100644 --- a/go.mod +++ b/go.mod @@ -500,6 +500,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nginxinc/nginx-prometheus-exporter v0.8.1-0.20201110005315-f5a5f8086c19 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.92.0 // indirect @@ -511,7 +512,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.92.0 // indirect @@ -529,14 +530,14 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.92.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking v0.92.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.92.1-0.20240112172857-83d463ceba06 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters v0.92.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect @@ -1162,3 +1163,15 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockda replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ./testbed replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ./exporter/syslogexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ./extension/encoding + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension => ./extension/encoding/textencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension => ./extension/encoding/jsonlogencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension => ./extension/encoding/zipkinencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jaegerencodingextension => ./extension/encoding/jaegerencodingextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension => ./extension/encoding/otlpencodingextension From 5a4f6e9d9369e199a6c66e21fa0570b35d22df81 Mon Sep 17 00:00:00 2001 From: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com> Date: Thu, 21 Mar 2024 17:16:09 +0530 Subject: [PATCH 12/12] Update receiver/pulsarreceiver/config.go Co-authored-by: Dmitrii Anoshin --- receiver/pulsarreceiver/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/pulsarreceiver/config.go b/receiver/pulsarreceiver/config.go index edcda33a4b49..1984f72b126d 100644 --- a/receiver/pulsarreceiver/config.go +++ b/receiver/pulsarreceiver/config.go @@ -20,7 +20,7 @@ type Config struct { // The Subscription that receiver will be consuming messages from (default "otlp_subscription") Subscription string `mapstructure:"subscription"` // Encoding of the messages (default "otlp_proto") - EncodingID *component.ID `mapstructure:"encoding"` + EncodingExtension *component.ID `mapstructure:"encoding_extension"` // Name specifies the consumer name. ConsumerName string `mapstructure:"consumer_name"` // Set the path to the trusted TLS certificate file