Skip to content

Commit

Permalink
Refactor to use pipeline.ID and pipeline.Signal
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth committed Sep 17, 2024
1 parent 6cbe5d6 commit 1225ae3
Show file tree
Hide file tree
Showing 108 changed files with 1,798 additions and 791 deletions.
25 changes: 25 additions & 0 deletions .chloggen/component-refactor-datatype-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: deprecation

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecates `DataTypeProfiles`. Use `SignalProfiles` instead.

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

# (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/component-refactor-datatype-3.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: componentstatus

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecates `NewInstanceID`, `AllPipelineIDs`, and `WithPipelines`. Use `NewInstanceIDWithPipelineIDs`, `AllPipelineIDsWithPipelineIDs`, and `WithPipelineIDs` instead.

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

# (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/component-refactor-datatype-4.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: exporterqueue

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

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

# (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/component-refactor-datatype-5.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: service

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecates `pipelines.Config`. Use `pipelines.ConfigWithPipelineID` instead.

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

# (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/component-refactor-datatype-6.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: connector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecates `TracesRouterAndConsumer`, `NewTracesRouter`, `MetricsRouterAndConsumer`, `NewMetricsRouter`, `LogsRouterAndConsumer`, and `NewLogsRouter`. Use `TracesRouterAndConsumerWithPipelineIDs`, `NewTracesRouterWithPipelineIDs`, `MetricsRouterAndConsumerWithPipelineIDs`, `NewMetricsRouterWithPipelineIDs`, `LogsRouterAndConsumerWithPipelineIDs`, and `NewLogsRouterWithPipelineIDs` instead.

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

# (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/component-refactor-datatype.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: component

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

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

# (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]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ check-contrib:
-replace go.opentelemetry.io/collector/pdata=$(CURDIR)/pdata \
-replace go.opentelemetry.io/collector/pdata/testdata=$(CURDIR)/pdata/testdata \
-replace go.opentelemetry.io/collector/pdata/pprofile=$(CURDIR)/pdata/pprofile \
-replace go.opentelemetry.io/collector/pipeline=$(CURDIR)/pipeline \
-replace go.opentelemetry.io/collector/processor=$(CURDIR)/processor \
-replace go.opentelemetry.io/collector/processor/batchprocessor=$(CURDIR)/processor/batchprocessor \
-replace go.opentelemetry.io/collector/processor/memorylimiterprocessor=$(CURDIR)/processor/memorylimiterprocessor \
Expand Down Expand Up @@ -374,6 +375,7 @@ restore-contrib:
-dropreplace go.opentelemetry.io/collector/pdata \
-dropreplace go.opentelemetry.io/collector/pdata/testdata \
-dropreplace go.opentelemetry.io/collector/pdata/pprofile \
-dropreplace go.opentelemetry.io/collector/pipeline \
-dropreplace go.opentelemetry.io/collector/processor \
-dropreplace go.opentelemetry.io/collector/processor/batchprocessor \
-dropreplace go.opentelemetry.io/collector/processor/memorylimiterprocessor \
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/internal/builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ var (
"/extension/zpagesextension",
"/featuregate",
"/internal/globalgates",
"/pipeline",
"/processor",
"/processor/batchprocessor",
"/processor/memorylimiterprocessor",
Expand Down
1 change: 1 addition & 0 deletions cmd/builder/test/core.builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ replaces:
- go.opentelemetry.io/collector/pdata => ${WORKSPACE_DIR}/pdata
- go.opentelemetry.io/collector/pdata/pprofile => ${WORKSPACE_DIR}/pdata/pprofile
- go.opentelemetry.io/collector/pdata/testdata => ${WORKSPACE_DIR}/pdata/testdata
- go.opentelemetry.io/collector/pipeline => ${WORKSPACE_DIR}/pipeline
- go.opentelemetry.io/collector/processor => ${WORKSPACE_DIR}/processor
- go.opentelemetry.io/collector/processor/processorprofiles => ${WORKSPACE_DIR}/processor/processorprofiles
- go.opentelemetry.io/collector/receiver => ${WORKSPACE_DIR}/receiver
Expand Down
3 changes: 3 additions & 0 deletions cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect
go.opentelemetry.io/collector/pipeline v0.109.0 // indirect
go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
Expand Down Expand Up @@ -86,3 +87,5 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume
replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest

replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles

replace go.opentelemetry.io/collector/pipeline => ../../pipeline
19 changes: 10 additions & 9 deletions cmd/mdatagen/internal/templates/component_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"go.opentelemetry.io/collector/connector/connectortest"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/pipeline"
{{- end }}
{{- if or isExporter isProcessor }}
"go.opentelemetry.io/collector/pdata/pcommon"
Expand Down Expand Up @@ -372,7 +373,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "logs_to_logs",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()})
router := connector.NewLogsRouterWithPipelineIDs(map[pipeline.ID]consumer.Logs{pipeline.NewID(pipeline.SignalLogs): consumertest.NewNop()})
return factory.CreateLogsToLogs(ctx, set, cfg, router)
},
},
Expand All @@ -381,7 +382,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "logs_to_metrics",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()})
router := connector.NewMetricsRouterWithPipelineIDs(map[pipeline.ID]consumer.Metrics{pipeline.NewID(pipeline.SignalMetrics): consumertest.NewNop()})
return factory.CreateLogsToMetrics(ctx, set, cfg, router)
},
},
Expand All @@ -390,7 +391,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "logs_to_traces",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()})
router := connector.NewTracesRouterWithPipelineIDs(map[pipeline.ID]consumer.Traces{pipeline.NewID(pipeline.SignalTraces): consumertest.NewNop()})
return factory.CreateLogsToTraces(ctx, set, cfg, router)
},
},
Expand All @@ -399,7 +400,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "metrics_to_logs",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()})
router := connector.NewLogsRouterWithPipelineIDs(map[pipeline.ID]consumer.Logs{pipeline.NewID(pipeline.SignalLogs): consumertest.NewNop()})
return factory.CreateMetricsToLogs(ctx, set, cfg, router)
},
},
Expand All @@ -408,7 +409,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "metrics_to_metrics",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()})
router := connector.NewMetricsRouterWithPipelineIDs(map[pipeline.ID]consumer.Metrics{pipeline.NewID(pipeline.SignalMetrics): consumertest.NewNop()})
return factory.CreateMetricsToMetrics(ctx, set, cfg, router)
},
},
Expand All @@ -417,7 +418,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "metrics_to_traces",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()})
router := connector.NewTracesRouterWithPipelineIDs(map[pipeline.ID]consumer.Traces{pipeline.NewID(pipeline.SignalTraces): consumertest.NewNop()})
return factory.CreateMetricsToTraces(ctx, set, cfg, router)
},
},
Expand All @@ -426,7 +427,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "traces_to_logs",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()})
router := connector.NewLogsRouterWithPipelineIDs(map[pipeline.ID]consumer.Logs{pipeline.NewID(pipeline.SignalLogs): consumertest.NewNop()})
return factory.CreateTracesToLogs(ctx, set, cfg, router)
},
},
Expand All @@ -435,7 +436,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "traces_to_metrics",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()})
router := connector.NewMetricsRouterWithPipelineIDs(map[pipeline.ID]consumer.Metrics{pipeline.NewID(pipeline.SignalMetrics): consumertest.NewNop()})
return factory.CreateTracesToMetrics(ctx, set, cfg, router)
},
},
Expand All @@ -444,7 +445,7 @@ func TestComponentLifecycle(t *testing.T) {
{
name: "traces_to_traces",
createFn: func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error) {
router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()})
router := connector.NewTracesRouterWithPipelineIDs(map[pipeline.ID]consumer.Traces{pipeline.NewID(pipeline.SignalTraces): consumertest.NewNop()})
return factory.CreateTracesToTraces(ctx, set, cfg, router)
},
},
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcorecol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ replaces:
- go.opentelemetry.io/collector/pdata => ../../pdata
- go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata
- go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile
- go.opentelemetry.io/collector/pipeline => ../../pipeline
- go.opentelemetry.io/collector/processor => ../../processor
- go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor
- go.opentelemetry.io/collector/processor/memorylimiterprocessor => ../../processor/memorylimiterprocessor
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ require (
go.opentelemetry.io/collector/pdata v1.15.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect
go.opentelemetry.io/collector/pdata/testdata v0.109.0 // indirect
go.opentelemetry.io/collector/pipeline v0.109.0 // indirect
go.opentelemetry.io/collector/processor/processorprofiles v0.109.0 // indirect
go.opentelemetry.io/collector/receiver/receiverprofiles v0.109.0 // indirect
go.opentelemetry.io/collector/semconv v0.109.0 // indirect
Expand Down Expand Up @@ -238,6 +239,8 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata

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

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

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

replace go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor
Expand Down
12 changes: 11 additions & 1 deletion component/componentprofiles/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@

package componentprofiles // import "go.opentelemetry.io/collector/component/componentprofiles"

import "go.opentelemetry.io/collector/component"
import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pipeline"
)

// nolint
func mustNewDataType(strType string) component.DataType {
return component.MustNewType(strType)
}

const (
SignalProfiles = pipeline.Signal("profiles")
)

var (
// DataTypeProfiles is the data type tag for profiles.
//
// Deprecated: [v0.110.0] Use SignalProfiles instead
DataTypeProfiles = mustNewDataType("profiles")
)
7 changes: 6 additions & 1 deletion component/componentprofiles/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ module go.opentelemetry.io/collector/component/componentprofiles

go 1.22.0

require go.opentelemetry.io/collector/component v0.109.0
require (
go.opentelemetry.io/collector/component v0.109.0
go.opentelemetry.io/collector/pipeline v0.109.0
)

require (
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -26,3 +29,5 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata
replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry

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

replace go.opentelemetry.io/collector/pipeline => ../../pipeline
3 changes: 3 additions & 0 deletions component/componentstatus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.22.0
require (
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/component v0.109.0
go.opentelemetry.io/collector/pipeline v0.109.0
)

require (
Expand Down Expand Up @@ -32,3 +33,5 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con
replace go.opentelemetry.io/collector/component => ../

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

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

0 comments on commit 1225ae3

Please sign in to comment.