Skip to content

Commit

Permalink
Deprecate the otlptrace/internal packages (#4425)
Browse files Browse the repository at this point in the history
* Stop generating otlptrace/internal and deprecate

* Remove the tracetransform templates

They are no longer used.

* Add change stub to changelog

* Add PR number to changelog
  • Loading branch information
MrAlias committed Aug 10, 2023
1 parent 10d9038 commit 319cb3a
Show file tree
Hide file tree
Showing 33 changed files with 62 additions and 1,165 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- 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)
- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` package is deprecated. (#4425)
- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig` package is deprecated. (#4425)
- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig` package is deprecated. (#4425)
- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest` package is deprecated. (#4425)
- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry` package is deprecated. (#4425)

## [1.16.0/0.39.0] 2023-05-18

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/resource.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,17 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tracetransform

import (
"go.opentelemetry.io/otel/sdk/resource"
resourcepb "go.opentelemetry.io/proto/otlp/resource/v1"
)

// Resource transforms a Resource into an OTLP Resource.
func Resource(r *resource.Resource) *resourcepb.Resource {
if r == nil {
return nil
}
return &resourcepb.Resource{Attributes: ResourceAttributes(r)}
}
// Package internal contains common functionality for all OTLP trace exporters.
//
// Deprecated: package internal exists for historical compatibility, it should
// not be used.
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal"
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/instrumentation.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,19 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tracetransform

import (
"go.opentelemetry.io/otel/sdk/instrumentation"
commonpb "go.opentelemetry.io/proto/otlp/common/v1"
)

func InstrumentationScope(il instrumentation.Scope) *commonpb.InstrumentationScope {
if il == (instrumentation.Scope{}) {
return nil
}
return &commonpb.InstrumentationScope{
Name: il.Name,
Version: il.Version,
}
}
// Package envconfig contains common functionality for all OTLP trace exporters
// to handle environment variable configuration.
//
// Deprecated: package envconfig exists for historical compatibility, it should
// not be used.
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig"
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/envconfig/envconfig.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/envconfig/envconfig_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/envconfig/envconfig_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
43 changes: 0 additions & 43 deletions exporters/otlp/otlptrace/internal/gen.go

This file was deleted.

3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/header.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/header.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/header_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/header_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
20 changes: 20 additions & 0 deletions exporters/otlp/otlptrace/internal/otlpconfig/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 otlpconfig contains common functionality for configuring all OTLP
// trace exporters.
//
// Deprecated: package otlpconfig exists for historical compatibility, it
// should not be used.
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig"
5 changes: 1 addition & 4 deletions exporters/otlp/otlptrace/internal/otlpconfig/envconfig.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -26,7 +23,7 @@ import (
"strings"
"time"

"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig" // nolint: staticcheck // Atomic deprecation.
)

// DefaultEnvOptionsReader is the default environments reader.
Expand Down
5 changes: 1 addition & 4 deletions exporters/otlp/otlptrace/internal/otlpconfig/options.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -31,7 +28,7 @@ import (
"google.golang.org/grpc/encoding/gzip"

"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry" // nolint: staticcheck // Atomic deprecation.
)

const (
Expand Down
5 changes: 1 addition & 4 deletions exporters/otlp/otlptrace/internal/otlpconfig/options_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -24,7 +21,7 @@ import (

"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig" // nolint: staticcheck // Atomic deprecation.
)

const (
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlpconfig/optiontypes.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlpconfig/tls.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlptracetest/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlptracetest/client.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlptracetest/collector.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlptracetest/collector.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlptracetest/data.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlptracetest/data.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
20 changes: 20 additions & 0 deletions exporters/otlp/otlptrace/internal/otlptracetest/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 otlptracetest contains common functionality for testing all OTLP
// trace exporters.
//
// Deprecated: package otlptracetest exists for historical compatibility, it
// should not be used.
package otlptracetest // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest"
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/otlptracetest/otlptest.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/otlptracetest/otlptest.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/otlptrace/internal/retry/retry.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/retry/retry.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,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/otlptrace/internal/retry"

import (
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/retry/retry_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/retry/retry_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/tracetransform/attribute.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/attribute.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/attribute_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/instrumentation.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/tracetransform/resource.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/resource.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/resource_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/tracetransform/span.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/span.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 0 additions & 3 deletions exporters/otlp/otlptrace/internal/tracetransform/span_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Code created by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/otlptrace/tracetransform/span_test.go.tmpl

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit 319cb3a

Please sign in to comment.