Skip to content

Commit

Permalink
[component] Remove deprecated DataType (open-telemetry#11253)
Browse files Browse the repository at this point in the history
#### Description

Continues the switch to use `pipeline.ID` and `pipeline.Signal`.
- Removes deprecated code
- Continues rename process for function/type changes.

#### Link to tracking issue
Related to
open-telemetry#9429
  • Loading branch information
TylerHelmuth authored and jackgopack4 committed Oct 8, 2024
1 parent def05cb commit f4c5400
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 95 deletions.
25 changes: 25 additions & 0 deletions .chloggen/pipeline-continue-refactor.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: component

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Removed deprecated `ErrDataTypeIsNotSupported`, `DataType`, `DataTypeTraces`, `DataTypeMetrics`, and `DataTypeLogs`. Use `pipeline.ErrSignalNotSupported`, `pipeline.Signal`, `pipeline.SignalTraces`, `pipeline.SignalMetrics`, and `pipeline.SignalLogs` instead.

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

# (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]
10 changes: 0 additions & 10 deletions component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ package component // import "go.opentelemetry.io/collector/component"

import (
"context"

"go.opentelemetry.io/collector/pipeline"
)

var (
// ErrDataTypeIsNotSupported can be returned by receiver, exporter, processor or connector factory funcs that create the
// Component if the particular telemetry data type is not supported by the receiver, exporter, processor or connector factory.
//
// Deprecated: [v0.110.0] Use pipeline.ErrSignalNotSupported instead
ErrDataTypeIsNotSupported = pipeline.ErrSignalNotSupported
)

// Component is either a receiver, exporter, processor, connector, or an extension.
Expand Down
28 changes: 0 additions & 28 deletions component/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,34 +145,6 @@ func MustNewType(strType string) Type {
return ty
}

// DataType is a special Type that represents the data types supported by the collector. We currently support
// collecting metrics, traces and logs, this can expand in the future.
//
// Deprecated: [v0.110.0] Use pipeline.Signal instead.
type DataType = Type

func mustNewDataType(strType string) DataType {
return MustNewType(strType)
}

// Currently supported data types. Add new data types here when new types are supported in the future.
var (
// DataTypeTraces is the data type tag for traces.
//
// Deprecated: [v0.110.0] Use pipeline.SignalTraces instead.
DataTypeTraces = mustNewDataType("traces")

// DataTypeMetrics is the data type tag for metrics.
//
// Deprecated: [v0.110.0] Use pipeline.SignalMetrics instead.
DataTypeMetrics = mustNewDataType("metrics")

// DataTypeLogs is the data type tag for logs.
//
// Deprecated: [v0.110.0] Use pipeline.SignalLogs instead.
DataTypeLogs = mustNewDataType("logs")
)

// nameRegexp is used to validate the name of a component. A name can consist of
// 1 to 1024 unicode characters excluding whitespace, control characters, and
// symbols.
Expand Down
6 changes: 0 additions & 6 deletions component/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/config/configtelemetry v0.110.0
go.opentelemetry.io/collector/pdata v1.16.0
go.opentelemetry.io/collector/pipeline v0.110.0
go.opentelemetry.io/otel v1.30.0
go.opentelemetry.io/otel/metric v1.30.0
go.opentelemetry.io/otel/sdk v1.30.0
Expand All @@ -24,7 +23,6 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.17.0 // indirect
Expand All @@ -42,7 +40,3 @@ retract (
v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1
v0.69.0 // Release failed, use v0.69.1
)

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../internal/globalsignal
6 changes: 0 additions & 6 deletions config/configauth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
Expand All @@ -41,7 +39,3 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemet
replace go.opentelemetry.io/collector/extension => ../../extension

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

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal
6 changes: 0 additions & 6 deletions config/configgrpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/extension v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.110.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
Expand Down Expand Up @@ -83,7 +81,3 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile
replace go.opentelemetry.io/collector/component => ../../component

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal

replace go.opentelemetry.io/collector/pipeline => ../../pipeline
6 changes: 0 additions & 6 deletions config/confighttp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/extension v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
Expand Down Expand Up @@ -76,7 +74,3 @@ replace go.opentelemetry.io/collector/client => ../../client
replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal

replace go.opentelemetry.io/collector/pipeline => ../../pipeline
6 changes: 0 additions & 6 deletions extension/auth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
Expand All @@ -43,7 +41,3 @@ replace go.opentelemetry.io/collector/extension => ../
replace go.opentelemetry.io/collector/pdata => ../../pdata

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

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal
6 changes: 0 additions & 6 deletions extension/experimental/storage/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ require (
require (
github.com/gogo/protobuf v1.3.2 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
Expand All @@ -33,7 +31,3 @@ replace go.opentelemetry.io/collector/component => ../../../component
replace go.opentelemetry.io/collector/pdata => ../../../pdata

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../../internal/globalsignal

replace go.opentelemetry.io/collector/pipeline => ../../../pipeline
6 changes: 0 additions & 6 deletions extension/extensioncapabilities/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ require (
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
Expand All @@ -43,7 +41,3 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap
replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry

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

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal
6 changes: 0 additions & 6 deletions extension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
Expand All @@ -40,7 +38,3 @@ replace go.opentelemetry.io/collector/component => ../component
replace go.opentelemetry.io/collector/pdata => ../pdata

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

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

replace go.opentelemetry.io/collector/internal/globalsignal => ../internal/globalsignal
2 changes: 0 additions & 2 deletions extension/memorylimiterextension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ require (
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.110.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.110.0 // indirect
go.opentelemetry.io/collector/pdata v1.16.0 // indirect
go.opentelemetry.io/collector/pipeline v0.110.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
Expand Down
14 changes: 7 additions & 7 deletions service/pipelines/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestConfigValidate(t *testing.T) {
var testCases = []struct {
name string // test case name (also file name containing config yaml)
cfgFn func() ConfigWithPipelineID
cfgFn func() Config
expected error
}{
{
Expand All @@ -27,7 +27,7 @@ func TestConfigValidate(t *testing.T) {
},
{
name: "duplicate-processor-reference",
cfgFn: func() ConfigWithPipelineID {
cfgFn: func() Config {
cfg := generateConfig()
pipe := cfg[pipeline.MustNewID("traces")]
pipe.Processors = append(pipe.Processors, pipe.Processors...)
Expand All @@ -37,7 +37,7 @@ func TestConfigValidate(t *testing.T) {
},
{
name: "missing-pipeline-receivers",
cfgFn: func() ConfigWithPipelineID {
cfgFn: func() Config {
cfg := generateConfig()
cfg[pipeline.MustNewID("traces")].Receivers = nil
return cfg
Expand All @@ -46,7 +46,7 @@ func TestConfigValidate(t *testing.T) {
},
{
name: "missing-pipeline-exporters",
cfgFn: func() ConfigWithPipelineID {
cfgFn: func() Config {
cfg := generateConfig()
cfg[pipeline.MustNewID("traces")].Exporters = nil
return cfg
Expand All @@ -55,14 +55,14 @@ func TestConfigValidate(t *testing.T) {
},
{
name: "missing-pipelines",
cfgFn: func() ConfigWithPipelineID {
cfgFn: func() Config {
return nil
},
expected: errMissingServicePipelines,
},
{
name: "invalid-service-pipeline-type",
cfgFn: func() ConfigWithPipelineID {
cfgFn: func() Config {
cfg := generateConfig()
cfg[pipeline.MustNewID("wrongtype")] = &PipelineConfig{
Receivers: []component.ID{component.MustNewID("nop")},
Expand All @@ -83,7 +83,7 @@ func TestConfigValidate(t *testing.T) {
}
}

func generateConfig() ConfigWithPipelineID {
func generateConfig() Config {
return map[pipeline.ID]*PipelineConfig{
pipeline.MustNewID("traces"): {
Receivers: []component.ID{component.MustNewID("nop")},
Expand Down

0 comments on commit f4c5400

Please sign in to comment.