Skip to content

Commit

Permalink
[exporter] Continue DataType rename in exporter (open-telemetry#11305)
Browse files Browse the repository at this point in the history
#### Description

Continues DataType deprecation/rename in exporter for
`Settings.DataType` and `CheckConsumeContractParams.DataType`.

#### Link to tracking issue
Related to
open-telemetry#9429
  • Loading branch information
TylerHelmuth authored and jackgopack4 committed Oct 8, 2024
1 parent fc2eca9 commit 95822c2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .chloggen/exportertest-continue-deprecations-2.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated `Settings.DataType`. Use `Settings.Signal` instead.

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

# (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]
25 changes: 25 additions & 0 deletions .chloggen/exportertest-continue-deprecations.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated `CheckConsumeContractParams.DataType`. Use `CheckConsumeContractParams.Signal` instead.

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

# (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]
11 changes: 1 addition & 10 deletions exporter/exporterqueue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/internal/globalsignal"
"go.opentelemetry.io/collector/pipeline"
)

Expand All @@ -26,10 +25,6 @@ type Queue[T any] queue.Queue[T]

// Settings defines settings for creating a queue.
type Settings struct {

// Deprecated: [v0.110.0] Use Signal instead
DataType component.DataType // nolint

Signal pipeline.Signal
ExporterSettings exporter.Settings
}
Expand Down Expand Up @@ -80,14 +75,10 @@ func NewPersistentQueueFactory[T itemsCounter](storageID *component.ID, factoryS
return NewMemoryQueueFactory[T]()
}
return func(_ context.Context, set Settings, cfg Config) Queue[T] {
signal := set.Signal
if set.DataType.String() != "" {
signal = globalsignal.MustNewSignal(set.DataType.String())
}
return queue.NewPersistentQueue[T](queue.PersistentQueueSettings[T]{
Sizer: sizerFromConfig[T](cfg),
Capacity: capacityFromConfig(cfg),
Signal: signal,
Signal: set.Signal,
StorageID: *storageID,
Marshaler: factorySettings.Marshaler,
Unmarshaler: factorySettings.Unmarshaler,
Expand Down
8 changes: 1 addition & 7 deletions exporter/exportertest/contract_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ type uniqueIDAttrVal string
type CheckConsumeContractParams struct {
T *testing.T
NumberOfTestElements int
// DataType to test for.
//
// Deprecated: [v0.110.0] Use Signal instead
// nolint
DataType component.DataType

Signal pipeline.Signal
Signal pipeline.Signal
// ExporterFactory to create an exporter to be tested.
ExporterFactory exporter.Factory
ExporterConfig component.Config
Expand Down
2 changes: 1 addition & 1 deletion exporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
go.opentelemetry.io/collector/exporter/exporterprofiles v0.110.0
go.opentelemetry.io/collector/extension v0.110.0
go.opentelemetry.io/collector/extension/experimental/storage v0.110.0
go.opentelemetry.io/collector/internal/globalsignal v0.110.0
go.opentelemetry.io/collector/pdata v1.16.0
go.opentelemetry.io/collector/pdata/pprofile v0.110.0
go.opentelemetry.io/collector/pdata/testdata v0.110.0
Expand Down Expand Up @@ -43,6 +42,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/component/componentprofiles v0.110.0 // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/receiver/receiverprofiles v0.110.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/text v0.17.0 // indirect
Expand Down

0 comments on commit 95822c2

Please sign in to comment.