Skip to content

Commit

Permalink
Deprecate extension/experimental in favor of extension/xextension
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Jan 4, 2025
1 parent afdd296 commit 605847d
Show file tree
Hide file tree
Showing 26 changed files with 240 additions and 39 deletions.
25 changes: 25 additions & 0 deletions .chloggen/experimental.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: extension/experimental

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate extension/experimental in favor of extension/xextension

# One or more tracking issues or pull requests related to the change
issues: [12010]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
4 changes: 3 additions & 1 deletion cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ require (
go.opentelemetry.io/collector/exporter/exportertest v0.116.0 // indirect
go.opentelemetry.io/collector/exporter/xexporter v0.116.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/extensioncapabilities v0.116.0 // indirect
go.opentelemetry.io/collector/extension/extensiontest v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/internal/fanoutconsumer v0.116.0 // indirect
go.opentelemetry.io/collector/internal/memorylimiter v0.116.0 // indirect
Expand Down Expand Up @@ -293,3 +293,5 @@ replace go.opentelemetry.io/collector/scraper => ../../scraper
replace go.opentelemetry.io/collector/semconv => ../../semconv

replace go.opentelemetry.io/collector/service => ../../service

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/debugexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
go.opentelemetry.io/collector/consumer/consumertest v0.116.0 // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/pipeline v0.116.0 // indirect
go.opentelemetry.io/collector/pipeline/xpipeline v0.116.0 // indirect
Expand Down Expand Up @@ -119,3 +119,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/exporterhelper/xexporterhelper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/pdata v1.22.0 // indirect
go.opentelemetry.io/collector/pipeline v0.116.0 // indirect
Expand Down Expand Up @@ -106,3 +106,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../../extens
replace go.opentelemetry.io/collector/scraper => ../../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/exportertest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/receiver/xreceiver v0.116.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
Expand Down Expand Up @@ -96,3 +96,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ require (
go.opentelemetry.io/collector/consumer/consumererror v0.116.0
go.opentelemetry.io/collector/consumer/consumertest v0.116.0
go.opentelemetry.io/collector/exporter/exportertest v0.116.0
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0
go.opentelemetry.io/collector/extension/extensiontest v0.116.0
go.opentelemetry.io/collector/extension/xextension v0.116.0
go.opentelemetry.io/collector/featuregate v1.22.0
go.opentelemetry.io/collector/pdata v1.22.0
go.opentelemetry.io/collector/pdata/pprofile v0.116.0
Expand Down Expand Up @@ -101,3 +101,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../extension/ex
replace go.opentelemetry.io/collector/scraper => ../scraper

replace go.opentelemetry.io/collector/featuregate => ../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../extension/xextension
4 changes: 2 additions & 2 deletions exporter/internal/queue/mock_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/extension/experimental/storage"
"go.opentelemetry.io/collector/extension/xextension/storage"
)

type mockStorageExtension struct {
Expand Down Expand Up @@ -65,7 +65,7 @@ func (m *mockStorageClient) Close(context.Context) error {
return nil
}

func (m *mockStorageClient) Batch(_ context.Context, ops ...storage.Operation) error {
func (m *mockStorageClient) Batch(_ context.Context, ops ...*storage.Operation) error {
if m.isClosed() {
panic("client already closed")
}
Expand Down
10 changes: 5 additions & 5 deletions exporter/internal/queue/persistent_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/extension/experimental/storage"
"go.opentelemetry.io/collector/extension/xextension/storage"
"go.opentelemetry.io/collector/pipeline"
)

Expand Down Expand Up @@ -249,7 +249,7 @@ func (pq *persistentQueue[T]) putInternal(ctx context.Context, req T) error {
}

// Carry out a transaction where we both add the item and update the write index
ops := []storage.Operation{
ops := []*storage.Operation{
storage.SetOperation(writeIndexKey, itemIndexToBytes(newIndex)),
storage.SetOperation(itemKey, reqBuf),
}
Expand Down Expand Up @@ -350,7 +350,7 @@ func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (uint64, T, bool)
return index, request, true
}

// Should be called to remove the item of the given index from the queue once processing is finished.
// OnProcessingFinished should be called to remove the item of the given index from the queue once processing is finished.
func (pq *persistentQueue[T]) OnProcessingFinished(index uint64, consumeErr error) {
// Delete the item from the persistent storage after it was processed.
pq.mu.Lock()
Expand Down Expand Up @@ -408,8 +408,8 @@ func (pq *persistentQueue[T]) retrieveAndEnqueueNotDispatchedReqs(ctx context.Co

pq.logger.Info("Fetching items left for dispatch by consumers", zap.Int(zapNumberOfItems,
len(dispatchedItems)))
retrieveBatch := make([]storage.Operation, len(dispatchedItems))
cleanupBatch := make([]storage.Operation, len(dispatchedItems))
retrieveBatch := make([]*storage.Operation, len(dispatchedItems))
cleanupBatch := make([]*storage.Operation, len(dispatchedItems))
for i, it := range dispatchedItems {
key := getItemKey(it)
retrieveBatch[i] = storage.GetOperation(key)
Expand Down
8 changes: 4 additions & 4 deletions exporter/internal/queue/persistent_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter/exportertest"
"go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/extension/experimental/storage"
"go.opentelemetry.io/collector/extension/extensiontest"
"go.opentelemetry.io/collector/extension/xextension/storage"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
"go.opentelemetry.io/collector/pipeline"
Expand Down Expand Up @@ -105,7 +105,7 @@ func (m *fakeBoundedStorageClient) Close(context.Context) error {
return nil
}

func (m *fakeBoundedStorageClient) Batch(_ context.Context, ops ...storage.Operation) error {
func (m *fakeBoundedStorageClient) Batch(_ context.Context, ops ...*storage.Operation) error {
m.mux.Lock()
defer m.mux.Unlock()

Expand Down Expand Up @@ -148,7 +148,7 @@ func (m *fakeBoundedStorageClient) GetSizeInBytes() int {
return m.sizeInBytes
}

func (m *fakeBoundedStorageClient) getTotalSizeChange(ops []storage.Operation) (totalAdded int, totalRemoved int) {
func (m *fakeBoundedStorageClient) getTotalSizeChange(ops []*storage.Operation) (totalAdded int, totalRemoved int) {
totalAdded, totalRemoved = 0, 0
for _, op := range ops {
switch op.Type {
Expand Down Expand Up @@ -206,7 +206,7 @@ func (m *fakeStorageClientWithErrors) Close(context.Context) error {
return nil
}

func (m *fakeStorageClientWithErrors) Batch(context.Context, ...storage.Operation) error {
func (m *fakeStorageClientWithErrors) Batch(context.Context, ...*storage.Operation) error {
m.mux.Lock()
defer m.mux.Unlock()

Expand Down
2 changes: 2 additions & 0 deletions exporter/nopexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/otlpexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ require (
go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/pipeline v0.116.0 // indirect
go.opentelemetry.io/collector/pipeline/xpipeline v0.116.0 // indirect
Expand Down Expand Up @@ -158,3 +158,5 @@ replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
4 changes: 3 additions & 1 deletion exporter/otlphttpexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ require (
go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.116.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.116.0 // indirect
go.opentelemetry.io/collector/extension/xextension v0.116.0 // indirect
go.opentelemetry.io/collector/featuregate v1.22.0 // indirect
go.opentelemetry.io/collector/pipeline v0.116.0 // indirect
go.opentelemetry.io/collector/pipeline/xpipeline v0.116.0 // indirect
Expand Down Expand Up @@ -156,3 +156,5 @@ replace go.opentelemetry.io/collector/extension/auth/authtest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
2 changes: 2 additions & 0 deletions exporter/xexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ replace go.opentelemetry.io/collector/extension/extensiontest => ../../extension
replace go.opentelemetry.io/collector/scraper => ../../scraper

replace go.opentelemetry.io/collector/featuregate => ../../featuregate

replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xextension
40 changes: 40 additions & 0 deletions extension/experimental/storage/alias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Package storage implements an extension that can
// persist state beyond the collector process.
package storage // import "go.opentelemetry.io/collector/extension/experimental/storage"

import (
"go.opentelemetry.io/collector/extension/xextension/storage"
)

// Deprecated: [v0.117.0] use storage.NewNopClient from xextension.
var NewNopClient = storage.NewNopClient

// Deprecated: [v0.117.0] use storage.Client from xextension.
type Client = storage.Client

// Deprecated: [v0.117.0] use storage.Extension from xextension.
type Extension = storage.Extension

// Deprecated: [v0.117.0] use *storage.Operation from xextension.
type Operation = *storage.Operation

// Deprecated: [v0.117.0] use storage.SetOperation from xextension.
var SetOperation = storage.SetOperation

// Deprecated: [v0.117.0] use storage.GetOperation from xextension.
var GetOperation = storage.GetOperation

// Deprecated: [v0.117.0] use storage.DeleteOperation from xextension.
var DeleteOperation = storage.DeleteOperation

const (
// Deprecated: [v0.117.0] use storage.NewNopClient from xextension.
Get storage.OpType = iota
// Deprecated: [v0.117.0] use storage.NewNopClient from xextension.
Set
// Deprecated: [v0.117.0] use storage.NewNopClient from xextension.
Delete
)
9 changes: 5 additions & 4 deletions extension/experimental/storage/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ module go.opentelemetry.io/collector/extension/experimental/storage

go 1.22.0

require (
go.opentelemetry.io/collector/component v0.116.0
go.opentelemetry.io/collector/extension v0.116.0
)
require go.opentelemetry.io/collector/extension/xextension v0.116.0

require (
github.com/gogo/protobuf v1.3.2 // indirect
go.opentelemetry.io/collector/component v0.116.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect
go.opentelemetry.io/collector/extension v0.116.0 // indirect
go.opentelemetry.io/collector/pdata v1.22.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
Expand All @@ -26,6 +25,8 @@ require (

replace go.opentelemetry.io/collector/extension => ../../

replace go.opentelemetry.io/collector/extension/xextension => ../../xextension

replace go.opentelemetry.io/collector/component => ../../../component

replace go.opentelemetry.io/collector/pdata => ../../../pdata
Expand Down
1 change: 1 addition & 0 deletions extension/xextension/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
33 changes: 33 additions & 0 deletions extension/xextension/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module go.opentelemetry.io/collector/extension/xextension

go 1.22.0

require (
go.opentelemetry.io/collector/component v0.116.0
go.opentelemetry.io/collector/extension v0.116.0
)

require (
github.com/gogo/protobuf v1.3.2 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect
go.opentelemetry.io/collector/pdata v1.22.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
)

replace go.opentelemetry.io/collector/extension => ../

replace go.opentelemetry.io/collector/component => ../../component

replace go.opentelemetry.io/collector/pdata => ../../pdata

replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry
Loading

0 comments on commit 605847d

Please sign in to comment.