Skip to content

Commit

Permalink
Deprecate the otlp/internal package and all sub-packages (#4421)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MrAlias committed Aug 8, 2023
1 parent 6631519 commit 25a6f15
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
3 changes: 3 additions & 0 deletions exporters/otlp/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
20 changes: 20 additions & 0 deletions exporters/otlp/internal/envconfig/doc.go
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions exporters/otlp/internal/retry/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions exporters/otlp/internal/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/internal/oconf/envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/otlpmetric/internal/oconf/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/internal/oconf/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/internal/otest/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/otlptrace/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 25a6f15

Please sign in to comment.