diff --git a/exporter/elasticsearchexporter/integrationtest/datareceiver.go b/exporter/elasticsearchexporter/integrationtest/datareceiver.go index 5fc59e46526f..e530d864fb35 100644 --- a/exporter/elasticsearchexporter/integrationtest/datareceiver.go +++ b/exporter/elasticsearchexporter/integrationtest/datareceiver.go @@ -216,7 +216,7 @@ func (es *mockESReceiver) Start(ctx context.Context, host component.Host) error }) r.HandleFunc("/_bulk", func(w http.ResponseWriter, r *http.Request) { if !es.config.DecodeBulkRequests { - w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, "{}") return } _, response := docappendertest.DecodeBulkRequest(r) diff --git a/exporter/elasticsearchexporter/integrationtest/exporter_bench_test.go b/exporter/elasticsearchexporter/integrationtest/exporter_bench_test.go index 1fed5da91576..2a1fe98db9b3 100644 --- a/exporter/elasticsearchexporter/integrationtest/exporter_bench_test.go +++ b/exporter/elasticsearchexporter/integrationtest/exporter_bench_test.go @@ -18,6 +18,8 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.uber.org/zap" + "go.uber.org/zap/zaptest" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/testbed" @@ -52,9 +54,11 @@ func benchmarkLogs(b *testing.B, batchSize int, mappingMode string) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + exporterSettings := exportertest.NewNopSettings() + exporterSettings.TelemetrySettings.Logger = zaptest.NewLogger(b, zaptest.Level(zap.WarnLevel)) runnerCfg := prepareBenchmark(b, batchSize, mappingMode) exporter, err := runnerCfg.factory.CreateLogsExporter( - ctx, exportertest.NewNopSettings(), runnerCfg.esCfg, + ctx, exporterSettings, runnerCfg.esCfg, ) require.NoError(b, err) require.NoError(b, exporter.Start(ctx, componenttest.NewNopHost())) @@ -79,9 +83,11 @@ func benchmarkTraces(b *testing.B, batchSize int, mappingMode string) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + exporterSettings := exportertest.NewNopSettings() + exporterSettings.TelemetrySettings.Logger = zaptest.NewLogger(b, zaptest.Level(zap.WarnLevel)) runnerCfg := prepareBenchmark(b, batchSize, mappingMode) exporter, err := runnerCfg.factory.CreateTracesExporter( - ctx, exportertest.NewNopSettings(), runnerCfg.esCfg, + ctx, exporterSettings, runnerCfg.esCfg, ) require.NoError(b, err) require.NoError(b, exporter.Start(ctx, componenttest.NewNopHost()))