From 13906ace5d600e6974a6eaf68b169c0583d246da Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 8 Sep 2022 10:46:36 -0700 Subject: [PATCH] Move partialsuccess code to internal package (#3146) * Move partialsuccess code to internal package * Fix imports to new pkg --- exporters/otlp/{ => internal}/partialsuccess.go | 2 +- exporters/otlp/{ => internal}/partialsuccess_test.go | 2 +- exporters/otlp/otlptrace/otlptracegrpc/client.go | 6 +++--- exporters/otlp/otlptrace/otlptracehttp/client.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) rename exporters/otlp/{ => internal}/partialsuccess.go (96%) rename exporters/otlp/{ => internal}/partialsuccess_test.go (95%) diff --git a/exporters/otlp/partialsuccess.go b/exporters/otlp/internal/partialsuccess.go similarity index 96% rename from exporters/otlp/partialsuccess.go rename to exporters/otlp/internal/partialsuccess.go index 2652304e95a..7994706ab51 100644 --- a/exporters/otlp/partialsuccess.go +++ b/exporters/otlp/internal/partialsuccess.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp // import "go.opentelemetry.io/otel/exporters/otlp" +package internal // import "go.opentelemetry.io/otel/exporters/otlp/internal" import "fmt" diff --git a/exporters/otlp/partialsuccess_test.go b/exporters/otlp/internal/partialsuccess_test.go similarity index 95% rename from exporters/otlp/partialsuccess_test.go rename to exporters/otlp/internal/partialsuccess_test.go index 1a6a350a2aa..3a7b0f0a6ef 100644 --- a/exporters/otlp/partialsuccess_test.go +++ b/exporters/otlp/internal/partialsuccess_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp // import "go.opentelemetry.io/otel/exporters/otlp" +package internal // import "go.opentelemetry.io/otel/exporters/otlp/internal" import ( "errors" diff --git a/exporters/otlp/otlptrace/otlptracegrpc/client.go b/exporters/otlp/otlptrace/otlptracegrpc/client.go index 4a139fc696e..9d6e1898b14 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/client.go +++ b/exporters/otlp/otlptrace/otlptracegrpc/client.go @@ -27,7 +27,7 @@ import ( "google.golang.org/grpc/status" "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/internal" "go.opentelemetry.io/otel/exporters/otlp/internal/retry" "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" @@ -202,8 +202,8 @@ func (c *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc ResourceSpans: protoSpans, }) if resp != nil && resp.PartialSuccess != nil { - otel.Handle(otlp.PartialSuccessToError( - otlp.TracingPartialSuccess, + otel.Handle(internal.PartialSuccessToError( + internal.TracingPartialSuccess, resp.PartialSuccess.RejectedSpans, resp.PartialSuccess.ErrorMessage, )) diff --git a/exporters/otlp/otlptrace/otlptracehttp/client.go b/exporters/otlp/otlptrace/otlptracehttp/client.go index 59b7e209264..745b6541d42 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/client.go +++ b/exporters/otlp/otlptrace/otlptracehttp/client.go @@ -30,7 +30,7 @@ import ( "google.golang.org/protobuf/proto" "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/internal" "go.opentelemetry.io/otel/exporters/otlp/internal/retry" "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig" @@ -180,8 +180,8 @@ func (d *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc } if respProto.PartialSuccess != nil { - otel.Handle(otlp.PartialSuccessToError( - otlp.TracingPartialSuccess, + otel.Handle(internal.PartialSuccessToError( + internal.TracingPartialSuccess, respProto.PartialSuccess.RejectedSpans, respProto.PartialSuccess.ErrorMessage, ))