From de52030f6c9e8ba3de2575828b64153bb1f640f0 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Thu, 26 Oct 2023 16:58:08 -0700 Subject: [PATCH] [testbed] remove jaegerexporter replacing the jaegerexporter with the sapmexporter for the testing of the jaeger receiver Signed-off-by: Alex Boten --- cmd/oteltestbedcol/builder-config.yaml | 1 - cmd/oteltestbedcol/components.go | 2 - cmd/oteltestbedcol/go.mod | 1 - cmd/oteltestbedcol/go.sum | 2 - testbed/correctnesstests/utils.go | 2 +- testbed/datasenders/jaeger.go | 70 -------------------------- testbed/go.mod | 1 - testbed/go.sum | 2 - testbed/stabilitytests/trace_test.go | 2 +- testbed/tests/trace_test.go | 8 +-- 10 files changed, 6 insertions(+), 85 deletions(-) delete mode 100644 testbed/datasenders/jaeger.go diff --git a/cmd/oteltestbedcol/builder-config.yaml b/cmd/oteltestbedcol/builder-config.yaml index e3b70d8a902b..8280650dbbfc 100644 --- a/cmd/oteltestbedcol/builder-config.yaml +++ b/cmd/oteltestbedcol/builder-config.yaml @@ -18,7 +18,6 @@ exporters: - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.88.0 - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.88.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.88.0 diff --git a/cmd/oteltestbedcol/components.go b/cmd/oteltestbedcol/components.go index 2a262be988de..fe3453ea9c6f 100644 --- a/cmd/oteltestbedcol/components.go +++ b/cmd/oteltestbedcol/components.go @@ -20,7 +20,6 @@ import ( otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" carbonexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter" - jaegerexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter" opencensusexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter" prometheusexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter" sapmexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter" @@ -86,7 +85,6 @@ func components() (otelcol.Factories, error) { otlpexporter.NewFactory(), otlphttpexporter.NewFactory(), carbonexporter.NewFactory(), - jaegerexporter.NewFactory(), opencensusexporter.NewFactory(), prometheusexporter.NewFactory(), sapmexporter.NewFactory(), diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index 0a866f600000..ce3a6b401e08 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -6,7 +6,6 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.88.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.88.0 diff --git a/cmd/oteltestbedcol/go.sum b/cmd/oteltestbedcol/go.sum index 24634cde4a78..5e53bf0aa9be 100644 --- a/cmd/oteltestbedcol/go.sum +++ b/cmd/oteltestbedcol/go.sum @@ -1066,8 +1066,6 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0 h1:NyqJDAgm3VC1UNrTW0gv2auQoTlaCEcit5c0On0oYG4= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0/go.mod h1:F8TX5dXc8VcF789x8UAu1fIWta16sGZMxhfGLNes+L8= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= diff --git a/testbed/correctnesstests/utils.go b/testbed/correctnesstests/utils.go index 6fe1790170cf..a8f4ad7dc971 100644 --- a/testbed/correctnesstests/utils.go +++ b/testbed/correctnesstests/utils.go @@ -118,7 +118,7 @@ func ConstructTraceSender(t *testing.T, receiver string) testbed.DataSender { case "opencensus": sender = datasenders.NewOCTraceDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)) case "jaeger": - sender = datasenders.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)) + sender = datasenders.NewSapmDataSender(testbed.GetAvailablePort(t), "") case "zipkin": sender = datasenders.NewZipkinDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)) default: diff --git a/testbed/datasenders/jaeger.go b/testbed/datasenders/jaeger.go deleted file mode 100644 index 2c07aca4df8e..000000000000 --- a/testbed/datasenders/jaeger.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package datasenders // import "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/datasenders" - -import ( - "context" - "fmt" - - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config/configtls" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/exporter/exportertest" - "go.uber.org/zap" - - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter" - "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/testbed" -) - -// jaegerGRPCDataSender implements TraceDataSender for Jaeger thrift_http exporter. -type jaegerGRPCDataSender struct { - testbed.DataSenderBase - consumer.Traces -} - -// Ensure jaegerGRPCDataSender implements TraceDataSender. -var _ testbed.TraceDataSender = (*jaegerGRPCDataSender)(nil) - -// NewJaegerGRPCDataSender creates a new Jaeger exporter sender that will send -// to the specified port after Start is called. -func NewJaegerGRPCDataSender(host string, port int) testbed.TraceDataSender { - return &jaegerGRPCDataSender{ - DataSenderBase: testbed.DataSenderBase{Port: port, Host: host}, - } -} - -func (je *jaegerGRPCDataSender) Start() error { - factory := jaegerexporter.NewFactory() - cfg := factory.CreateDefaultConfig().(*jaegerexporter.Config) - // Disable retries, we should push data and if error just log it. - cfg.RetrySettings.Enabled = false - // Disable sending queue, we should push data from the caller goroutine. - cfg.QueueSettings.Enabled = false - cfg.Endpoint = je.GetEndpoint().String() - cfg.TLSSetting = configtls.TLSClientSetting{ - Insecure: true, - } - params := exportertest.NewNopCreateSettings() - params.Logger = zap.L() - - exp, err := factory.CreateTracesExporter(context.Background(), params, cfg) - if err != nil { - return err - } - - je.Traces = exp - return exp.Start(context.Background(), componenttest.NewNopHost()) -} - -func (je *jaegerGRPCDataSender) GenConfigYAMLStr() string { - return fmt.Sprintf(` - jaeger: - protocols: - grpc: - endpoint: "%s"`, je.GetEndpoint()) -} - -func (je *jaegerGRPCDataSender) ProtocolName() string { - return "jaeger" -} diff --git a/testbed/go.mod b/testbed/go.mod index 6c703967c8c0..3103382405b3 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -5,7 +5,6 @@ go 1.20 require ( github.com/fluent/fluent-logger-golang v1.9.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.88.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.88.0 diff --git a/testbed/go.sum b/testbed/go.sum index 3191f8df8420..0a83993cf42a 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -491,8 +491,6 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0 h1:NyqJDAgm3VC1UNrTW0gv2auQoTlaCEcit5c0On0oYG4= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.85.0/go.mod h1:F8TX5dXc8VcF789x8UAu1fIWta16sGZMxhfGLNes+L8= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= diff --git a/testbed/stabilitytests/trace_test.go b/testbed/stabilitytests/trace_test.go index 30699b485763..726cda34b090 100644 --- a/testbed/stabilitytests/trace_test.go +++ b/testbed/stabilitytests/trace_test.go @@ -86,7 +86,7 @@ func TestStabilityTracesOTLP(t *testing.T) { func TestStabilityTracesJaegerGRPC(t *testing.T) { scenarios.Scenario10kItemsPerSecond( t, - datasenders.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + datasenders.NewSapmDataSender(testbed.GetAvailablePort(t), ""), datareceivers.NewJaegerDataReceiver(testbed.GetAvailablePort(t)), testbed.ResourceSpec{ ExpectedMaxCPU: 40, diff --git a/testbed/tests/trace_test.go b/testbed/tests/trace_test.go index a5a560f6adcd..aff5ca74b476 100644 --- a/testbed/tests/trace_test.go +++ b/testbed/tests/trace_test.go @@ -38,8 +38,8 @@ func TestTrace10kSPS(t *testing.T) { resourceSpec testbed.ResourceSpec }{ { - "JaegerGRPC", - datasenders.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + "SAPM-JaegerGRPC", + datasenders.NewSapmDataSender(testbed.GetAvailablePort(t), ""), datareceivers.NewJaegerDataReceiver(testbed.GetAvailablePort(t)), testbed.ResourceSpec{ ExpectedMaxCPU: 40, @@ -403,8 +403,8 @@ func TestTraceAttributesProcessor(t *testing.T) { receiver testbed.DataReceiver }{ { - "JaegerGRPC", - datasenders.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + "SAPM-JaegerGRPC", + datasenders.NewSapmDataSender(testbed.GetAvailablePort(t), ""), datareceivers.NewJaegerDataReceiver(testbed.GetAvailablePort(t)), }, {