From 4c6a3428f41269d61fa5c1369bf0dbb62d9f468f Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 8 Oct 2024 20:32:43 -0700 Subject: [PATCH] [chore] Move otlptext to debug/internal, no need in exporter (#11372) Depends on https://github.com/open-telemetry/opentelemetry-collector/pull/11371 Signed-off-by: Bogdan Drutu --- exporter/debugexporter/exporter.go | 2 +- exporter/debugexporter/factory.go | 2 +- exporter/debugexporter/go.mod | 4 ++-- exporter/{ => debugexporter}/internal/otlptext/databuffer.go | 2 +- .../{ => debugexporter}/internal/otlptext/databuffer_test.go | 0 .../{ => debugexporter}/internal/otlptext/known_sync_error.go | 2 +- .../internal/otlptext/known_sync_error_other.go | 2 +- .../internal/otlptext/known_sync_error_windows.go | 2 +- exporter/{ => debugexporter}/internal/otlptext/logs.go | 2 +- exporter/{ => debugexporter}/internal/otlptext/logs_test.go | 0 exporter/{ => debugexporter}/internal/otlptext/metrics.go | 2 +- .../{ => debugexporter}/internal/otlptext/metrics_test.go | 0 .../{ => debugexporter}/internal/otlptext/package_test.go | 0 exporter/{ => debugexporter}/internal/otlptext/profiles.go | 2 +- .../{ => debugexporter}/internal/otlptext/profiles_test.go | 0 exporter/{ => debugexporter}/internal/otlptext/sync.go | 2 +- .../internal/otlptext/testdata/logs/embedded_maps.out | 0 .../internal/otlptext/testdata/logs/empty.out | 0 .../internal/otlptext/testdata/logs/one_record.out | 0 .../internal/otlptext/testdata/logs/two_records.out | 0 .../internal/otlptext/testdata/metrics/empty.out | 0 .../otlptext/testdata/metrics/invalid_metric_type.out | 0 .../otlptext/testdata/metrics/metrics_with_all_types.out | 0 .../internal/otlptext/testdata/metrics/two_metrics.out | 0 .../internal/otlptext/testdata/profiles/empty.out | 0 .../internal/otlptext/testdata/profiles/two_profiles.out | 0 .../internal/otlptext/testdata/traces/empty.out | 0 .../internal/otlptext/testdata/traces/two_spans.out | 0 exporter/{ => debugexporter}/internal/otlptext/traces.go | 2 +- exporter/{ => debugexporter}/internal/otlptext/traces_test.go | 0 exporter/go.mod | 2 +- 31 files changed, 14 insertions(+), 14 deletions(-) rename exporter/{ => debugexporter}/internal/otlptext/databuffer.go (99%) rename exporter/{ => debugexporter}/internal/otlptext/databuffer_test.go (100%) rename exporter/{ => debugexporter}/internal/otlptext/known_sync_error.go (95%) rename exporter/{ => debugexporter}/internal/otlptext/known_sync_error_other.go (90%) rename exporter/{ => debugexporter}/internal/otlptext/known_sync_error_windows.go (92%) rename exporter/{ => debugexporter}/internal/otlptext/logs.go (97%) rename exporter/{ => debugexporter}/internal/otlptext/logs_test.go (100%) rename exporter/{ => debugexporter}/internal/otlptext/metrics.go (97%) rename exporter/{ => debugexporter}/internal/otlptext/metrics_test.go (100%) rename exporter/{ => debugexporter}/internal/otlptext/package_test.go (100%) rename exporter/{ => debugexporter}/internal/otlptext/profiles.go (98%) rename exporter/{ => debugexporter}/internal/otlptext/profiles_test.go (100%) rename exporter/{ => debugexporter}/internal/otlptext/sync.go (94%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/logs/embedded_maps.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/logs/empty.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/logs/one_record.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/logs/two_records.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/metrics/empty.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/metrics/invalid_metric_type.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/metrics/metrics_with_all_types.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/metrics/two_metrics.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/profiles/empty.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/profiles/two_profiles.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/traces/empty.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/testdata/traces/two_spans.out (100%) rename exporter/{ => debugexporter}/internal/otlptext/traces.go (98%) rename exporter/{ => debugexporter}/internal/otlptext/traces_test.go (100%) diff --git a/exporter/debugexporter/exporter.go b/exporter/debugexporter/exporter.go index 57fb16d8b46..a4ffe6f16f2 100644 --- a/exporter/debugexporter/exporter.go +++ b/exporter/debugexporter/exporter.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/exporter/debugexporter/internal/normal" - "go.opentelemetry.io/collector/exporter/internal/otlptext" + "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" diff --git a/exporter/debugexporter/factory.go b/exporter/debugexporter/factory.go index 72a2f45e3f3..15f6407e928 100644 --- a/exporter/debugexporter/factory.go +++ b/exporter/debugexporter/factory.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/debugexporter/internal/metadata" + "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" "go.opentelemetry.io/collector/exporter/exporterhelper" - "go.opentelemetry.io/collector/exporter/internal/otlptext" ) // The value of "type" key in configuration. diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index d7857687f00..863484872f0 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -10,9 +10,11 @@ require ( go.opentelemetry.io/collector/consumer v0.111.0 go.opentelemetry.io/collector/exporter v0.111.0 go.opentelemetry.io/collector/pdata v1.17.0 + go.opentelemetry.io/collector/pdata/pprofile v0.111.0 go.opentelemetry.io/collector/pdata/testdata v0.111.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 + golang.org/x/sys v0.26.0 ) require ( @@ -39,7 +41,6 @@ require ( go.opentelemetry.io/collector/extension v0.111.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect go.opentelemetry.io/collector/pipeline v0.111.0 // indirect go.opentelemetry.io/collector/receiver v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect @@ -50,7 +51,6 @@ require ( go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/exporter/internal/otlptext/databuffer.go b/exporter/debugexporter/internal/otlptext/databuffer.go similarity index 99% rename from exporter/internal/otlptext/databuffer.go rename to exporter/debugexporter/internal/otlptext/databuffer.go index 32f59220266..94b2f6551d4 100644 --- a/exporter/internal/otlptext/databuffer.go +++ b/exporter/debugexporter/internal/otlptext/databuffer.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "bytes" diff --git a/exporter/internal/otlptext/databuffer_test.go b/exporter/debugexporter/internal/otlptext/databuffer_test.go similarity index 100% rename from exporter/internal/otlptext/databuffer_test.go rename to exporter/debugexporter/internal/otlptext/databuffer_test.go diff --git a/exporter/internal/otlptext/known_sync_error.go b/exporter/debugexporter/internal/otlptext/known_sync_error.go similarity index 95% rename from exporter/internal/otlptext/known_sync_error.go rename to exporter/debugexporter/internal/otlptext/known_sync_error.go index 3745fea0e79..44eb340e65a 100644 --- a/exporter/internal/otlptext/known_sync_error.go +++ b/exporter/debugexporter/internal/otlptext/known_sync_error.go @@ -3,7 +3,7 @@ //go:build linux || darwin -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "errors" diff --git a/exporter/internal/otlptext/known_sync_error_other.go b/exporter/debugexporter/internal/otlptext/known_sync_error_other.go similarity index 90% rename from exporter/internal/otlptext/known_sync_error_other.go rename to exporter/debugexporter/internal/otlptext/known_sync_error_other.go index 6c9f10f8ad0..c9fb558f9a1 100644 --- a/exporter/internal/otlptext/known_sync_error_other.go +++ b/exporter/debugexporter/internal/otlptext/known_sync_error_other.go @@ -3,7 +3,7 @@ //go:build !linux && !darwin && !windows -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" // knownSyncError returns true if the given error is one of the known // non-actionable errors returned by Sync on Plan 9. diff --git a/exporter/internal/otlptext/known_sync_error_windows.go b/exporter/debugexporter/internal/otlptext/known_sync_error_windows.go similarity index 92% rename from exporter/internal/otlptext/known_sync_error_windows.go rename to exporter/debugexporter/internal/otlptext/known_sync_error_windows.go index b7e0dc472d7..0d5614104d1 100644 --- a/exporter/internal/otlptext/known_sync_error_windows.go +++ b/exporter/debugexporter/internal/otlptext/known_sync_error_windows.go @@ -3,7 +3,7 @@ //go:build windows -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import "golang.org/x/sys/windows" diff --git a/exporter/internal/otlptext/logs.go b/exporter/debugexporter/internal/otlptext/logs.go similarity index 97% rename from exporter/internal/otlptext/logs.go rename to exporter/debugexporter/internal/otlptext/logs.go index 9eb7987130c..399e9f00d39 100644 --- a/exporter/internal/otlptext/logs.go +++ b/exporter/debugexporter/internal/otlptext/logs.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "go.opentelemetry.io/collector/pdata/plog" diff --git a/exporter/internal/otlptext/logs_test.go b/exporter/debugexporter/internal/otlptext/logs_test.go similarity index 100% rename from exporter/internal/otlptext/logs_test.go rename to exporter/debugexporter/internal/otlptext/logs_test.go diff --git a/exporter/internal/otlptext/metrics.go b/exporter/debugexporter/internal/otlptext/metrics.go similarity index 97% rename from exporter/internal/otlptext/metrics.go rename to exporter/debugexporter/internal/otlptext/metrics.go index e63a15624e3..489d70925b5 100644 --- a/exporter/internal/otlptext/metrics.go +++ b/exporter/debugexporter/internal/otlptext/metrics.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import "go.opentelemetry.io/collector/pdata/pmetric" diff --git a/exporter/internal/otlptext/metrics_test.go b/exporter/debugexporter/internal/otlptext/metrics_test.go similarity index 100% rename from exporter/internal/otlptext/metrics_test.go rename to exporter/debugexporter/internal/otlptext/metrics_test.go diff --git a/exporter/internal/otlptext/package_test.go b/exporter/debugexporter/internal/otlptext/package_test.go similarity index 100% rename from exporter/internal/otlptext/package_test.go rename to exporter/debugexporter/internal/otlptext/package_test.go diff --git a/exporter/internal/otlptext/profiles.go b/exporter/debugexporter/internal/otlptext/profiles.go similarity index 98% rename from exporter/internal/otlptext/profiles.go rename to exporter/debugexporter/internal/otlptext/profiles.go index d0d52640ac1..7044709e31e 100644 --- a/exporter/internal/otlptext/profiles.go +++ b/exporter/debugexporter/internal/otlptext/profiles.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "strconv" diff --git a/exporter/internal/otlptext/profiles_test.go b/exporter/debugexporter/internal/otlptext/profiles_test.go similarity index 100% rename from exporter/internal/otlptext/profiles_test.go rename to exporter/debugexporter/internal/otlptext/profiles_test.go diff --git a/exporter/internal/otlptext/sync.go b/exporter/debugexporter/internal/otlptext/sync.go similarity index 94% rename from exporter/internal/otlptext/sync.go rename to exporter/debugexporter/internal/otlptext/sync.go index 2d5dfd387f2..971c873b252 100644 --- a/exporter/internal/otlptext/sync.go +++ b/exporter/debugexporter/internal/otlptext/sync.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "context" diff --git a/exporter/internal/otlptext/testdata/logs/embedded_maps.out b/exporter/debugexporter/internal/otlptext/testdata/logs/embedded_maps.out similarity index 100% rename from exporter/internal/otlptext/testdata/logs/embedded_maps.out rename to exporter/debugexporter/internal/otlptext/testdata/logs/embedded_maps.out diff --git a/exporter/internal/otlptext/testdata/logs/empty.out b/exporter/debugexporter/internal/otlptext/testdata/logs/empty.out similarity index 100% rename from exporter/internal/otlptext/testdata/logs/empty.out rename to exporter/debugexporter/internal/otlptext/testdata/logs/empty.out diff --git a/exporter/internal/otlptext/testdata/logs/one_record.out b/exporter/debugexporter/internal/otlptext/testdata/logs/one_record.out similarity index 100% rename from exporter/internal/otlptext/testdata/logs/one_record.out rename to exporter/debugexporter/internal/otlptext/testdata/logs/one_record.out diff --git a/exporter/internal/otlptext/testdata/logs/two_records.out b/exporter/debugexporter/internal/otlptext/testdata/logs/two_records.out similarity index 100% rename from exporter/internal/otlptext/testdata/logs/two_records.out rename to exporter/debugexporter/internal/otlptext/testdata/logs/two_records.out diff --git a/exporter/internal/otlptext/testdata/metrics/empty.out b/exporter/debugexporter/internal/otlptext/testdata/metrics/empty.out similarity index 100% rename from exporter/internal/otlptext/testdata/metrics/empty.out rename to exporter/debugexporter/internal/otlptext/testdata/metrics/empty.out diff --git a/exporter/internal/otlptext/testdata/metrics/invalid_metric_type.out b/exporter/debugexporter/internal/otlptext/testdata/metrics/invalid_metric_type.out similarity index 100% rename from exporter/internal/otlptext/testdata/metrics/invalid_metric_type.out rename to exporter/debugexporter/internal/otlptext/testdata/metrics/invalid_metric_type.out diff --git a/exporter/internal/otlptext/testdata/metrics/metrics_with_all_types.out b/exporter/debugexporter/internal/otlptext/testdata/metrics/metrics_with_all_types.out similarity index 100% rename from exporter/internal/otlptext/testdata/metrics/metrics_with_all_types.out rename to exporter/debugexporter/internal/otlptext/testdata/metrics/metrics_with_all_types.out diff --git a/exporter/internal/otlptext/testdata/metrics/two_metrics.out b/exporter/debugexporter/internal/otlptext/testdata/metrics/two_metrics.out similarity index 100% rename from exporter/internal/otlptext/testdata/metrics/two_metrics.out rename to exporter/debugexporter/internal/otlptext/testdata/metrics/two_metrics.out diff --git a/exporter/internal/otlptext/testdata/profiles/empty.out b/exporter/debugexporter/internal/otlptext/testdata/profiles/empty.out similarity index 100% rename from exporter/internal/otlptext/testdata/profiles/empty.out rename to exporter/debugexporter/internal/otlptext/testdata/profiles/empty.out diff --git a/exporter/internal/otlptext/testdata/profiles/two_profiles.out b/exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out similarity index 100% rename from exporter/internal/otlptext/testdata/profiles/two_profiles.out rename to exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out diff --git a/exporter/internal/otlptext/testdata/traces/empty.out b/exporter/debugexporter/internal/otlptext/testdata/traces/empty.out similarity index 100% rename from exporter/internal/otlptext/testdata/traces/empty.out rename to exporter/debugexporter/internal/otlptext/testdata/traces/empty.out diff --git a/exporter/internal/otlptext/testdata/traces/two_spans.out b/exporter/debugexporter/internal/otlptext/testdata/traces/two_spans.out similarity index 100% rename from exporter/internal/otlptext/testdata/traces/two_spans.out rename to exporter/debugexporter/internal/otlptext/testdata/traces/two_spans.out diff --git a/exporter/internal/otlptext/traces.go b/exporter/debugexporter/internal/otlptext/traces.go similarity index 98% rename from exporter/internal/otlptext/traces.go rename to exporter/debugexporter/internal/otlptext/traces.go index 5d09a08ebad..90d5c400a4f 100644 --- a/exporter/internal/otlptext/traces.go +++ b/exporter/debugexporter/internal/otlptext/traces.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package otlptext // import "go.opentelemetry.io/collector/exporter/internal/otlptext" +package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext" import ( "go.opentelemetry.io/collector/pdata/ptrace" diff --git a/exporter/internal/otlptext/traces_test.go b/exporter/debugexporter/internal/otlptext/traces_test.go similarity index 100% rename from exporter/internal/otlptext/traces_test.go rename to exporter/debugexporter/internal/otlptext/traces_test.go diff --git a/exporter/go.mod b/exporter/go.mod index a6c917e24e7..94e5f2f0a22 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -27,7 +27,6 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/sys v0.26.0 google.golang.org/grpc v1.67.1 ) @@ -44,6 +43,7 @@ require ( go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/protobuf v1.35.1 // indirect