1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-17 20:57:51 +02:00

Deprecate the otlp/internal package and all sub-packages (#4421)

* Deprecate the otlp/internal package and all sub-packages

* Add deprecation to changelog

* No lint deprecated pkg use in otlpmetric

* Remove the unused header*.go files from otlptrace

* Use template wrappederror in otlptrace

* Add back removed header.go

* Replace use of WrapTracesError with fmt.Errorf

* Revert otlptrace/internal to main

* Deprecate retry module
This commit is contained in:
Tyler Yahn 2023-08-08 07:45:53 -07:00 committed by GitHub
parent 663151966d
commit 25a6f15348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 41 additions and 7 deletions

View File

@ -66,6 +66,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Do not append _total if the counter already ends in total `go.opentelemetry.io/otel/exporter/prometheus`. (#4373)
- Fix resource detection data race in `go.opentelemetry.io/otel/sdk/resource`. (#4409)
### Deprecated
- The `go.opentelemetry.io/otel/exporters/otlp/internal` package is deprecated. (#4421)
- The `go.opentelemetry.io/otel/exporters/otlp/internal/envconfig` package is deprecated. (#4421)
- The `go.opentelemetry.io/otel/exporters/otlp/internal/retry` package is deprecated. (#4421)
## [1.16.0/0.39.0] 2023-05-18
This release contains the first stable release of the OpenTelemetry Go [metric API].

View File

@ -13,6 +13,9 @@
// limitations under the License.
// Package internal contains common functionality for all OTLP exporters.
//
// Deprecated: package internal exists for historical compatibility, it should
// not be used.
package internal // import "go.opentelemetry.io/otel/exporters/otlp/internal"
import (

View File

@ -0,0 +1,20 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package envconfig contains common functionality for all OTLP exporter
// configuration.
//
// Deprecated: package envconfig exists for historical compatibility, it should
// not be used.
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/internal/envconfig"

View File

@ -1,3 +1,5 @@
// Deprecated: package retry exists for historical compatibility, it should not
// be used.
module go.opentelemetry.io/otel/exporters/otlp/internal/retry
go 1.19

View File

@ -15,6 +15,9 @@
// Package retry provides request retry functionality that can perform
// configurable exponential backoff for transient errors and honor any
// explicit throttle responses received.
//
// Deprecated: package retry exists for historical compatibility, it should not
// be used.
package retry // import "go.opentelemetry.io/otel/exporters/otlp/internal/retry"
import (

View File

@ -23,7 +23,7 @@ import (
"strings"
"time"
"go.opentelemetry.io/otel/exporters/otlp/internal/envconfig"
"go.opentelemetry.io/otel/exporters/otlp/internal/envconfig" // nolint: staticcheck // Synchronous deprecation.
"go.opentelemetry.io/otel/internal/global"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/metricdata"

View File

@ -25,8 +25,8 @@ import (
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/encoding/gzip"
"go.opentelemetry.io/otel/exporters/otlp/internal"
"go.opentelemetry.io/otel/exporters/otlp/internal/retry"
"go.opentelemetry.io/otel/exporters/otlp/internal" // nolint: staticcheck // Synchronous deprecation.
"go.opentelemetry.io/otel/exporters/otlp/internal/retry" // nolint: staticcheck // Synchronous deprecation.
ominternal "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal"
"go.opentelemetry.io/otel/internal/global"
"go.opentelemetry.io/otel/sdk/metric"

View File

@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel/exporters/otlp/internal/envconfig"
"go.opentelemetry.io/otel/exporters/otlp/internal/envconfig" // nolint: staticcheck // Synchronous deprecation.
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/oconf"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/aggregation"

View File

@ -19,7 +19,7 @@ import (
"testing"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/otlp/internal"
"go.opentelemetry.io/otel/exporters/otlp/internal" // nolint: staticcheck // Synchronous deprecation.
ominternal "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/aggregation"

View File

@ -17,9 +17,9 @@ package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
import (
"context"
"errors"
"fmt"
"sync"
"go.opentelemetry.io/otel/exporters/otlp/internal"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
)
@ -48,7 +48,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, ss []tracesdk.ReadOnlySpan)
err := e.client.UploadTraces(ctx, protoSpans)
if err != nil {
return internal.WrapTracesError(err)
return fmt.Errorf("traces export: %w", err)
}
return nil
}