From 13293772ab79d895eb3a4c8f44973b35fafc87d3 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 26 Apr 2024 18:32:33 -0700 Subject: [PATCH 01/38] make a new id type with datatype and use it --- component/component.go | 2 +- component/config.go | 58 +++++++++++-- component/identifiable.go | 90 +++++++++++++++++++- connector/logs_router.go | 12 +-- connector/logs_router_test.go | 22 ++--- connector/metrics_router.go | 6 +- connector/metrics_router_test.go | 23 ++--- connector/router.go | 12 +-- connector/traces_router.go | 6 +- connector/traces_router_test.go | 22 ++--- exporter/exporterhelper/queue_sender_test.go | 32 +++++++ service/internal/components/loggers.go | 2 +- service/internal/graph/graph.go | 30 +++---- service/internal/graph/nodes.go | 18 ++-- service/pipelines/config.go | 2 +- 15 files changed, 249 insertions(+), 88 deletions(-) diff --git a/component/component.go b/component/component.go index c7f6408680a..9f6eba1f145 100644 --- a/component/component.go +++ b/component/component.go @@ -192,5 +192,5 @@ func (f CreateDefaultConfigFunc) CreateDefaultConfig() Config { type InstanceID struct { ID ID Kind Kind - PipelineIDs map[ID]struct{} + PipelineIDs map[DataTypeID]struct{} } diff --git a/component/config.go b/component/config.go index 49cc7f5219f..ab1df052670 100644 --- a/component/config.go +++ b/component/config.go @@ -109,7 +109,14 @@ func callValidateIfPossible(v reflect.Value) error { return nil } +//type SignalOrComponentType interface { +// String() string +// MarshalText() ([]byte, error) +//} + // Type is the component type as it is used in the config. +// Examples of a Type include the names of receivers (otlp, filelog, etc), +// processors (batch, memory_limit, etc), or exporters (debug, rabbitmq) type Type struct { name string } @@ -160,20 +167,53 @@ func MustNewType(strType string) Type { // 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. -type DataType = Type - -func mustNewDataType(strType string) DataType { - return MustNewType(strType) -} +type DataType string // Currently supported data types. Add new data types here when new types are supported in the future. -var ( +const ( // DataTypeTraces is the data type tag for traces. - DataTypeTraces = mustNewDataType("traces") + DataTypeTraces DataType = "traces" // DataTypeMetrics is the data type tag for metrics. - DataTypeMetrics = mustNewDataType("metrics") + DataTypeMetrics DataType = "metrics" // DataTypeLogs is the data type tag for logs. - DataTypeLogs = mustNewDataType("logs") + DataTypeLogs DataType = "logs" ) + +func (dt DataType) String() string { + return string(dt) +} + +func (dt DataType) MarshalText() (text []byte, err error) { + return []byte(dt), nil +} + +func NewDataType(ty string) (DataType, error) { + if len(ty) == 0 { + return "", fmt.Errorf("id must not be empty") + } + switch ty { + case "metrics": + return DataTypeMetrics, nil + case "logs": + return DataTypeLogs, nil + case "traces": + return DataTypeTraces, nil + default: + return "", fmt.Errorf("invalid data type %s", ty) + } +} + +// MustNewType creates a type. It panics if the type is invalid. +// A type must +// - have at least one character, +// - start with an ASCII alphabetic character and +// - can only contain ASCII alphanumeric characters and '_'. +func MustNewDataType(strType string) DataType { + ty, err := NewDataType(strType) + if err != nil { + panic(err) + } + return ty +} diff --git a/component/identifiable.go b/component/identifiable.go index d2d65a5e24f..38f24724576 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -14,7 +14,8 @@ const typeAndNameSeparator = "/" // ID represents the identity for a component. It combines two values: // * type - the Type of the component. -// * name - the name of that component. +// * name - the name of that component. This can be an empty string. +// Components are defined in configuration by type[/name] - for examples [traces/1] or [oltp/blah] // The component ID (combination type + name) is unique for a given component.Kind. type ID struct { typeVal Type `mapstructure:"-"` @@ -101,3 +102,90 @@ func (id ID) String() string { return id.typeVal.String() + typeAndNameSeparator + id.nameVal } + +type DataTypeID struct { + typeVal DataType `mapstructure:"-"` + nameVal string `mapstructure:"-"` +} + +// Type returns the type of the component. +func (id DataTypeID) Type() DataType { + return id.typeVal +} + +// Name returns the custom name of the component. +func (id DataTypeID) Name() string { + return id.nameVal +} + +// NewID returns a new ID with the given Type and empty name. +func NewDataTypeID(typeVal DataType) DataTypeID { + return DataTypeID{typeVal: typeVal} +} + +// MustNewID builds a Type and returns a new ID with the given Type and empty name. +// See MustNewType to check the valid values of typeVal. +func MustNewDataTypeID(typeVal string) DataTypeID { + return DataTypeID{typeVal: MustNewDataType(typeVal)} +} + +// NewIDWithName returns a new ID with the given Type and name. +func NewDataTypeIDWithName(typeVal DataType, nameVal string) DataTypeID { + return DataTypeID{typeVal: typeVal, nameVal: nameVal} +} + +// MustNewIDWithName builds a Type and returns a new ID with the given Type and name. +// See MustNewType to check the valid values of typeVal. +func MustNewDataTypeIDWithName(typeVal string, nameVal string) DataTypeID { + return DataTypeID{typeVal: MustNewDataType(typeVal), nameVal: nameVal} +} + +// MarshalText implements the encoding.TextMarshaler interface. +// This marshals the type and name as one string in the config. +func (id DataTypeID) MarshalText() (text []byte, err error) { + return []byte(id.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (id *DataTypeID) UnmarshalText(text []byte) error { + idStr := string(text) + items := strings.SplitN(idStr, typeAndNameSeparator, 2) + var typeStr, nameStr string + if len(items) >= 1 { + typeStr = strings.TrimSpace(items[0]) + } + + if len(items) == 1 && typeStr == "" { + return errors.New("id must not be empty") + } + + if typeStr == "" { + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) + } + + if len(items) > 1 { + // "name" part is present. + nameStr = strings.TrimSpace(items[1]) + if nameStr == "" { + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) + } + } + + var err error + + if id.typeVal, err = NewDataType(typeStr); err != nil { + return fmt.Errorf("in %q id: %w", idStr, err) + } + id.nameVal = nameStr + + return nil +} + +// String returns the ID string representation as "type[/name]" format. +func (id DataTypeID) String() string { + if id.nameVal == "" { + return id.typeVal.String() + } + + return id.typeVal.String() + typeAndNameSeparator + id.nameVal +} diff --git a/connector/logs_router.go b/connector/logs_router.go index 0db9ea7799d..b24ab87f96e 100644 --- a/connector/logs_router.go +++ b/connector/logs_router.go @@ -16,8 +16,8 @@ import ( // LogsRouterAndConsumer feeds the first consumer.Logs in each of the specified pipelines. type LogsRouterAndConsumer interface { consumer.Logs - Consumer(...component.ID) (consumer.Logs, error) - PipelineIDs() []component.ID + Consumer(...component.DataTypeID) (consumer.Logs, error) + PipelineIDs() []component.DataTypeID privateFunc() } @@ -26,7 +26,7 @@ type logsRouter struct { baseRouter[consumer.Logs] } -func NewLogsRouter(cm map[component.ID]consumer.Logs) LogsRouterAndConsumer { +func NewLogsRouter(cm map[component.DataTypeID]consumer.Logs) LogsRouterAndConsumer { consumers := make([]consumer.Logs, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) @@ -37,15 +37,15 @@ func NewLogsRouter(cm map[component.ID]consumer.Logs) LogsRouterAndConsumer { } } -func (r *logsRouter) PipelineIDs() []component.ID { - ids := make([]component.ID, 0, len(r.consumers)) +func (r *logsRouter) PipelineIDs() []component.DataTypeID { + ids := make([]component.DataTypeID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *logsRouter) Consumer(pipelineIDs ...component.ID) (consumer.Logs, error) { +func (r *logsRouter) Consumer(pipelineIDs ...component.DataTypeID) (consumer.Logs, error) { if len(pipelineIDs) == 0 { return nil, fmt.Errorf("missing consumers") } diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index a4074762ac1..06e62c11a54 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -42,13 +42,13 @@ func TestLogsRouterMultiplexing(t *testing.T) { func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.ID, 0, numCons) + allIDs := make([]component.DataTypeID, 0, numCons) allCons := make([]consumer.Logs, 0, numCons) - allConsMap := make(map[component.ID]consumer.Logs) + allConsMap := make(map[component.DataTypeID]consumer.Logs) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.MustNewDataTypeIDWithName("metrics", strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numLogs+i)%4 == 0 { allCons = append(allCons, &mutatingLogsSink{LogsSink: new(consumertest.LogsSink)}) @@ -63,11 +63,11 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteLogs. - expected := make(map[component.ID]int, numCons) + expected := make(map[component.DataTypeID]int, numCons) for i := 0; i < numLogs; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.ID]bool, numIDs) + randCons := make(map[component.DataTypeID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +75,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.ID, 0, len(randCons)) + conIDs := make([]component.DataTypeID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -108,16 +108,16 @@ func TestLogsRouterConsumers(t *testing.T) { ctx := context.Background() ld := testdata.GenerateLogs(1) - fooID := component.MustNewID("foo") - barID := component.MustNewID("bar") + fooID := component.MustNewDataTypeID("logs") + barID := component.MustNewDataTypeID("metrics") foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) - r := NewLogsRouter(map[component.ID]consumer.Logs{fooID: foo, barID: bar}) + r := NewLogsRouter(map[component.DataTypeID]consumer.Logs{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) assert.Len(t, foo.AllLogs(), 0) assert.Len(t, bar.AllLogs(), 0) @@ -150,7 +150,7 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewID("fake")) + fake, err := r.Consumer(component.MustNewDataTypeID("traces")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/metrics_router.go b/connector/metrics_router.go index 3e688261bfe..a0c14c61a15 100644 --- a/connector/metrics_router.go +++ b/connector/metrics_router.go @@ -12,8 +12,8 @@ import ( // MetricsRouterAndConsumer feeds the first consumer.Metrics in each of the specified pipelines. type MetricsRouterAndConsumer interface { consumer.Metrics - Consumer(...component.ID) (consumer.Metrics, error) - PipelineIDs() []component.ID + Consumer(...component.DataTypeID) (consumer.Metrics, error) + PipelineIDs() []component.DataTypeID privateFunc() } @@ -22,7 +22,7 @@ type metricsRouter struct { baseRouter[consumer.Metrics] } -func NewMetricsRouter(cm map[component.ID]consumer.Metrics) MetricsRouterAndConsumer { +func NewMetricsRouter(cm map[component.DataTypeID]consumer.Metrics) MetricsRouterAndConsumer { consumers := make([]consumer.Metrics, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index c3fe824992a..b6127e88255 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -31,6 +31,7 @@ func TestMetricsRouterMultiplexing(t *testing.T) { for numIDs := 1; numIDs < max; numIDs++ { for numCons := 1; numCons < max; numCons++ { for numMetrics := 1; numMetrics < max; numMetrics++ { + t.Run( fmt.Sprintf("%d-ids/%d-cons/%d-logs", numIDs, numCons, numMetrics), fuzzMetrics(numIDs, numCons, numMetrics), @@ -42,13 +43,13 @@ func TestMetricsRouterMultiplexing(t *testing.T) { func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.ID, 0, numCons) + allIDs := make([]component.DataTypeID, 0, numCons) allCons := make([]consumer.Metrics, 0, numCons) - allConsMap := make(map[component.ID]consumer.Metrics) + allConsMap := make(map[component.DataTypeID]consumer.Metrics) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.MustNewDataTypeIDWithName("metrics", strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numMetrics+i)%4 == 0 { allCons = append(allCons, &mutatingMetricsSink{MetricsSink: new(consumertest.MetricsSink)}) @@ -63,11 +64,11 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteMetrics. - expected := make(map[component.ID]int, numCons) + expected := make(map[component.DataTypeID]int, numCons) for i := 0; i < numMetrics; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.ID]bool, numIDs) + randCons := make(map[component.DataTypeID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +76,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.ID, 0, len(randCons)) + conIDs := make([]component.DataTypeID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -108,16 +109,16 @@ func TestMetricsRouterConsumers(t *testing.T) { ctx := context.Background() md := testdata.GenerateMetrics(1) - fooID := component.MustNewID("foo") - barID := component.MustNewID("bar") + fooID := component.MustNewDataTypeID("metrics") + barID := component.MustNewDataTypeID("traces") foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) - r := NewMetricsRouter(map[component.ID]consumer.Metrics{fooID: foo, barID: bar}) + r := NewMetricsRouter(map[component.DataTypeID]consumer.Metrics{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) assert.Len(t, foo.AllMetrics(), 0) assert.Len(t, bar.AllMetrics(), 0) @@ -150,7 +151,7 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewID("fake")) + fake, err := r.Consumer(component.MustNewDataTypeID("logs")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/router.go b/connector/router.go index bba7ee76bba..b92fab3d825 100644 --- a/connector/router.go +++ b/connector/router.go @@ -13,26 +13,26 @@ import ( type baseRouter[T any] struct { fanout func([]T) T - consumers map[component.ID]T + consumers map[component.DataTypeID]T } -func newBaseRouter[T any](fanout func([]T) T, cm map[component.ID]T) baseRouter[T] { - consumers := make(map[component.ID]T, len(cm)) +func newBaseRouter[T any](fanout func([]T) T, cm map[component.DataTypeID]T) baseRouter[T] { + consumers := make(map[component.DataTypeID]T, len(cm)) for k, v := range cm { consumers[k] = v } return baseRouter[T]{fanout: fanout, consumers: consumers} } -func (r *baseRouter[T]) PipelineIDs() []component.ID { - ids := make([]component.ID, 0, len(r.consumers)) +func (r *baseRouter[T]) PipelineIDs() []component.DataTypeID { + ids := make([]component.DataTypeID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *baseRouter[T]) Consumer(pipelineIDs ...component.ID) (T, error) { +func (r *baseRouter[T]) Consumer(pipelineIDs ...component.DataTypeID) (T, error) { var ret T if len(pipelineIDs) == 0 { return ret, fmt.Errorf("missing consumers") diff --git a/connector/traces_router.go b/connector/traces_router.go index 84eb889c05a..c1f5e3e9a7f 100644 --- a/connector/traces_router.go +++ b/connector/traces_router.go @@ -12,8 +12,8 @@ import ( // TracesRouterAndConsumer feeds the first consumer.Traces in each of the specified pipelines. type TracesRouterAndConsumer interface { consumer.Traces - Consumer(...component.ID) (consumer.Traces, error) - PipelineIDs() []component.ID + Consumer(...component.DataTypeID) (consumer.Traces, error) + PipelineIDs() []component.DataTypeID privateFunc() } @@ -22,7 +22,7 @@ type tracesRouter struct { baseRouter[consumer.Traces] } -func NewTracesRouter(cm map[component.ID]consumer.Traces) TracesRouterAndConsumer { +func NewTracesRouter(cm map[component.DataTypeID]consumer.Traces) TracesRouterAndConsumer { consumers := make([]consumer.Traces, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 8c93b10528a..adb9ca6aa4b 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -42,13 +42,13 @@ func TestTracesRouterMultiplexing(t *testing.T) { func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.ID, 0, numCons) + allIDs := make([]component.DataTypeID, 0, numCons) allCons := make([]consumer.Traces, 0, numCons) - allConsMap := make(map[component.ID]consumer.Traces) + allConsMap := make(map[component.DataTypeID]consumer.Traces) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewIDWithName("sink", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.MustNewDataTypeIDWithName("traces", strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numTraces+i)%4 == 0 { allCons = append(allCons, &mutatingTracesSink{TracesSink: new(consumertest.TracesSink)}) @@ -63,11 +63,11 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteTraces. - expected := make(map[component.ID]int, numCons) + expected := make(map[component.DataTypeID]int, numCons) for i := 0; i < numTraces; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.ID]bool, numIDs) + randCons := make(map[component.DataTypeID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +75,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.ID, 0, len(randCons)) + conIDs := make([]component.DataTypeID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -108,16 +108,16 @@ func TestTracesRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateTraces(1) - fooID := component.MustNewID("foo") - barID := component.MustNewID("bar") + fooID := component.MustNewDataTypeID("metrics") + barID := component.MustNewDataTypeID("logs") foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) - r := NewTracesRouter(map[component.ID]consumer.Traces{fooID: foo, barID: bar}) + r := NewTracesRouter(map[component.DataTypeID]consumer.Traces{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.ID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) assert.Len(t, foo.AllTraces(), 0) assert.Len(t, bar.AllTraces(), 0) @@ -150,7 +150,7 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewID("fake")) + fake, err := r.Consumer(component.MustNewDataTypeID("traces")) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/exporter/exporterhelper/queue_sender_test.go b/exporter/exporterhelper/queue_sender_test.go index 4775938eb55..b3c12819284 100644 --- a/exporter/exporterhelper/queue_sender_test.go +++ b/exporter/exporterhelper/queue_sender_test.go @@ -61,7 +61,11 @@ func TestQueuedRetry_DoNotPreserveCancellation(t *testing.T) { qCfg := NewDefaultQueueSettings() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() +<<<<<<< HEAD be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, +======= + be, err := newBaseExporter(defaultSettings, component.DataTypeMetrics, newObservabilityConsumerSender, +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -93,7 +97,11 @@ func TestQueuedRetry_RejectOnFull(t *testing.T) { set := exportertest.NewNopCreateSettings() logger, observed := observer.New(zap.ErrorLevel) set.Logger = zap.New(logger) +<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newNoopObsrepSender, +======= + be, err := newBaseExporter(set, component.DataTypeMetrics, newNoopObsrepSender, +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithQueue(qCfg)) require.NoError(t, err) @@ -166,7 +174,11 @@ func TestQueuedRetryHappyPath(t *testing.T) { t.Cleanup(func() { require.NoError(t, tel.Shutdown(context.Background())) }) set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tel.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} +<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, tt.queueOptions...) +======= + be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, tt.queueOptions...) +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) require.NoError(t, err) ocs := be.obsrepSender.(*observabilityConsumerSender) @@ -209,7 +221,11 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) { qCfg.NumConsumers = 0 // to make every request go straight to the queue rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} +<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, +======= + be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -338,7 +354,11 @@ func TestQueuedRetryPersistenceEnabled(t *testing.T) { qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} +<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, +======= + be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -364,7 +384,11 @@ func TestQueuedRetryPersistenceEnabledStorageError(t *testing.T) { qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} +<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler), +======= + be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler), +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -388,7 +412,11 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { rCfg.MaxElapsedTime = 0 // retry infinitely so shutdown can be triggered mockReq := newErrorRequest() +<<<<<<< HEAD be, err := newBaseExporter(defaultSettings, defaultDataType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), +======= + be, err := newBaseExporter(defaultSettings, component.DataTypeMetrics, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(mockReq)), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -412,7 +440,11 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { // start the exporter again replacing the preserved mockRequest in the unmarshaler with a new one that doesn't fail. replacedReq := newMockRequest(1, nil) +<<<<<<< HEAD be, err = newBaseExporter(defaultSettings, defaultDataType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), +======= + be, err = newBaseExporter(defaultSettings, component.DataTypeMetrics, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), +>>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(replacedReq)), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NoError(t, be.Start(context.Background(), host)) diff --git a/service/internal/components/loggers.go b/service/internal/components/loggers.go index f4178977b2d..ea2849f9170 100644 --- a/service/internal/components/loggers.go +++ b/service/internal/components/loggers.go @@ -28,7 +28,7 @@ func ReceiverLogger(logger *zap.Logger, id component.ID, dt component.DataType) zap.String(zapDataTypeKey, dt.String())) } -func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID component.ID) *zap.Logger { +func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID component.DataTypeID) *zap.Logger { return logger.With( zap.String(zapKindKey, strings.ToLower(component.KindProcessor.String())), zap.String(zapNameKey, id.String()), diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index 525c269a6de..a03f6428b10 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -36,7 +36,7 @@ type Settings struct { ExporterBuilder *exporter.Builder ConnectorBuilder *connector.Builder - // PipelineConfigs is a map of component.ID to PipelineConfig. + // PipelineConfigs is a map of component.DataTypeID to PipelineConfig. PipelineConfigs pipelines.Config } @@ -45,7 +45,7 @@ type Graph struct { componentGraph *simple.DirectedGraph // Keep track of how nodes relate to pipelines, so we can declare edges in the graph. - pipelines map[component.ID]*pipelineNodes + pipelines map[component.DataTypeID]*pipelineNodes // Keep track of status source per node instanceIDs map[int64]*component.InstanceID @@ -58,7 +58,7 @@ type Graph struct { func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), - pipelines: make(map[component.ID]*pipelineNodes, len(set.PipelineConfigs)), + pipelines: make(map[component.DataTypeID]*pipelineNodes, len(set.PipelineConfigs)), instanceIDs: make(map[int64]*component.InstanceID), telemetry: set.Telemetry, } @@ -81,9 +81,9 @@ func (g *Graph) createNodes(set Settings) error { // Build a list of all connectors for easy reference. connectors := make(map[component.ID]struct{}) - // Keep track of connectors and where they are used. (map[connectorID][]pipelineID). - connectorsAsExporter := make(map[component.ID][]component.ID) - connectorsAsReceiver := make(map[component.ID][]component.ID) + // Keep track of connectors and where they are used. (map[connectorID][]pipelineID) + connectorsAsExporter := make(map[component.ID][]component.DataTypeID) + connectorsAsReceiver := make(map[component.ID][]component.DataTypeID) // Build each pipelineNodes struct for each pipeline by parsing the pipelineCfg. // Also populates the connectors, connectorsAsExporter and connectorsAsReceiver maps. @@ -181,7 +181,7 @@ func (g *Graph) createNodes(set Settings) error { return nil } -func (g *Graph) createReceiver(pipelineID, recvID component.ID) *receiverNode { +func (g *Graph) createReceiver(pipelineID component.DataTypeID, recvID component.ID) *receiverNode { rcvrNode := newReceiverNode(pipelineID.Type(), recvID) if node := g.componentGraph.Node(rcvrNode.ID()); node != nil { g.instanceIDs[node.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -191,27 +191,27 @@ func (g *Graph) createReceiver(pipelineID, recvID component.ID) *receiverNode { g.instanceIDs[rcvrNode.ID()] = &component.InstanceID{ ID: recvID, Kind: component.KindReceiver, - PipelineIDs: map[component.ID]struct{}{ + PipelineIDs: map[component.DataTypeID]struct{}{ pipelineID: {}, }, } return rcvrNode } -func (g *Graph) createProcessor(pipelineID, procID component.ID) *processorNode { +func (g *Graph) createProcessor(pipelineID component.DataTypeID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) g.instanceIDs[procNode.ID()] = &component.InstanceID{ ID: procID, Kind: component.KindProcessor, - PipelineIDs: map[component.ID]struct{}{ + PipelineIDs: map[component.DataTypeID]struct{}{ pipelineID: {}, }, } return procNode } -func (g *Graph) createExporter(pipelineID, exprID component.ID) *exporterNode { +func (g *Graph) createExporter(pipelineID component.DataTypeID, exprID component.ID) *exporterNode { expNode := newExporterNode(pipelineID.Type(), exprID) if node := g.componentGraph.Node(expNode.ID()); node != nil { g.instanceIDs[expNode.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -221,14 +221,14 @@ func (g *Graph) createExporter(pipelineID, exprID component.ID) *exporterNode { g.instanceIDs[expNode.ID()] = &component.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, - PipelineIDs: map[component.ID]struct{}{ + PipelineIDs: map[component.DataTypeID]struct{}{ pipelineID: {}, }, } return expNode } -func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID, connID component.ID) *connectorNode { +func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.DataTypeID, connID component.ID) *connectorNode { connNode := newConnectorNode(exprPipelineID.Type(), rcvrPipelineID.Type(), connID) if node := g.componentGraph.Node(connNode.ID()); node != nil { instanceID := g.instanceIDs[connNode.ID()] @@ -240,7 +240,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID, connID component g.instanceIDs[connNode.ID()] = &component.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, - PipelineIDs: map[component.ID]struct{}{ + PipelineIDs: map[component.DataTypeID]struct{}{ exprPipelineID: {}, rcvrPipelineID: {}, }, @@ -528,7 +528,7 @@ func cycleErr(err error, cycles [][]graph.Node) error { return fmt.Errorf("cycle detected: %s", strings.Join(componentDetails, " -> ")) } -func connectorStability(f connector.Factory, expType, recType component.Type) component.StabilityLevel { +func connectorStability(f connector.Factory, expType, recType component.DataType) component.StabilityLevel { switch expType { case component.DataTypeTraces: switch recType { diff --git a/service/internal/graph/nodes.go b/service/internal/graph/nodes.go index 13726d1c760..6f9a26a2f40 100644 --- a/service/internal/graph/nodes.go +++ b/service/internal/graph/nodes.go @@ -111,11 +111,11 @@ var _ consumerNode = &processorNode{} type processorNode struct { nodeID componentID component.ID - pipelineID component.ID + pipelineID component.DataTypeID component.Component } -func newProcessorNode(pipelineID, procID component.ID) *processorNode { +func newProcessorNode(pipelineID component.DataTypeID, procID component.ID) *processorNode { return &processorNode{ nodeID: newNodeID(processorSeed, pipelineID.String(), procID.String()), componentID: procID, @@ -239,7 +239,7 @@ func (n *connectorNode) buildComponent( switch n.rcvrPipelineType { case component.DataTypeTraces: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.ID]consumer.Traces, len(nexts)) + consumers := make(map[component.DataTypeID]consumer.Traces, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Traces) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -275,7 +275,7 @@ func (n *connectorNode) buildComponent( case component.DataTypeMetrics: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.ID]consumer.Metrics, len(nexts)) + consumers := make(map[component.DataTypeID]consumer.Metrics, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Metrics) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -310,7 +310,7 @@ func (n *connectorNode) buildComponent( } case component.DataTypeLogs: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.ID]consumer.Logs, len(nexts)) + consumers := make(map[component.DataTypeID]consumer.Logs, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Logs) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -356,14 +356,14 @@ var _ consumerNode = &capabilitiesNode{} // The nodeID is derived from "pipeline ID". type capabilitiesNode struct { nodeID - pipelineID component.ID + pipelineID component.DataTypeID baseConsumer consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc } -func newCapabilitiesNode(pipelineID component.ID) *capabilitiesNode { +func newCapabilitiesNode(pipelineID component.DataTypeID) *capabilitiesNode { return &capabilitiesNode{ nodeID: newNodeID(capabilitiesSeed, pipelineID.String()), pipelineID: pipelineID, @@ -380,11 +380,11 @@ var _ consumerNode = &fanOutNode{} // Therefore, nodeID is derived from "pipeline ID". type fanOutNode struct { nodeID - pipelineID component.ID + pipelineID component.DataTypeID baseConsumer } -func newFanOutNode(pipelineID component.ID) *fanOutNode { +func newFanOutNode(pipelineID component.DataTypeID) *fanOutNode { return &fanOutNode{ nodeID: newNodeID(fanOutToExporters, pipelineID.String()), pipelineID: pipelineID, diff --git a/service/pipelines/config.go b/service/pipelines/config.go index ed8c77a31c0..836b3200c29 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -17,7 +17,7 @@ var ( ) // Config defines the configurable settings for service telemetry. -type Config map[component.ID]*PipelineConfig +type Config map[component.DataTypeID]*PipelineConfig func (cfg Config) Validate() error { // Must have at least one pipeline. From 4a0e0faff5e40c3f84c087d1a2238fafba1e3ca1 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 08:44:10 -0700 Subject: [PATCH 02/38] PipelineID --- component/component.go | 2 +- component/identifiable.go | 28 +++++++++++++------------- connector/logs_router.go | 12 +++++------ connector/logs_router_test.go | 14 ++++++------- connector/metrics_router.go | 6 +++--- connector/metrics_router_test.go | 14 ++++++------- connector/router.go | 12 +++++------ connector/traces_router.go | 6 +++--- connector/traces_router_test.go | 14 ++++++------- service/internal/components/loggers.go | 2 +- service/internal/graph/graph.go | 26 ++++++++++++------------ service/internal/graph/nodes.go | 18 ++++++++--------- service/pipelines/config.go | 2 +- 13 files changed, 78 insertions(+), 78 deletions(-) diff --git a/component/component.go b/component/component.go index 9f6eba1f145..75b21e0c26c 100644 --- a/component/component.go +++ b/component/component.go @@ -192,5 +192,5 @@ func (f CreateDefaultConfigFunc) CreateDefaultConfig() Config { type InstanceID struct { ID ID Kind Kind - PipelineIDs map[DataTypeID]struct{} + PipelineIDs map[PipelineID]struct{} } diff --git a/component/identifiable.go b/component/identifiable.go index 38f24724576..443237b3aa9 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -103,51 +103,51 @@ func (id ID) String() string { return id.typeVal.String() + typeAndNameSeparator + id.nameVal } -type DataTypeID struct { +type PipelineID struct { typeVal DataType `mapstructure:"-"` nameVal string `mapstructure:"-"` } // Type returns the type of the component. -func (id DataTypeID) Type() DataType { +func (id PipelineID) Type() DataType { return id.typeVal } // Name returns the custom name of the component. -func (id DataTypeID) Name() string { +func (id PipelineID) Name() string { return id.nameVal } // NewID returns a new ID with the given Type and empty name. -func NewDataTypeID(typeVal DataType) DataTypeID { - return DataTypeID{typeVal: typeVal} +func NewDataTypeID(typeVal DataType) PipelineID { + return PipelineID{typeVal: typeVal} } // MustNewID builds a Type and returns a new ID with the given Type and empty name. // See MustNewType to check the valid values of typeVal. -func MustNewDataTypeID(typeVal string) DataTypeID { - return DataTypeID{typeVal: MustNewDataType(typeVal)} +func MustNewDataTypeID(typeVal string) PipelineID { + return PipelineID{typeVal: MustNewDataType(typeVal)} } // NewIDWithName returns a new ID with the given Type and name. -func NewDataTypeIDWithName(typeVal DataType, nameVal string) DataTypeID { - return DataTypeID{typeVal: typeVal, nameVal: nameVal} +func NewDataTypeIDWithName(typeVal DataType, nameVal string) PipelineID { + return PipelineID{typeVal: typeVal, nameVal: nameVal} } // MustNewIDWithName builds a Type and returns a new ID with the given Type and name. // See MustNewType to check the valid values of typeVal. -func MustNewDataTypeIDWithName(typeVal string, nameVal string) DataTypeID { - return DataTypeID{typeVal: MustNewDataType(typeVal), nameVal: nameVal} +func MustNewDataTypeIDWithName(typeVal string, nameVal string) PipelineID { + return PipelineID{typeVal: MustNewDataType(typeVal), nameVal: nameVal} } // MarshalText implements the encoding.TextMarshaler interface. // This marshals the type and name as one string in the config. -func (id DataTypeID) MarshalText() (text []byte, err error) { +func (id PipelineID) MarshalText() (text []byte, err error) { return []byte(id.String()), nil } // UnmarshalText implements the encoding.TextUnmarshaler interface. -func (id *DataTypeID) UnmarshalText(text []byte) error { +func (id *PipelineID) UnmarshalText(text []byte) error { idStr := string(text) items := strings.SplitN(idStr, typeAndNameSeparator, 2) var typeStr, nameStr string @@ -182,7 +182,7 @@ func (id *DataTypeID) UnmarshalText(text []byte) error { } // String returns the ID string representation as "type[/name]" format. -func (id DataTypeID) String() string { +func (id PipelineID) String() string { if id.nameVal == "" { return id.typeVal.String() } diff --git a/connector/logs_router.go b/connector/logs_router.go index b24ab87f96e..0d2b31f0e13 100644 --- a/connector/logs_router.go +++ b/connector/logs_router.go @@ -16,8 +16,8 @@ import ( // LogsRouterAndConsumer feeds the first consumer.Logs in each of the specified pipelines. type LogsRouterAndConsumer interface { consumer.Logs - Consumer(...component.DataTypeID) (consumer.Logs, error) - PipelineIDs() []component.DataTypeID + Consumer(...component.PipelineID) (consumer.Logs, error) + PipelineIDs() []component.PipelineID privateFunc() } @@ -26,7 +26,7 @@ type logsRouter struct { baseRouter[consumer.Logs] } -func NewLogsRouter(cm map[component.DataTypeID]consumer.Logs) LogsRouterAndConsumer { +func NewLogsRouter(cm map[component.PipelineID]consumer.Logs) LogsRouterAndConsumer { consumers := make([]consumer.Logs, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) @@ -37,15 +37,15 @@ func NewLogsRouter(cm map[component.DataTypeID]consumer.Logs) LogsRouterAndConsu } } -func (r *logsRouter) PipelineIDs() []component.DataTypeID { - ids := make([]component.DataTypeID, 0, len(r.consumers)) +func (r *logsRouter) PipelineIDs() []component.PipelineID { + ids := make([]component.PipelineID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *logsRouter) Consumer(pipelineIDs ...component.DataTypeID) (consumer.Logs, error) { +func (r *logsRouter) Consumer(pipelineIDs ...component.PipelineID) (consumer.Logs, error) { if len(pipelineIDs) == 0 { return nil, fmt.Errorf("missing consumers") } diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index 06e62c11a54..8037a544ff3 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -42,9 +42,9 @@ func TestLogsRouterMultiplexing(t *testing.T) { func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.DataTypeID, 0, numCons) + allIDs := make([]component.PipelineID, 0, numCons) allCons := make([]consumer.Logs, 0, numCons) - allConsMap := make(map[component.DataTypeID]consumer.Logs) + allConsMap := make(map[component.PipelineID]consumer.Logs) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -63,11 +63,11 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteLogs. - expected := make(map[component.DataTypeID]int, numCons) + expected := make(map[component.PipelineID]int, numCons) for i := 0; i < numLogs; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.DataTypeID]bool, numIDs) + randCons := make(map[component.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +75,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.DataTypeID, 0, len(randCons)) + conIDs := make([]component.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -113,11 +113,11 @@ func TestLogsRouterConsumers(t *testing.T) { foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) - r := NewLogsRouter(map[component.DataTypeID]consumer.Logs{fooID: foo, barID: bar}) + r := NewLogsRouter(map[component.PipelineID]consumer.Logs{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllLogs(), 0) assert.Len(t, bar.AllLogs(), 0) diff --git a/connector/metrics_router.go b/connector/metrics_router.go index a0c14c61a15..d7d972ae6cb 100644 --- a/connector/metrics_router.go +++ b/connector/metrics_router.go @@ -12,8 +12,8 @@ import ( // MetricsRouterAndConsumer feeds the first consumer.Metrics in each of the specified pipelines. type MetricsRouterAndConsumer interface { consumer.Metrics - Consumer(...component.DataTypeID) (consumer.Metrics, error) - PipelineIDs() []component.DataTypeID + Consumer(...component.PipelineID) (consumer.Metrics, error) + PipelineIDs() []component.PipelineID privateFunc() } @@ -22,7 +22,7 @@ type metricsRouter struct { baseRouter[consumer.Metrics] } -func NewMetricsRouter(cm map[component.DataTypeID]consumer.Metrics) MetricsRouterAndConsumer { +func NewMetricsRouter(cm map[component.PipelineID]consumer.Metrics) MetricsRouterAndConsumer { consumers := make([]consumer.Metrics, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index b6127e88255..288abbfd2ee 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -43,9 +43,9 @@ func TestMetricsRouterMultiplexing(t *testing.T) { func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.DataTypeID, 0, numCons) + allIDs := make([]component.PipelineID, 0, numCons) allCons := make([]consumer.Metrics, 0, numCons) - allConsMap := make(map[component.DataTypeID]consumer.Metrics) + allConsMap := make(map[component.PipelineID]consumer.Metrics) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -64,11 +64,11 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteMetrics. - expected := make(map[component.DataTypeID]int, numCons) + expected := make(map[component.PipelineID]int, numCons) for i := 0; i < numMetrics; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.DataTypeID]bool, numIDs) + randCons := make(map[component.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -76,7 +76,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.DataTypeID, 0, len(randCons)) + conIDs := make([]component.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -114,11 +114,11 @@ func TestMetricsRouterConsumers(t *testing.T) { foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) - r := NewMetricsRouter(map[component.DataTypeID]consumer.Metrics{fooID: foo, barID: bar}) + r := NewMetricsRouter(map[component.PipelineID]consumer.Metrics{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllMetrics(), 0) assert.Len(t, bar.AllMetrics(), 0) diff --git a/connector/router.go b/connector/router.go index b92fab3d825..65b873fae53 100644 --- a/connector/router.go +++ b/connector/router.go @@ -13,26 +13,26 @@ import ( type baseRouter[T any] struct { fanout func([]T) T - consumers map[component.DataTypeID]T + consumers map[component.PipelineID]T } -func newBaseRouter[T any](fanout func([]T) T, cm map[component.DataTypeID]T) baseRouter[T] { - consumers := make(map[component.DataTypeID]T, len(cm)) +func newBaseRouter[T any](fanout func([]T) T, cm map[component.PipelineID]T) baseRouter[T] { + consumers := make(map[component.PipelineID]T, len(cm)) for k, v := range cm { consumers[k] = v } return baseRouter[T]{fanout: fanout, consumers: consumers} } -func (r *baseRouter[T]) PipelineIDs() []component.DataTypeID { - ids := make([]component.DataTypeID, 0, len(r.consumers)) +func (r *baseRouter[T]) PipelineIDs() []component.PipelineID { + ids := make([]component.PipelineID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *baseRouter[T]) Consumer(pipelineIDs ...component.DataTypeID) (T, error) { +func (r *baseRouter[T]) Consumer(pipelineIDs ...component.PipelineID) (T, error) { var ret T if len(pipelineIDs) == 0 { return ret, fmt.Errorf("missing consumers") diff --git a/connector/traces_router.go b/connector/traces_router.go index c1f5e3e9a7f..65749f54d15 100644 --- a/connector/traces_router.go +++ b/connector/traces_router.go @@ -12,8 +12,8 @@ import ( // TracesRouterAndConsumer feeds the first consumer.Traces in each of the specified pipelines. type TracesRouterAndConsumer interface { consumer.Traces - Consumer(...component.DataTypeID) (consumer.Traces, error) - PipelineIDs() []component.DataTypeID + Consumer(...component.PipelineID) (consumer.Traces, error) + PipelineIDs() []component.PipelineID privateFunc() } @@ -22,7 +22,7 @@ type tracesRouter struct { baseRouter[consumer.Traces] } -func NewTracesRouter(cm map[component.DataTypeID]consumer.Traces) TracesRouterAndConsumer { +func NewTracesRouter(cm map[component.PipelineID]consumer.Traces) TracesRouterAndConsumer { consumers := make([]consumer.Traces, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index adb9ca6aa4b..11aa142de47 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -42,9 +42,9 @@ func TestTracesRouterMultiplexing(t *testing.T) { func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.DataTypeID, 0, numCons) + allIDs := make([]component.PipelineID, 0, numCons) allCons := make([]consumer.Traces, 0, numCons) - allConsMap := make(map[component.DataTypeID]consumer.Traces) + allConsMap := make(map[component.PipelineID]consumer.Traces) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -63,11 +63,11 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteTraces. - expected := make(map[component.DataTypeID]int, numCons) + expected := make(map[component.PipelineID]int, numCons) for i := 0; i < numTraces; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.DataTypeID]bool, numIDs) + randCons := make(map[component.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +75,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.DataTypeID, 0, len(randCons)) + conIDs := make([]component.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -113,11 +113,11 @@ func TestTracesRouterConsumer(t *testing.T) { foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) - r := NewTracesRouter(map[component.DataTypeID]consumer.Traces{fooID: foo, barID: bar}) + r := NewTracesRouter(map[component.PipelineID]consumer.Traces{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.DataTypeID{fooID, barID}, rcs) + assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllTraces(), 0) assert.Len(t, bar.AllTraces(), 0) diff --git a/service/internal/components/loggers.go b/service/internal/components/loggers.go index ea2849f9170..7a3b17992c6 100644 --- a/service/internal/components/loggers.go +++ b/service/internal/components/loggers.go @@ -28,7 +28,7 @@ func ReceiverLogger(logger *zap.Logger, id component.ID, dt component.DataType) zap.String(zapDataTypeKey, dt.String())) } -func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID component.DataTypeID) *zap.Logger { +func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID component.PipelineID) *zap.Logger { return logger.With( zap.String(zapKindKey, strings.ToLower(component.KindProcessor.String())), zap.String(zapNameKey, id.String()), diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index a03f6428b10..788fa2ec2e4 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -36,7 +36,7 @@ type Settings struct { ExporterBuilder *exporter.Builder ConnectorBuilder *connector.Builder - // PipelineConfigs is a map of component.DataTypeID to PipelineConfig. + // PipelineConfigs is a map of component.PipelineID to PipelineConfig. PipelineConfigs pipelines.Config } @@ -45,7 +45,7 @@ type Graph struct { componentGraph *simple.DirectedGraph // Keep track of how nodes relate to pipelines, so we can declare edges in the graph. - pipelines map[component.DataTypeID]*pipelineNodes + pipelines map[component.PipelineID]*pipelineNodes // Keep track of status source per node instanceIDs map[int64]*component.InstanceID @@ -58,7 +58,7 @@ type Graph struct { func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), - pipelines: make(map[component.DataTypeID]*pipelineNodes, len(set.PipelineConfigs)), + pipelines: make(map[component.PipelineID]*pipelineNodes, len(set.PipelineConfigs)), instanceIDs: make(map[int64]*component.InstanceID), telemetry: set.Telemetry, } @@ -82,8 +82,8 @@ func (g *Graph) createNodes(set Settings) error { connectors := make(map[component.ID]struct{}) // Keep track of connectors and where they are used. (map[connectorID][]pipelineID) - connectorsAsExporter := make(map[component.ID][]component.DataTypeID) - connectorsAsReceiver := make(map[component.ID][]component.DataTypeID) + connectorsAsExporter := make(map[component.ID][]component.PipelineID) + connectorsAsReceiver := make(map[component.ID][]component.PipelineID) // Build each pipelineNodes struct for each pipeline by parsing the pipelineCfg. // Also populates the connectors, connectorsAsExporter and connectorsAsReceiver maps. @@ -181,7 +181,7 @@ func (g *Graph) createNodes(set Settings) error { return nil } -func (g *Graph) createReceiver(pipelineID component.DataTypeID, recvID component.ID) *receiverNode { +func (g *Graph) createReceiver(pipelineID component.PipelineID, recvID component.ID) *receiverNode { rcvrNode := newReceiverNode(pipelineID.Type(), recvID) if node := g.componentGraph.Node(rcvrNode.ID()); node != nil { g.instanceIDs[node.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -191,27 +191,27 @@ func (g *Graph) createReceiver(pipelineID component.DataTypeID, recvID component g.instanceIDs[rcvrNode.ID()] = &component.InstanceID{ ID: recvID, Kind: component.KindReceiver, - PipelineIDs: map[component.DataTypeID]struct{}{ + PipelineIDs: map[component.PipelineID]struct{}{ pipelineID: {}, }, } return rcvrNode } -func (g *Graph) createProcessor(pipelineID component.DataTypeID, procID component.ID) *processorNode { +func (g *Graph) createProcessor(pipelineID component.PipelineID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) g.instanceIDs[procNode.ID()] = &component.InstanceID{ ID: procID, Kind: component.KindProcessor, - PipelineIDs: map[component.DataTypeID]struct{}{ + PipelineIDs: map[component.PipelineID]struct{}{ pipelineID: {}, }, } return procNode } -func (g *Graph) createExporter(pipelineID component.DataTypeID, exprID component.ID) *exporterNode { +func (g *Graph) createExporter(pipelineID component.PipelineID, exprID component.ID) *exporterNode { expNode := newExporterNode(pipelineID.Type(), exprID) if node := g.componentGraph.Node(expNode.ID()); node != nil { g.instanceIDs[expNode.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -221,14 +221,14 @@ func (g *Graph) createExporter(pipelineID component.DataTypeID, exprID component g.instanceIDs[expNode.ID()] = &component.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, - PipelineIDs: map[component.DataTypeID]struct{}{ + PipelineIDs: map[component.PipelineID]struct{}{ pipelineID: {}, }, } return expNode } -func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.DataTypeID, connID component.ID) *connectorNode { +func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.PipelineID, connID component.ID) *connectorNode { connNode := newConnectorNode(exprPipelineID.Type(), rcvrPipelineID.Type(), connID) if node := g.componentGraph.Node(connNode.ID()); node != nil { instanceID := g.instanceIDs[connNode.ID()] @@ -240,7 +240,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.DataTyp g.instanceIDs[connNode.ID()] = &component.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, - PipelineIDs: map[component.DataTypeID]struct{}{ + PipelineIDs: map[component.PipelineID]struct{}{ exprPipelineID: {}, rcvrPipelineID: {}, }, diff --git a/service/internal/graph/nodes.go b/service/internal/graph/nodes.go index 6f9a26a2f40..7597a19403f 100644 --- a/service/internal/graph/nodes.go +++ b/service/internal/graph/nodes.go @@ -111,11 +111,11 @@ var _ consumerNode = &processorNode{} type processorNode struct { nodeID componentID component.ID - pipelineID component.DataTypeID + pipelineID component.PipelineID component.Component } -func newProcessorNode(pipelineID component.DataTypeID, procID component.ID) *processorNode { +func newProcessorNode(pipelineID component.PipelineID, procID component.ID) *processorNode { return &processorNode{ nodeID: newNodeID(processorSeed, pipelineID.String(), procID.String()), componentID: procID, @@ -239,7 +239,7 @@ func (n *connectorNode) buildComponent( switch n.rcvrPipelineType { case component.DataTypeTraces: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.DataTypeID]consumer.Traces, len(nexts)) + consumers := make(map[component.PipelineID]consumer.Traces, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Traces) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -275,7 +275,7 @@ func (n *connectorNode) buildComponent( case component.DataTypeMetrics: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.DataTypeID]consumer.Metrics, len(nexts)) + consumers := make(map[component.PipelineID]consumer.Metrics, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Metrics) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -310,7 +310,7 @@ func (n *connectorNode) buildComponent( } case component.DataTypeLogs: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.DataTypeID]consumer.Logs, len(nexts)) + consumers := make(map[component.PipelineID]consumer.Logs, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Logs) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -356,14 +356,14 @@ var _ consumerNode = &capabilitiesNode{} // The nodeID is derived from "pipeline ID". type capabilitiesNode struct { nodeID - pipelineID component.DataTypeID + pipelineID component.PipelineID baseConsumer consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc } -func newCapabilitiesNode(pipelineID component.DataTypeID) *capabilitiesNode { +func newCapabilitiesNode(pipelineID component.PipelineID) *capabilitiesNode { return &capabilitiesNode{ nodeID: newNodeID(capabilitiesSeed, pipelineID.String()), pipelineID: pipelineID, @@ -380,11 +380,11 @@ var _ consumerNode = &fanOutNode{} // Therefore, nodeID is derived from "pipeline ID". type fanOutNode struct { nodeID - pipelineID component.DataTypeID + pipelineID component.PipelineID baseConsumer } -func newFanOutNode(pipelineID component.DataTypeID) *fanOutNode { +func newFanOutNode(pipelineID component.PipelineID) *fanOutNode { return &fanOutNode{ nodeID: newNodeID(fanOutToExporters, pipelineID.String()), pipelineID: pipelineID, diff --git a/service/pipelines/config.go b/service/pipelines/config.go index 836b3200c29..3beb9714305 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -17,7 +17,7 @@ var ( ) // Config defines the configurable settings for service telemetry. -type Config map[component.DataTypeID]*PipelineConfig +type Config map[component.PipelineID]*PipelineConfig func (cfg Config) Validate() error { // Must have at least one pipeline. From d782e7d3e8ab782c9af83f30184ef10f03880508 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:16:59 -0700 Subject: [PATCH 03/38] prune methods --- component/identifiable.go | 16 ++-------------- connector/logs_router_test.go | 8 ++++---- connector/metrics_router_test.go | 8 ++++---- connector/traces_router_test.go | 8 ++++---- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/component/identifiable.go b/component/identifiable.go index 443237b3aa9..dba3e967169 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -119,27 +119,15 @@ func (id PipelineID) Name() string { } // NewID returns a new ID with the given Type and empty name. -func NewDataTypeID(typeVal DataType) PipelineID { +func NewPipelineID(typeVal DataType) PipelineID { return PipelineID{typeVal: typeVal} } -// MustNewID builds a Type and returns a new ID with the given Type and empty name. -// See MustNewType to check the valid values of typeVal. -func MustNewDataTypeID(typeVal string) PipelineID { - return PipelineID{typeVal: MustNewDataType(typeVal)} -} - // NewIDWithName returns a new ID with the given Type and name. -func NewDataTypeIDWithName(typeVal DataType, nameVal string) PipelineID { +func NewPipelineIDWithName(typeVal DataType, nameVal string) PipelineID { return PipelineID{typeVal: typeVal, nameVal: nameVal} } -// MustNewIDWithName builds a Type and returns a new ID with the given Type and name. -// See MustNewType to check the valid values of typeVal. -func MustNewDataTypeIDWithName(typeVal string, nameVal string) PipelineID { - return PipelineID{typeVal: MustNewDataType(typeVal), nameVal: nameVal} -} - // MarshalText implements the encoding.TextMarshaler interface. // This marshals the type and name as one string in the config. func (id PipelineID) MarshalText() (text []byte, err error) { diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index 8037a544ff3..aa30685ab5f 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -48,7 +48,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewDataTypeIDWithName("metrics", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numLogs+i)%4 == 0 { allCons = append(allCons, &mutatingLogsSink{LogsSink: new(consumertest.LogsSink)}) @@ -108,8 +108,8 @@ func TestLogsRouterConsumers(t *testing.T) { ctx := context.Background() ld := testdata.GenerateLogs(1) - fooID := component.MustNewDataTypeID("logs") - barID := component.MustNewDataTypeID("metrics") + fooID := component.NewPipelineID(component.DataTypeLogs) + barID := component.NewPipelineID(component.DataTypeMetrics) foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) @@ -150,7 +150,7 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewDataTypeID("traces")) + fake, err := r.Consumer(component.NewPipelineID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index 288abbfd2ee..36316c000c6 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -49,7 +49,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewDataTypeIDWithName("metrics", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numMetrics+i)%4 == 0 { allCons = append(allCons, &mutatingMetricsSink{MetricsSink: new(consumertest.MetricsSink)}) @@ -109,8 +109,8 @@ func TestMetricsRouterConsumers(t *testing.T) { ctx := context.Background() md := testdata.GenerateMetrics(1) - fooID := component.MustNewDataTypeID("metrics") - barID := component.MustNewDataTypeID("traces") + fooID := component.NewPipelineID(component.DataTypeMetrics) + barID := component.NewPipelineID(component.DataTypeTraces) foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) @@ -151,7 +151,7 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewDataTypeID("logs")) + fake, err := r.Consumer(component.NewPipelineID(component.DataTypeLogs)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 11aa142de47..2e117ad35e2 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -48,7 +48,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.MustNewDataTypeIDWithName("traces", strconv.Itoa(numCons))) + allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeTraces, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numTraces+i)%4 == 0 { allCons = append(allCons, &mutatingTracesSink{TracesSink: new(consumertest.TracesSink)}) @@ -108,8 +108,8 @@ func TestTracesRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateTraces(1) - fooID := component.MustNewDataTypeID("metrics") - barID := component.MustNewDataTypeID("logs") + fooID := component.NewPipelineID(component.DataTypeMetrics) + barID := component.NewPipelineID(component.DataTypeLogs) foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) @@ -150,7 +150,7 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.MustNewDataTypeID("traces")) + fake, err := r.Consumer(component.NewPipelineID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } From aa519a7a20367b79dcae7648131d1f59021851f5 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:17:58 -0700 Subject: [PATCH 04/38] methods --- component/identifiable.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/identifiable.go b/component/identifiable.go index dba3e967169..246f577f3bd 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -118,12 +118,12 @@ func (id PipelineID) Name() string { return id.nameVal } -// NewID returns a new ID with the given Type and empty name. +// NewPipelineID returns a new PipelineID with the given DataType and empty name. func NewPipelineID(typeVal DataType) PipelineID { return PipelineID{typeVal: typeVal} } -// NewIDWithName returns a new ID with the given Type and name. +// NewPipelineIDWithName returns a new PipelineID with the given DataType and name. func NewPipelineIDWithName(typeVal DataType, nameVal string) PipelineID { return PipelineID{typeVal: typeVal, nameVal: nameVal} } From 1904b6d6e51eebc84b322a253da1bc3f5d214e0b Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:21:35 -0700 Subject: [PATCH 05/38] remove unecessary constructor --- component/config.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/component/config.go b/component/config.go index ab1df052670..9505a2899ed 100644 --- a/component/config.go +++ b/component/config.go @@ -204,16 +204,3 @@ func NewDataType(ty string) (DataType, error) { return "", fmt.Errorf("invalid data type %s", ty) } } - -// MustNewType creates a type. It panics if the type is invalid. -// A type must -// - have at least one character, -// - start with an ASCII alphabetic character and -// - can only contain ASCII alphanumeric characters and '_'. -func MustNewDataType(strType string) DataType { - ty, err := NewDataType(strType) - if err != nil { - panic(err) - } - return ty -} From f80c5ec05c8824f6ad3d98e46dc906d1f3aef625 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:22:25 -0700 Subject: [PATCH 06/38] delete comment --- component/config.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/component/config.go b/component/config.go index 9505a2899ed..2244b68774c 100644 --- a/component/config.go +++ b/component/config.go @@ -109,11 +109,6 @@ func callValidateIfPossible(v reflect.Value) error { return nil } -//type SignalOrComponentType interface { -// String() string -// MarshalText() ([]byte, error) -//} - // Type is the component type as it is used in the config. // Examples of a Type include the names of receivers (otlp, filelog, etc), // processors (batch, memory_limit, etc), or exporters (debug, rabbitmq) From 91bf4f09f0129080937de6d1184d85053ce0ca74 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:35:03 -0700 Subject: [PATCH 07/38] mass replace id constructors --- otelcol/config_test.go | 16 +- otelcol/otelcoltest/config_test.go | 2 +- service/config_test.go | 4 +- service/internal/graph/graph_test.go | 302 +++++++++--------- .../internal/testcomponents/example_router.go | 4 +- service/pipelines/config_test.go | 8 +- service/service_test.go | 8 +- 7 files changed, 172 insertions(+), 172 deletions(-) diff --git a/otelcol/config_test.go b/otelcol/config_test.go index c1677c07220..04cd083481c 100644 --- a/otelcol/config_test.go +++ b/otelcol/config_test.go @@ -98,7 +98,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-receiver-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -108,7 +108,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -118,7 +118,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-exporter-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -185,7 +185,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Receivers[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -198,7 +198,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Exporters[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -209,7 +209,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -219,7 +219,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.MustNewID("traces")] + pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -280,7 +280,7 @@ func generateConfig() *Config { }, Extensions: []component.ID{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/otelcol/otelcoltest/config_test.go b/otelcol/otelcoltest/config_test.go index 71502de536e..e720b66d73c 100644 --- a/otelcol/otelcoltest/config_test.go +++ b/otelcol/otelcoltest/config_test.go @@ -55,7 +55,7 @@ func TestLoadConfig(t *testing.T) { Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - cfg.Service.Pipelines[component.MustNewID("traces")], + cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)], "Did not load pipeline config correctly") } diff --git a/service/config_test.go b/service/config_test.go index 6ac9d6e625a..9bac4b9e366 100644 --- a/service/config_test.go +++ b/service/config_test.go @@ -42,7 +42,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Pipelines[component.MustNewID("traces")] + pipe := cfg.Pipelines[component.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -101,7 +101,7 @@ func generateConfig() *Config { }, Extensions: extensions.Config{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index eddd3098153..2eca99e2901 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -229,17 +229,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -250,17 +250,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_mutate.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -271,17 +271,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_multi_proc.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -292,15 +292,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_no_proc.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -310,17 +310,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, @@ -331,15 +331,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi_no_proc.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, @@ -349,30 +349,30 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "multi_pipeline_receivers_and_exporters.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("traces", "1"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("metrics", "1"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("logs", "1"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -382,12 +382,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_traces.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -398,12 +398,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -414,12 +414,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_logs.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -430,22 +430,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_traces.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("traces", "type0"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("traces", "type1"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -456,22 +456,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("metrics", "type0"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("metrics", "type1"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -482,22 +482,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_logs.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("logs", "type0"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("logs", "type1"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -508,17 +508,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_traces.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -529,17 +529,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -550,17 +550,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_logs.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -571,32 +571,32 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_matrix.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -607,27 +607,27 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_lanes.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -637,22 +637,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_traces.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("traces", "out0"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("traces", "middle"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.MustNewIDWithName("traces", "out1"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -663,22 +663,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("metrics", "out0"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("metrics", "middle"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.MustNewIDWithName("metrics", "out1"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -689,22 +689,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_logs.yaml", pipelineConfigs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.MustNewIDWithName("logs", "out0"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.MustNewIDWithName("logs", "middle"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.MustNewIDWithName("logs", "out1"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -770,7 +770,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { assert.NoError(t, pg.StartAll(context.Background(), componenttest.NewNopHost())) - mutatingPipelines := make(map[component.ID]bool, len(test.pipelineConfigs)) + mutatingPipelines := make(map[component.PipelineID]bool, len(test.pipelineConfigs)) // Check each pipeline individually, ensuring that all components are started // and that they have observed no signals yet. @@ -991,17 +991,17 @@ func TestConnectorRouter(t *testing.T) { expRightID := component.MustNewIDWithName("exampleexporter", "right") expLeftID := component.MustNewIDWithName("exampleexporter", "left") - tracesInID := component.MustNewIDWithName("traces", "in") - tracesRightID := component.MustNewIDWithName("traces", "right") - tracesLeftID := component.MustNewIDWithName("traces", "left") + tracesInID := component.NewPipelineIDWithName(component.DataTypeTraces, "in") + tracesRightID := component.NewPipelineIDWithName(component.DataTypeTraces, "right") + tracesLeftID := component.NewPipelineIDWithName(component.DataTypeTraces, "left") - metricsInID := component.MustNewIDWithName("metrics", "in") - metricsRightID := component.MustNewIDWithName("metrics", "right") - metricsLeftID := component.MustNewIDWithName("metrics", "left") + metricsInID := component.NewPipelineIDWithName(component.DataTypeMetrics, "in") + metricsRightID := component.NewPipelineIDWithName(component.DataTypeMetrics, "right") + metricsLeftID := component.NewPipelineIDWithName(component.DataTypeMetrics, "left") - logsInID := component.MustNewIDWithName("logs", "in") - logsRightID := component.MustNewIDWithName("logs", "right") - logsLeftID := component.MustNewIDWithName("logs", "left") + logsInID := component.NewPipelineIDWithName(component.DataTypeLogs, "in") + logsRightID := component.NewPipelineIDWithName(component.DataTypeLogs, "right") + logsLeftID := component.NewPipelineIDWithName(component.DataTypeLogs, "left") ctx := context.Background() set := Settings{ @@ -1194,7 +1194,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1210,7 +1210,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1226,7 +1226,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1245,7 +1245,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1265,7 +1265,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1285,7 +1285,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1302,7 +1302,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1318,7 +1318,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1334,7 +1334,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1353,11 +1353,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1376,11 +1376,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1399,11 +1399,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1422,11 +1422,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1445,11 +1445,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1468,11 +1468,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1491,11 +1491,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1514,11 +1514,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1537,11 +1537,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1560,7 +1560,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, @@ -1579,7 +1579,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1598,15 +1598,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, @@ -1625,15 +1625,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1655,7 +1655,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1681,7 +1681,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1707,7 +1707,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1735,22 +1735,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("traces", "1"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.MustNewIDWithName("traces", "2"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1780,22 +1780,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("metrics", "in"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("metrics", "1"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.MustNewIDWithName("metrics", "2"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("metrics", "out"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1825,22 +1825,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("logs", "in"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("logs", "1"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.MustNewIDWithName("logs", "2"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.MustNewIDWithName("logs", "out"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1871,37 +1871,37 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "rawlog"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, }, - component.MustNewIDWithName("traces", "copy1"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "copy1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - component.MustNewIDWithName("traces", "copy2"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "copy2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, }, - component.MustNewIDWithName("traces", "copy2a"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "copy2a"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - component.MustNewIDWithName("traces", "copy2b"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "copy2b"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, }, - component.MustNewIDWithName("metrics", "count"): { + component.NewPipelineIDWithName(component.DataTypeMetrics, "count"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "count")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.MustNewIDWithName("logs", "raw"): { + component.NewPipelineIDWithName(component.DataTypeLogs, "raw"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, // cannot loop back to "nop/fork" @@ -1925,7 +1925,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, }, @@ -1941,7 +1941,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, @@ -1960,7 +1960,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1980,7 +1980,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1997,7 +1997,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2013,7 +2013,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2032,11 +2032,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.MustNewIDWithName("traces", "in"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, - component.MustNewIDWithName("traces", "out"): { + component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2389,7 +2389,7 @@ func (g *Graph) getReceivers() map[component.DataType]map[component.ID]component // However, within an individual pipeline, we expect: // - E instances of the connector as a receiver. // - R instances of the connector as an exporter. -func expectedInstances(m pipelines.Config, pID component.ID) (int, int) { +func expectedInstances(m pipelines.Config, pID component.PipelineID) (int, int) { exConnectorType := component.MustNewType("exampleconnector") var r, e int for _, rID := range m[pID].Receivers { diff --git a/service/internal/testcomponents/example_router.go b/service/internal/testcomponents/example_router.go index 3eafbf13cb6..b4c67aef1ca 100644 --- a/service/internal/testcomponents/example_router.go +++ b/service/internal/testcomponents/example_router.go @@ -26,8 +26,8 @@ var ExampleRouterFactory = connector.NewFactory( ) type LeftRightConfig struct { - Left component.ID `mapstructure:"left"` - Right component.ID `mapstructure:"right"` + Left component.PipelineID `mapstructure:"left"` + Right component.PipelineID `mapstructure:"right"` } type ExampleRouterConfig struct { diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index 7ad94d5ab3f..3867a82f7c2 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -28,7 +28,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() Config { cfg := generateConfig() - pipe := cfg[component.MustNewID("traces")] + pipe := cfg[component.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -38,7 +38,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-receivers", cfgFn: func() Config { cfg := generateConfig() - cfg[component.MustNewID("traces")].Receivers = nil + cfg[component.NewPipelineID(component.DataTypeTraces)].Receivers = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineReceivers), @@ -47,7 +47,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-exporters", cfgFn: func() Config { cfg := generateConfig() - cfg[component.MustNewID("traces")].Exporters = nil + cfg[component.NewPipelineID(component.DataTypeTraces)].Exporters = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineExporters), @@ -84,7 +84,7 @@ func TestConfigValidate(t *testing.T) { func generateConfig() Config { return map[component.ID]*PipelineConfig{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/service_test.go b/service/service_test.go index c538dc0027e..16683651cb3 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -240,7 +240,7 @@ func TestServiceGetExporters(t *testing.T) { // and another service with a valid config can be started right after. func TestServiceTelemetryCleanupOnError(t *testing.T) { invalidCfg := newNopConfig() - invalidCfg.Pipelines[component.MustNewID("traces")].Processors[0] = component.MustNewID("invalid") + invalidCfg.Pipelines[component.NewPipelineID(component.DataTypeTraces)].Processors[0] = component.MustNewID("invalid") // Create a service with an invalid config and expect an error _, err := New(context.Background(), newNopSettings(), invalidCfg) require.Error(t, err) @@ -532,17 +532,17 @@ func newNopSettings() Settings { func newNopConfig() Config { return newNopConfigPipelineConfigs(pipelines.Config{ - component.MustNewID("traces"): { + component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - component.MustNewID("metrics"): { + component.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - component.MustNewID("logs"): { + component.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, From e5c7f5dfe3864fda94fd1c6c08ee7136d27da35c Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 16:46:34 -0700 Subject: [PATCH 08/38] switch tests to pipelineid --- service/config_test.go | 2 +- service/internal/graph/graph_test.go | 10 +++++----- .../testcomponents/example_router_test.go | 18 +++++++++--------- service/pipelines/config_test.go | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/service/config_test.go b/service/config_test.go index 9bac4b9e366..02a544dec09 100644 --- a/service/config_test.go +++ b/service/config_test.go @@ -52,7 +52,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() *Config { cfg := generateConfig() - cfg.Pipelines[component.MustNewID("wrongtype")] = &pipelines.PipelineConfig{ + cfg.Pipelines[component.NewPipelineID("wrongtype")] = &pipelines.PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index 2eca99e2901..d844ea527da 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -2140,7 +2140,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt := range dataTypes { t.Run(dt.String()+"/receiver", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewID(dt): { + component.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2154,7 +2154,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/processor", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewID(dt): { + component.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2168,7 +2168,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/exporter", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewID(dt): { + component.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, @@ -2183,12 +2183,12 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt2 := range dataTypes { t.Run(dt.String()+"/"+dt2.String()+"/connector", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewIDWithName(dt, "in"): { + component.NewPipelineIDWithName(dt, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, }, - component.NewIDWithName(dt2, "out"): { + component.NewPipelineIDWithName(dt2, "out"): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index 2f44e04902d..3f487c56c70 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -31,8 +31,8 @@ func TestExampleRouter(t *testing.T) { } func TestTracesRouter(t *testing.T) { - leftID := component.MustNewIDWithName("sink", "left") - rightID := component.MustNewIDWithName("sink", "right") + leftID := component.NewPipelineIDWithName(component.DataTypeTraces, "left") + rightID := component.NewPipelineIDWithName(component.DataTypeTraces, "right") sinkLeft := new(consumertest.TracesSink) sinkRight := new(consumertest.TracesSink) @@ -41,7 +41,7 @@ func TestTracesRouter(t *testing.T) { // Many connectors will just call router.ConsumeTraces, // but some implementation will call RouteTraces instead. router := connector.NewTracesRouter( - map[component.ID]consumer.Traces{ + map[component.PipelineID]consumer.Traces{ leftID: sinkLeft, rightID: sinkRight, }) @@ -70,8 +70,8 @@ func TestTracesRouter(t *testing.T) { } func TestMetricsRouter(t *testing.T) { - leftID := component.MustNewIDWithName("sink", "left") - rightID := component.MustNewIDWithName("sink", "right") + leftID := component.NewPipelineIDWithName(component.DataTypeMetrics, "left") + rightID := component.NewPipelineIDWithName(component.DataTypeMetrics, "right") sinkLeft := new(consumertest.MetricsSink) sinkRight := new(consumertest.MetricsSink) @@ -80,7 +80,7 @@ func TestMetricsRouter(t *testing.T) { // Many connectors will just call router.ConsumeMetrics, // but some implementation will call RouteMetrics instead. router := connector.NewMetricsRouter( - map[component.ID]consumer.Metrics{ + map[component.PipelineID]consumer.Metrics{ leftID: sinkLeft, rightID: sinkRight, }) @@ -109,8 +109,8 @@ func TestMetricsRouter(t *testing.T) { } func TestLogsRouter(t *testing.T) { - leftID := component.MustNewIDWithName("sink", "left") - rightID := component.MustNewIDWithName("sink", "right") + leftID := component.NewPipelineIDWithName(component.DataTypeLogs, "left") + rightID := component.NewPipelineIDWithName(component.DataTypeLogs, "right") sinkLeft := new(consumertest.LogsSink) sinkRight := new(consumertest.LogsSink) @@ -119,7 +119,7 @@ func TestLogsRouter(t *testing.T) { // Many connectors will just call router.ConsumeLogs, // but some implementation will call RouteLogs instead. router := connector.NewLogsRouter( - map[component.ID]consumer.Logs{ + map[component.PipelineID]consumer.Logs{ leftID: sinkLeft, rightID: sinkRight, }) diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index 3867a82f7c2..de36fd92de0 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -63,7 +63,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() Config { cfg := generateConfig() - cfg[component.MustNewID("wrongtype")] = &PipelineConfig{ + cfg[component.NewPipelineID("wrongtype")] = &PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -83,7 +83,7 @@ func TestConfigValidate(t *testing.T) { } func generateConfig() Config { - return map[component.ID]*PipelineConfig{ + return map[component.PipelineID]*PipelineConfig{ component.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, From e4017818af939e9a75e8970dc6b1c844a9844a33 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 17:17:50 -0700 Subject: [PATCH 09/38] change datagen --- cmd/mdatagen/templates/component_test.go.tmpl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index ca948214d80..bbaa35b6303 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -372,7 +372,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -381,7 +381,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateLogsToMetrics(ctx, set, cfg, router) }, }, @@ -390,7 +390,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateLogsToTraces(ctx, set, cfg, router) }, }, @@ -399,7 +399,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateMetricsToLogs(ctx, set, cfg, router) }, }, @@ -408,7 +408,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -417,7 +417,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateMetricsToTraces(ctx, set, cfg, router) }, }, @@ -426,7 +426,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateTracesToLogs(ctx, set, cfg, router) }, }, @@ -435,7 +435,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateTracesToMetrics(ctx, set, cfg, router) }, }, @@ -444,7 +444,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, From ab1811db6fcebedd8a16cae47bc268888adf52e2 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 17:18:55 -0700 Subject: [PATCH 10/38] cleanup changes --- cmd/mdatagen/templates/component_test.go.tmpl | 18 +++++++++--------- .../generated_component_test.go | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index bbaa35b6303..90e24bc0491 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -372,7 +372,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -381,7 +381,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateLogsToMetrics(ctx, set, cfg, router) }, }, @@ -390,7 +390,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateLogsToTraces(ctx, set, cfg, router) }, }, @@ -399,7 +399,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateMetricsToLogs(ctx, set, cfg, router) }, }, @@ -408,7 +408,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -417,7 +417,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateMetricsToTraces(ctx, set, cfg, router) }, }, @@ -426,7 +426,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateTracesToLogs(ctx, set, cfg, router) }, }, @@ -435,7 +435,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateTracesToMetrics(ctx, set, cfg, router) }, }, @@ -444,7 +444,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, diff --git a/connector/forwardconnector/generated_component_test.go b/connector/forwardconnector/generated_component_test.go index 9bbe4e5aa5f..eef4060e493 100644 --- a/connector/forwardconnector/generated_component_test.go +++ b/connector/forwardconnector/generated_component_test.go @@ -36,7 +36,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "logs_to_logs", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewLogsRouter(map[component.ID]consumer.Logs{component.NewID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[component.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -44,7 +44,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "metrics_to_metrics", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewMetricsRouter(map[component.ID]consumer.Metrics{component.NewID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[component.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -52,7 +52,7 @@ func TestComponentLifecycle(t *testing.T) { { name: "traces_to_traces", createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) { - router := connector.NewTracesRouter(map[component.ID]consumer.Traces{component.NewID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, From 73bbec2e544c3f5b6c5f2f3f85effac82e8d1d19 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Fri, 24 May 2024 17:20:53 -0700 Subject: [PATCH 11/38] fix rebase --- exporter/exporterhelper/queue_sender_test.go | 32 -------------------- 1 file changed, 32 deletions(-) diff --git a/exporter/exporterhelper/queue_sender_test.go b/exporter/exporterhelper/queue_sender_test.go index b3c12819284..4775938eb55 100644 --- a/exporter/exporterhelper/queue_sender_test.go +++ b/exporter/exporterhelper/queue_sender_test.go @@ -61,11 +61,7 @@ func TestQueuedRetry_DoNotPreserveCancellation(t *testing.T) { qCfg := NewDefaultQueueSettings() qCfg.NumConsumers = 1 rCfg := configretry.NewDefaultBackOffConfig() -<<<<<<< HEAD be, err := newBaseExporter(defaultSettings, defaultDataType, newObservabilityConsumerSender, -======= - be, err := newBaseExporter(defaultSettings, component.DataTypeMetrics, newObservabilityConsumerSender, ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -97,11 +93,7 @@ func TestQueuedRetry_RejectOnFull(t *testing.T) { set := exportertest.NewNopCreateSettings() logger, observed := observer.New(zap.ErrorLevel) set.Logger = zap.New(logger) -<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newNoopObsrepSender, -======= - be, err := newBaseExporter(set, component.DataTypeMetrics, newNoopObsrepSender, ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithQueue(qCfg)) require.NoError(t, err) @@ -174,11 +166,7 @@ func TestQueuedRetryHappyPath(t *testing.T) { t.Cleanup(func() { require.NoError(t, tel.Shutdown(context.Background())) }) set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tel.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} -<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, tt.queueOptions...) -======= - be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, tt.queueOptions...) ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) require.NoError(t, err) ocs := be.obsrepSender.(*observabilityConsumerSender) @@ -221,11 +209,7 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) { qCfg.NumConsumers = 0 // to make every request go straight to the queue rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} -<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, -======= - be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -354,11 +338,7 @@ func TestQueuedRetryPersistenceEnabled(t *testing.T) { qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} -<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, -======= - be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -384,11 +364,7 @@ func TestQueuedRetryPersistenceEnabledStorageError(t *testing.T) { qCfg.StorageID = &storageID // enable persistence rCfg := configretry.NewDefaultBackOffConfig() set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()} -<<<<<<< HEAD be, err := newBaseExporter(set, defaultDataType, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler), -======= - be, err := newBaseExporter(set, component.DataTypeMetrics, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler), ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -412,11 +388,7 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { rCfg.MaxElapsedTime = 0 // retry infinitely so shutdown can be triggered mockReq := newErrorRequest() -<<<<<<< HEAD be, err := newBaseExporter(defaultSettings, defaultDataType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), -======= - be, err := newBaseExporter(defaultSettings, component.DataTypeMetrics, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(mockReq)), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) @@ -440,11 +412,7 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) { // start the exporter again replacing the preserved mockRequest in the unmarshaler with a new one that doesn't fail. replacedReq := newMockRequest(1, nil) -<<<<<<< HEAD be, err = newBaseExporter(defaultSettings, defaultDataType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), -======= - be, err = newBaseExporter(defaultSettings, component.DataTypeMetrics, newNoopObsrepSender, withMarshaler(mockRequestMarshaler), ->>>>>>> b1fd5d060 (make a new id type with datatype and use it) withUnmarshaler(mockRequestUnmarshaler(replacedReq)), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NoError(t, be.Start(context.Background(), host)) From c9180b7d0a4dc6a22952deddadbc310a5df7065f Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 11:17:20 -0700 Subject: [PATCH 12/38] private method --- component/config.go | 2 +- component/identifiable.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/component/config.go b/component/config.go index 2244b68774c..c44671c9455 100644 --- a/component/config.go +++ b/component/config.go @@ -184,7 +184,7 @@ func (dt DataType) MarshalText() (text []byte, err error) { return []byte(dt), nil } -func NewDataType(ty string) (DataType, error) { +func newDataType(ty string) (DataType, error) { if len(ty) == 0 { return "", fmt.Errorf("id must not be empty") } diff --git a/component/identifiable.go b/component/identifiable.go index 246f577f3bd..be01251d3fb 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -161,7 +161,7 @@ func (id *PipelineID) UnmarshalText(text []byte) error { var err error - if id.typeVal, err = NewDataType(typeStr); err != nil { + if id.typeVal, err = newDataType(typeStr); err != nil { return fmt.Errorf("in %q id: %w", idStr, err) } id.nameVal = nameStr From 42dae7d3c2031a41ec349b944d1a9d62aa44d1cc Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 11:52:14 -0700 Subject: [PATCH 13/38] move pipeline id to new file --- component/config.go | 3 +- component/config_test.go | 11 +++++ component/identifiable.go | 75 ---------------------------------- component/pipeline.go | 82 ++++++++++++++++++++++++++++++++++++++ component/pipeline_test.go | 77 +++++++++++++++++++++++++++++++++++ 5 files changed, 172 insertions(+), 76 deletions(-) create mode 100644 component/pipeline.go create mode 100644 component/pipeline_test.go diff --git a/component/config.go b/component/config.go index c44671c9455..3072f8f2f56 100644 --- a/component/config.go +++ b/component/config.go @@ -4,6 +4,7 @@ package component // import "go.opentelemetry.io/collector/component" import ( + "errors" "fmt" "reflect" "regexp" @@ -186,7 +187,7 @@ func (dt DataType) MarshalText() (text []byte, err error) { func newDataType(ty string) (DataType, error) { if len(ty) == 0 { - return "", fmt.Errorf("id must not be empty") + return "", errors.New("id must not be empty") } switch ty { case "metrics": diff --git a/component/config_test.go b/component/config_test.go index caed4dc20ab..f984fd3588d 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -423,6 +423,17 @@ func TestNewType(t *testing.T) { } } +func TestNewDataType(t *testing.T) { + ty, err := newDataType("logs") + require.NoError(t, err) + assert.Equal(t, ty, DataTypeLogs) + + // hopefully this reminds us to update DataType when profiles get included + ty, err = newDataType("profiles") + assert.Equal(t, err, errors.New("invalid data type profiles")) + +} + type configWithEmbeddedStruct struct { String string `mapstructure:"string"` Num int `mapstructure:"num"` diff --git a/component/identifiable.go b/component/identifiable.go index be01251d3fb..765e906d9e4 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -102,78 +102,3 @@ func (id ID) String() string { return id.typeVal.String() + typeAndNameSeparator + id.nameVal } - -type PipelineID struct { - typeVal DataType `mapstructure:"-"` - nameVal string `mapstructure:"-"` -} - -// Type returns the type of the component. -func (id PipelineID) Type() DataType { - return id.typeVal -} - -// Name returns the custom name of the component. -func (id PipelineID) Name() string { - return id.nameVal -} - -// NewPipelineID returns a new PipelineID with the given DataType and empty name. -func NewPipelineID(typeVal DataType) PipelineID { - return PipelineID{typeVal: typeVal} -} - -// NewPipelineIDWithName returns a new PipelineID with the given DataType and name. -func NewPipelineIDWithName(typeVal DataType, nameVal string) PipelineID { - return PipelineID{typeVal: typeVal, nameVal: nameVal} -} - -// MarshalText implements the encoding.TextMarshaler interface. -// This marshals the type and name as one string in the config. -func (id PipelineID) MarshalText() (text []byte, err error) { - return []byte(id.String()), nil -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (id *PipelineID) UnmarshalText(text []byte) error { - idStr := string(text) - items := strings.SplitN(idStr, typeAndNameSeparator, 2) - var typeStr, nameStr string - if len(items) >= 1 { - typeStr = strings.TrimSpace(items[0]) - } - - if len(items) == 1 && typeStr == "" { - return errors.New("id must not be empty") - } - - if typeStr == "" { - return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) - } - - if len(items) > 1 { - // "name" part is present. - nameStr = strings.TrimSpace(items[1]) - if nameStr == "" { - return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) - } - } - - var err error - - if id.typeVal, err = newDataType(typeStr); err != nil { - return fmt.Errorf("in %q id: %w", idStr, err) - } - id.nameVal = nameStr - - return nil -} - -// String returns the ID string representation as "type[/name]" format. -func (id PipelineID) String() string { - if id.nameVal == "" { - return id.typeVal.String() - } - - return id.typeVal.String() + typeAndNameSeparator + id.nameVal -} diff --git a/component/pipeline.go b/component/pipeline.go new file mode 100644 index 00000000000..7931fdba591 --- /dev/null +++ b/component/pipeline.go @@ -0,0 +1,82 @@ +package component + +import ( + "errors" + "fmt" + "strings" +) + +type PipelineID struct { + typeVal DataType `mapstructure:"-"` + nameVal string `mapstructure:"-"` +} + +// Type returns the type of the component. +func (id PipelineID) Type() DataType { + return id.typeVal +} + +// Name returns the custom name of the component. +func (id PipelineID) Name() string { + return id.nameVal +} + +// NewPipelineID returns a new PipelineID with the given DataType and empty name. +func NewPipelineID(typeVal DataType) PipelineID { + return PipelineID{typeVal: typeVal} +} + +// NewPipelineIDWithName returns a new PipelineID with the given DataType and name. +func NewPipelineIDWithName(typeVal DataType, nameVal string) PipelineID { + return PipelineID{typeVal: typeVal, nameVal: nameVal} +} + +// MarshalText implements the encoding.TextMarshaler interface. +// This marshals the type and name as one string in the config. +func (id PipelineID) MarshalText() (text []byte, err error) { + return []byte(id.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (id *PipelineID) UnmarshalText(text []byte) error { + idStr := string(text) + items := strings.SplitN(idStr, typeAndNameSeparator, 2) + var typeStr, nameStr string + if len(items) >= 1 { + typeStr = strings.TrimSpace(items[0]) + } + + if len(items) == 1 && typeStr == "" { + return errors.New("id must not be empty") + } + + if typeStr == "" { + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) + } + + if len(items) > 1 { + // "name" part is present. + nameStr = strings.TrimSpace(items[1]) + if nameStr == "" { + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) + } + } + + var err error + + if id.typeVal, err = newDataType(typeStr); err != nil { + return fmt.Errorf("in %q id: %w", idStr, err) + } + id.nameVal = nameStr + + return nil +} + +// String returns the ID string representation as "type[/name]" format. +func (id PipelineID) String() string { + if id.nameVal == "" { + return id.typeVal.String() + } + + return id.typeVal.String() + typeAndNameSeparator + id.nameVal +} diff --git a/component/pipeline_test.go b/component/pipeline_test.go new file mode 100644 index 00000000000..00750cc86c2 --- /dev/null +++ b/component/pipeline_test.go @@ -0,0 +1,77 @@ +package component + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestNewPipelineID(t *testing.T) { + id := NewPipelineID(DataTypeMetrics) + assert.Equal(t, "", id.nameVal) +} + +func TestPipelineIDMarshalText(t *testing.T) { + id := NewPipelineIDWithName(DataTypeMetrics, "name") + got, err := id.MarshalText() + assert.NoError(t, err) + assert.Equal(t, id.String(), string(got)) +} + +func TestPipelineIDUnmarshalText(t *testing.T) { + var testCases = []struct { + idStr string + expectedErr bool + expectedID PipelineID + }{ + { + idStr: "metrics", + expectedID: PipelineID{typeVal: DataTypeMetrics, nameVal: ""}, + }, + { + idStr: "logs/valid_name", + expectedID: PipelineID{typeVal: DataTypeLogs, nameVal: "valid_name"}, + }, + { + idStr: " traces / valid_name ", + expectedID: PipelineID{typeVal: DataTypeTraces, nameVal: "valid_name"}, + }, + { + idStr: "/valid_name", + expectedErr: true, + }, + { + idStr: " /valid_name", + expectedErr: true, + }, + { + idStr: "valid_type/", + expectedErr: true, + }, + { + idStr: "valid_type/ ", + expectedErr: true, + }, + { + idStr: " ", + expectedErr: true, + }, + } + + for _, test := range testCases { + t.Run(test.idStr, func(t *testing.T) { + id := PipelineID{} + err := id.UnmarshalText([]byte(test.idStr)) + if test.expectedErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + assert.Equal(t, test.expectedID, id) + assert.Equal(t, test.expectedID.Type(), id.Type()) + assert.Equal(t, test.expectedID.Name(), id.Name()) + assert.Equal(t, test.expectedID.String(), id.String()) + }) + } +} From eaa4e203346e2a9a4cde21caeda6b930bb522e01 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 13:06:57 -0700 Subject: [PATCH 14/38] test coverage --- component/config_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/component/config_test.go b/component/config_test.go index f984fd3588d..ed54fc1496a 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -431,6 +431,27 @@ func TestNewDataType(t *testing.T) { // hopefully this reminds us to update DataType when profiles get included ty, err = newDataType("profiles") assert.Equal(t, err, errors.New("invalid data type profiles")) +} + +func TestDataTypeStringMarshal(t *testing.T) { + assert.Equal(t, "metrics", DataTypeMetrics.String()) + text, err := DataTypeMetrics.MarshalText() + assert.Equal(t, []byte("metrics"), text) + assert.Nil(t, err) +} + +func TestDataTypeFromSignal(t *testing.T) { + dt, err := newDataType("metrics") + assert.Nil(t, err) + assert.Equal(t, DataTypeMetrics, dt) + + dt, err = newDataType("traces") + assert.Equal(t, DataTypeTraces, dt) + assert.Nil(t, err) + + dt, err = newDataType("") + assert.Equal(t, errors.New("id must not be empty"), err) + assert.Equal(t, DataType(""), dt) } From cb9e83bfbfb344e3083f3bcf0929a1ad13b607d2 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 14:40:06 -0700 Subject: [PATCH 15/38] copyright --- component/pipeline.go | 3 +++ component/pipeline_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/component/pipeline.go b/component/pipeline.go index 7931fdba591..4a74dd4df26 100644 --- a/component/pipeline.go +++ b/component/pipeline.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package component import ( diff --git a/component/pipeline_test.go b/component/pipeline_test.go index 00750cc86c2..80cf5bc3f14 100644 --- a/component/pipeline_test.go +++ b/component/pipeline_test.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package component import ( From d7422bd7a5b6ff464f42c3ff29fba9b39951bf48 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 14:50:45 -0700 Subject: [PATCH 16/38] porto --- component/pipeline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/pipeline.go b/component/pipeline.go index 4a74dd4df26..f5e279fd941 100644 --- a/component/pipeline.go +++ b/component/pipeline.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package component +package component // import "go.opentelemetry.io/collector/component" import ( "errors" From 66d375f9426cbbf633a24ddd88a9e2e9e5a0ebe2 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 14:51:54 -0700 Subject: [PATCH 17/38] lint --- component/config_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/component/config_test.go b/component/config_test.go index ed54fc1496a..dacd7361581 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -430,6 +430,7 @@ func TestNewDataType(t *testing.T) { // hopefully this reminds us to update DataType when profiles get included ty, err = newDataType("profiles") + assert.Equal(t, "", ty) assert.Equal(t, err, errors.New("invalid data type profiles")) } From 631568c09125c3d08e260d026b91205e526d0e5a Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 15:02:15 -0700 Subject: [PATCH 18/38] chlog --- .chloggen/datatype-newid.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .chloggen/datatype-newid.yaml diff --git a/.chloggen/datatype-newid.yaml b/.chloggen/datatype-newid.yaml new file mode 100644 index 00000000000..aef26c9f7cc --- /dev/null +++ b/.chloggen/datatype-newid.yaml @@ -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: enhancement + +# 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: "Changes DataType to be an enum of Otel signals. Creates a new struct PipelineID - made up of a DataType and an optional string name. This PipelineID replaces the previous use of component.ID to identify Pipelines." + +# One or more tracking issues or pull requests related to the change +issues: [9429] + +# (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'] \ No newline at end of file From 77778a9d377e1b88a35108f9068038f33684dcf8 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 28 May 2024 15:03:59 -0700 Subject: [PATCH 19/38] unit test --- component/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/config_test.go b/component/config_test.go index dacd7361581..1c92772e442 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -430,7 +430,7 @@ func TestNewDataType(t *testing.T) { // hopefully this reminds us to update DataType when profiles get included ty, err = newDataType("profiles") - assert.Equal(t, "", ty) + assert.Equal(t, DataType(""), ty) assert.Equal(t, err, errors.New("invalid data type profiles")) } From 149cb87880944ada95782997104239168fc6d64d Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Mon, 10 Jun 2024 14:59:04 -0400 Subject: [PATCH 20/38] fix --- cmd/mdatagen/templates/component_test.go.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index 683c2b7a12d..77499dd8b46 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -390,7 +390,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.PipelineID]consumer.Traces{component.NewPipelineIDID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[component.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateLogsToTraces(ctx, set, cfg, router) }, }, From 5aa24ba57f3b93a85ee378ad353c356b1126e809 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Mon, 10 Jun 2024 15:00:55 -0400 Subject: [PATCH 21/38] more merge fixups --- component/config_test.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/component/config_test.go b/component/config_test.go index 8c9b9a35cf6..a2d3646a0ae 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -453,28 +453,3 @@ func TestDataTypeFromSignal(t *testing.T) { assert.Equal(t, DataType(""), dt) } - -type configWithEmbeddedStruct struct { - String string `mapstructure:"string"` - Num int `mapstructure:"num"` - embeddedUnmarshallingConfig -} - -type embeddedUnmarshallingConfig struct { -} - -func (euc *embeddedUnmarshallingConfig) Unmarshal(_ *confmap.Conf) error { - return nil // do nothing. -} -func TestStructWithEmbeddedUnmarshaling(t *testing.T) { - t.Skip("Skipping, to be fixed with https://github.com/open-telemetry/opentelemetry-collector/issues/7102") - cfgMap := confmap.NewFromStringMap(map[string]any{ - "string": "foo", - "num": 123, - }) - tc := &configWithEmbeddedStruct{} - err := UnmarshalConfig(cfgMap, tc) - require.NoError(t, err) - assert.Equal(t, "foo", tc.String) - assert.Equal(t, 123, tc.Num) -} From 5b96c291f3fbcb35cda44d5b724ac5c05f92639d Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Mon, 10 Jun 2024 16:50:07 -0400 Subject: [PATCH 22/38] move instanceid --- component/component.go | 7 ---- component/status_test.go | 42 ++++++++++--------- extension/extension.go | 3 +- .../extensiontest/statuswatcher_extension.go | 7 ++-- .../statuswatcher_extension_test.go | 5 ++- .../sharedcomponent/sharedcomponent_test.go | 9 ++-- otelcol/collector_test.go | 5 ++- service/extensions/extensions.go | 9 ++-- service/extensions/extensions_test.go | 3 +- service/host.go | 3 +- service/internal/graph/graph.go | 12 +++--- service/internal/graph/graph_test.go | 32 +++++++------- .../proctelemetry/process_telemetry.go | 4 +- .../nop_telemetry_settings.go | 3 +- .../nop_telemetry_settings_test.go | 5 ++- .../servicetelemetry/telemetry_settings.go | 3 +- .../telemetry_settings_test.go | 9 ++-- service/internal/status/status.go | 17 ++++---- service/internal/status/status_test.go | 23 +++++----- service/pipelines/config.go | 7 ++++ service/service_test.go | 2 +- 21 files changed, 113 insertions(+), 97 deletions(-) diff --git a/component/component.go b/component/component.go index 4fac1b3b616..bd1ff210d4b 100644 --- a/component/component.go +++ b/component/component.go @@ -189,10 +189,3 @@ type CreateDefaultConfigFunc func() Config func (f CreateDefaultConfigFunc) CreateDefaultConfig() Config { return f() } - -// InstanceID uniquely identifies a component instance -type InstanceID struct { - ID ID - Kind Kind - PipelineIDs map[PipelineID]struct{} -} diff --git a/component/status_test.go b/component/status_test.go index 13755d078a5..6ce727f4411 100644 --- a/component/status_test.go +++ b/component/status_test.go @@ -9,6 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/service/pipelines" ) func TestNewStatusEvent(t *testing.T) { @@ -52,12 +54,12 @@ func TestStatusEventsWithError(t *testing.T) { func TestAggregateStatus(t *testing.T) { for _, tc := range []struct { name string - statusMap map[*InstanceID]*StatusEvent + statusMap map[*pipelines.InstanceID]*StatusEvent expectedStatus Status }{ { name: "aggregate status with fatal is FatalError", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusFatalError), @@ -67,7 +69,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with permanent is PermanentError", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusPermanentError), @@ -77,7 +79,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with stopping is Stopping", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -87,7 +89,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with stopped and non-stopped is Stopping", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -97,7 +99,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with all stopped is Stopped", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStopped), {}: NewStatusEvent(StatusStopped), {}: NewStatusEvent(StatusStopped), @@ -106,7 +108,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with recoverable is RecoverableError", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -115,7 +117,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with starting is Starting", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), }, @@ -123,7 +125,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with all ok is OK", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusOK), @@ -189,12 +191,12 @@ func TestAggregateStatusEvent(t *testing.T) { for _, tc := range []struct { name string - statusMap map[*InstanceID]*StatusEvent + statusMap map[*pipelines.InstanceID]*StatusEvent expectedStatus *StatusEvent }{ { name: "FatalError - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewFatalErrorEvent(assert.AnError)), @@ -208,7 +210,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "FatalError - synthetic event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewFatalErrorEvent(assert.AnError), @@ -222,7 +224,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "PermanentError - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewPermanentErrorEvent(assert.AnError)), @@ -236,7 +238,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "PermanentError - synthetic event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewPermanentErrorEvent(assert.AnError), @@ -250,7 +252,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopping - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -263,7 +265,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopping - synthetic event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -276,7 +278,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopped - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStopped), {}: latest(NewStatusEvent(StatusStopped)), {}: NewStatusEvent(StatusStopped), @@ -288,7 +290,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "RecoverableError - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewRecoverableErrorEvent(assert.AnError)), @@ -301,7 +303,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Starting - synthetic event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: latest(NewStatusEvent(StatusOK)), }, @@ -312,7 +314,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "OK - existing event", - statusMap: map[*InstanceID]*StatusEvent{ + statusMap: map[*pipelines.InstanceID]*StatusEvent{ {}: NewStatusEvent(StatusOK), {}: latest(NewStatusEvent(StatusOK)), {}: NewStatusEvent(StatusOK), diff --git a/extension/extension.go b/extension/extension.go index 8ee61a422cc..3284cd39cf8 100644 --- a/extension/extension.go +++ b/extension/extension.go @@ -9,6 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/service/pipelines" ) // Extension is the interface for objects hosted by the OpenTelemetry Collector that @@ -59,7 +60,7 @@ type StatusWatcher interface { // Extensions that implement this interface must be ready that the ComponentStatusChanged // may be called before, after or concurrently with calls to Component.Start() and Component.Shutdown(). // The function may be called concurrently with itself. - ComponentStatusChanged(source *component.InstanceID, event *component.StatusEvent) + ComponentStatusChanged(source *pipelines.InstanceID, event *component.StatusEvent) } // CreateSettings is passed to Factory.Create(...) function. diff --git a/extension/extensiontest/statuswatcher_extension.go b/extension/extensiontest/statuswatcher_extension.go index a4d78f9033e..0ad5ca94c07 100644 --- a/extension/extensiontest/statuswatcher_extension.go +++ b/extension/extensiontest/statuswatcher_extension.go @@ -9,6 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/service/pipelines" ) // NewStatusWatcherExtensionCreateSettings returns a new nop settings for Create*Extension functions. @@ -21,7 +22,7 @@ func NewStatusWatcherExtensionCreateSettings() extension.Settings { // NewStatusWatcherExtensionFactory returns a component.ExtensionFactory to construct a status watcher extension. func NewStatusWatcherExtensionFactory( - onStatusChanged func(source *component.InstanceID, event *component.StatusEvent), + onStatusChanged func(source *pipelines.InstanceID, event *component.StatusEvent), ) extension.Factory { return extension.NewFactory( component.MustNewType("statuswatcher"), @@ -39,9 +40,9 @@ func NewStatusWatcherExtensionFactory( type statusWatcherExtension struct { component.StartFunc component.ShutdownFunc - onStatusChanged func(source *component.InstanceID, event *component.StatusEvent) + onStatusChanged func(source *pipelines.InstanceID, event *component.StatusEvent) } -func (e statusWatcherExtension) ComponentStatusChanged(source *component.InstanceID, event *component.StatusEvent) { +func (e statusWatcherExtension) ComponentStatusChanged(source *pipelines.InstanceID, event *component.StatusEvent) { e.onStatusChanged(source, event) } diff --git a/extension/extensiontest/statuswatcher_extension_test.go b/extension/extensiontest/statuswatcher_extension_test.go index 14f9859e354..c452479d7d6 100644 --- a/extension/extensiontest/statuswatcher_extension_test.go +++ b/extension/extensiontest/statuswatcher_extension_test.go @@ -13,12 +13,13 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/service/pipelines" ) func TestStatusWatcherExtension(t *testing.T) { statusChanged := false factory := NewStatusWatcherExtensionFactory( - func(*component.InstanceID, *component.StatusEvent) { + func(*pipelines.InstanceID, *component.StatusEvent) { statusChanged = true }, ) @@ -32,7 +33,7 @@ func TestStatusWatcherExtension(t *testing.T) { assert.NoError(t, ext.Start(context.Background(), componenttest.NewNopHost())) assert.False(t, statusChanged) - ext.(extension.StatusWatcher).ComponentStatusChanged(&component.InstanceID{}, &component.StatusEvent{}) + ext.(extension.StatusWatcher).ComponentStatusChanged(&pipelines.InstanceID{}, &component.StatusEvent{}) assert.True(t, statusChanged) assert.NoError(t, ext.Shutdown(context.Background())) diff --git a/internal/sharedcomponent/sharedcomponent_test.go b/internal/sharedcomponent/sharedcomponent_test.go index 77cda5124db..66d29d5db9e 100644 --- a/internal/sharedcomponent/sharedcomponent_test.go +++ b/internal/sharedcomponent/sharedcomponent_test.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/service/pipelines" ) var id = component.MustNewID("test") @@ -108,9 +109,9 @@ func TestSharedComponent(t *testing.T) { assert.Equal(t, 1, calledStop) } func TestSharedComponentsReportStatus(t *testing.T) { - reportedStatuses := make(map[*component.InstanceID][]component.Status) + reportedStatuses := make(map[*pipelines.InstanceID][]component.Status) newStatusFunc := func() func(*component.StatusEvent) { - instanceID := &component.InstanceID{} + instanceID := &pipelines.InstanceID{} return func(ev *component.StatusEvent) { if ev.Status() == component.StatusNone { return @@ -218,9 +219,9 @@ func TestReportStatusOnStartShutdown(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - reportedStatuses := make(map[*component.InstanceID][]component.Status) + reportedStatuses := make(map[*pipelines.InstanceID][]component.Status) newStatusFunc := func() func(*component.StatusEvent) { - instanceID := &component.InstanceID{} + instanceID := &pipelines.InstanceID{} return func(ev *component.StatusEvent) { reportedStatuses[instanceID] = append(reportedStatuses[instanceID], ev.Status()) } diff --git a/otelcol/collector_test.go b/otelcol/collector_test.go index 68eb3b54318..226cfe912c3 100644 --- a/otelcol/collector_test.go +++ b/otelcol/collector_test.go @@ -20,6 +20,7 @@ import ( "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension/extensiontest" "go.opentelemetry.io/collector/processor/processortest" + "go.opentelemetry.io/collector/service/pipelines" ) func TestStateString(t *testing.T) { @@ -142,9 +143,9 @@ func TestComponentStatusWatcher(t *testing.T) { factories.Processors[unhealthyProcessorFactory.Type()] = unhealthyProcessorFactory // Keep track of all status changes in a map. - changedComponents := map[*component.InstanceID][]component.Status{} + changedComponents := map[*pipelines.InstanceID][]component.Status{} var mux sync.Mutex - onStatusChanged := func(source *component.InstanceID, event *component.StatusEvent) { + onStatusChanged := func(source *pipelines.InstanceID, event *component.StatusEvent) { if source.ID.Type() != unhealthyProcessorFactory.Type() { return } diff --git a/service/extensions/extensions.go b/service/extensions/extensions.go index c8f632965ca..30c16ac5ce9 100644 --- a/service/extensions/extensions.go +++ b/service/extensions/extensions.go @@ -17,6 +17,7 @@ import ( "go.opentelemetry.io/collector/service/internal/components" "go.opentelemetry.io/collector/service/internal/servicetelemetry" "go.opentelemetry.io/collector/service/internal/zpages" + "go.opentelemetry.io/collector/service/pipelines" ) const zExtensionName = "zextensionname" @@ -25,7 +26,7 @@ const zExtensionName = "zextensionname" type Extensions struct { telemetry servicetelemetry.TelemetrySettings extMap map[component.ID]extension.Extension - instanceIDs map[component.ID]*component.InstanceID + instanceIDs map[component.ID]*pipelines.InstanceID extensionIDs []component.ID // start order (and reverse stop order) } @@ -118,7 +119,7 @@ func (bes *Extensions) NotifyConfig(ctx context.Context, conf *confmap.Conf) err return errs } -func (bes *Extensions) NotifyComponentStatusChange(source *component.InstanceID, event *component.StatusEvent) { +func (bes *Extensions) NotifyComponentStatusChange(source *pipelines.InstanceID, event *component.StatusEvent) { for _, extID := range bes.extensionIDs { ext := bes.extMap[extID] if sw, ok := ext.(extension.StatusWatcher); ok { @@ -175,11 +176,11 @@ func New(ctx context.Context, set Settings, cfg Config) (*Extensions, error) { exts := &Extensions{ telemetry: set.Telemetry, extMap: make(map[component.ID]extension.Extension), - instanceIDs: make(map[component.ID]*component.InstanceID), + instanceIDs: make(map[component.ID]*pipelines.InstanceID), extensionIDs: make([]component.ID, 0, len(cfg)), } for _, extID := range cfg { - instanceID := &component.InstanceID{ + instanceID := &pipelines.InstanceID{ ID: extID, Kind: component.KindExtension, } diff --git a/service/extensions/extensions_test.go b/service/extensions/extensions_test.go index d519132d3f3..b9f21a4eea8 100644 --- a/service/extensions/extensions_test.go +++ b/service/extensions/extensions_test.go @@ -18,6 +18,7 @@ import ( "go.opentelemetry.io/collector/extension/extensiontest" "go.opentelemetry.io/collector/service/internal/servicetelemetry" "go.opentelemetry.io/collector/service/internal/status" + "go.opentelemetry.io/collector/service/pipelines" ) func TestBuildExtensions(t *testing.T) { @@ -433,7 +434,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { assert.NoError(t, err) var actualStatuses []*component.StatusEvent - rep := status.NewReporter(func(_ *component.InstanceID, ev *component.StatusEvent) { + rep := status.NewReporter(func(_ *pipelines.InstanceID, ev *component.StatusEvent) { actualStatuses = append(actualStatuses, ev) }, func(err error) { require.NoError(t, err) diff --git a/service/host.go b/service/host.go index ce8dc530d40..134183ac951 100644 --- a/service/host.go +++ b/service/host.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/service/extensions" "go.opentelemetry.io/collector/service/internal/graph" + "go.opentelemetry.io/collector/service/pipelines" ) // TODO: remove as part of https://github.com/open-telemetry/opentelemetry-collector/issues/7370 for service 1.0 @@ -66,7 +67,7 @@ func (host *serviceHost) GetExporters() map[component.DataType]map[component.ID] return host.pipelines.GetExporters() } -func (host *serviceHost) notifyComponentStatusChange(source *component.InstanceID, event *component.StatusEvent) { +func (host *serviceHost) notifyComponentStatusChange(source *pipelines.InstanceID, event *component.StatusEvent) { host.serviceExtensions.NotifyComponentStatusChange(source, event) if event.Status() == component.StatusFatalError { host.asyncErrorChannel <- event.Err() diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index bd789630932..03f704ee6b3 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -57,7 +57,7 @@ type Graph struct { pipelines map[component.PipelineID]*pipelineNodes // Keep track of status source per node - instanceIDs map[int64]*component.InstanceID + instanceIDs map[int64]*pipelines.InstanceID telemetry servicetelemetry.TelemetrySettings } @@ -68,7 +68,7 @@ func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), pipelines: make(map[component.PipelineID]*pipelineNodes, len(set.PipelineConfigs)), - instanceIDs: make(map[int64]*component.InstanceID), + instanceIDs: make(map[int64]*pipelines.InstanceID), telemetry: set.Telemetry, } for pipelineID := range set.PipelineConfigs { @@ -197,7 +197,7 @@ func (g *Graph) createReceiver(pipelineID component.PipelineID, recvID component return node.(*receiverNode) } g.componentGraph.AddNode(rcvrNode) - g.instanceIDs[rcvrNode.ID()] = &component.InstanceID{ + g.instanceIDs[rcvrNode.ID()] = &pipelines.InstanceID{ ID: recvID, Kind: component.KindReceiver, PipelineIDs: map[component.PipelineID]struct{}{ @@ -210,7 +210,7 @@ func (g *Graph) createReceiver(pipelineID component.PipelineID, recvID component func (g *Graph) createProcessor(pipelineID component.PipelineID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) - g.instanceIDs[procNode.ID()] = &component.InstanceID{ + g.instanceIDs[procNode.ID()] = &pipelines.InstanceID{ ID: procID, Kind: component.KindProcessor, PipelineIDs: map[component.PipelineID]struct{}{ @@ -227,7 +227,7 @@ func (g *Graph) createExporter(pipelineID component.PipelineID, exprID component return node.(*exporterNode) } g.componentGraph.AddNode(expNode) - g.instanceIDs[expNode.ID()] = &component.InstanceID{ + g.instanceIDs[expNode.ID()] = &pipelines.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, PipelineIDs: map[component.PipelineID]struct{}{ @@ -246,7 +246,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.Pipelin return node.(*connectorNode) } g.componentGraph.AddNode(connNode) - g.instanceIDs[connNode.ID()] = &component.InstanceID{ + g.instanceIDs[connNode.ID()] = &pipelines.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, PipelineIDs: map[component.PipelineID]struct{}{ diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index f1d5f06e1c6..de4f1bd1777 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -145,12 +145,12 @@ func TestGraphStartStop(t *testing.T) { pg := &Graph{componentGraph: simple.NewDirectedGraph()} pg.telemetry = servicetelemetry.NewNopTelemetrySettings() - pg.instanceIDs = make(map[int64]*component.InstanceID) + pg.instanceIDs = make(map[int64]*pipelines.InstanceID) for _, edge := range tt.edges { f, t := &testNode{id: edge[0]}, &testNode{id: edge[1]} - pg.instanceIDs[f.ID()] = &component.InstanceID{} - pg.instanceIDs[t.ID()] = &component.InstanceID{} + pg.instanceIDs[f.ID()] = &pipelines.InstanceID{} + pg.instanceIDs[t.ID()] = &pipelines.InstanceID{} pg.componentGraph.SetEdge(simple.Edge{F: f, T: t}) } @@ -176,7 +176,7 @@ func TestGraphStartStopCycle(t *testing.T) { c1 := &testNode{id: component.MustNewIDWithName("c", "1")} e1 := &testNode{id: component.MustNewIDWithName("e", "1")} - pg.instanceIDs = map[int64]*component.InstanceID{ + pg.instanceIDs = map[int64]*pipelines.InstanceID{ r1.ID(): {}, p1.ID(): {}, c1.ID(): {}, @@ -208,7 +208,7 @@ func TestGraphStartStopComponentError(t *testing.T) { id: component.MustNewIDWithName("e", "1"), shutdownErr: errors.New("bar"), } - pg.instanceIDs = map[int64]*component.InstanceID{ + pg.instanceIDs = map[int64]*pipelines.InstanceID{ r1.ID(): {}, e1.ID(): {}, } @@ -2213,7 +2213,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { eStErr := &testNode{id: component.MustNewIDWithName("e_st_err", "1"), startErr: assert.AnError} eSdErr := &testNode{id: component.MustNewIDWithName("e_sd_err", "1"), shutdownErr: assert.AnError} - instanceIDs := map[*testNode]*component.InstanceID{ + instanceIDs := map[*testNode]*pipelines.InstanceID{ rNoErr: {ID: rNoErr.id}, rStErr: {ID: rStErr.id}, rSdErr: {ID: rSdErr.id}, @@ -2223,7 +2223,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { } // compare two maps of status events ignoring timestamp - assertEqualStatuses := func(t *testing.T, evMap1, evMap2 map[*component.InstanceID][]*component.StatusEvent) { + assertEqualStatuses := func(t *testing.T, evMap1, evMap2 map[*pipelines.InstanceID][]*component.StatusEvent) { assert.Equal(t, len(evMap1), len(evMap2)) for id, evts1 := range evMap1 { evts2 := evMap2[id] @@ -2241,14 +2241,14 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { for _, tc := range []struct { name string edge [2]*testNode - expectedStatuses map[*component.InstanceID][]*component.StatusEvent + expectedStatuses map[*pipelines.InstanceID][]*component.StatusEvent startupErr error shutdownErr error }{ { name: "successful startup/shutdown", edge: [2]*testNode{rNoErr, eNoErr}, - expectedStatuses: map[*component.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ instanceIDs[rNoErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2266,7 +2266,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "early startup error", edge: [2]*testNode{rNoErr, eStErr}, - expectedStatuses: map[*component.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ instanceIDs[eStErr]: { component.NewStatusEvent(component.StatusStarting), component.NewPermanentErrorEvent(assert.AnError), @@ -2277,7 +2277,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "late startup error", edge: [2]*testNode{rStErr, eNoErr}, - expectedStatuses: map[*component.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ instanceIDs[rStErr]: { component.NewStatusEvent(component.StatusStarting), component.NewPermanentErrorEvent(assert.AnError), @@ -2294,7 +2294,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "early shutdown error", edge: [2]*testNode{rSdErr, eNoErr}, - expectedStatuses: map[*component.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ instanceIDs[rSdErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2313,7 +2313,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "late shutdown error", edge: [2]*testNode{rNoErr, eSdErr}, - expectedStatuses: map[*component.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ instanceIDs[rNoErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2334,8 +2334,8 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { pg := &Graph{componentGraph: simple.NewDirectedGraph()} pg.telemetry = servicetelemetry.NewNopTelemetrySettings() - actualStatuses := make(map[*component.InstanceID][]*component.StatusEvent) - rep := status.NewReporter(func(id *component.InstanceID, ev *component.StatusEvent) { + actualStatuses := make(map[*pipelines.InstanceID][]*component.StatusEvent) + rep := status.NewReporter(func(id *pipelines.InstanceID, ev *component.StatusEvent) { actualStatuses[id] = append(actualStatuses[id], ev) }, func(error) { }) @@ -2344,7 +2344,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { rep.Ready() e0, e1 := tc.edge[0], tc.edge[1] - pg.instanceIDs = map[int64]*component.InstanceID{ + pg.instanceIDs = map[int64]*pipelines.InstanceID{ e0.ID(): instanceIDs[e0], e1.ID(): instanceIDs[e1], } diff --git a/service/internal/proctelemetry/process_telemetry.go b/service/internal/proctelemetry/process_telemetry.go index 9f8f0874e97..62cafb3023d 100644 --- a/service/internal/proctelemetry/process_telemetry.go +++ b/service/internal/proctelemetry/process_telemetry.go @@ -13,9 +13,9 @@ import ( "github.com/shirou/gopsutil/v3/common" "github.com/shirou/gopsutil/v3/process" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/service/internal/metadata" "go.opentelemetry.io/collector/service/internal/servicetelemetry" + "go.opentelemetry.io/collector/service/pipelines" ) // processMetrics is a struct that contains views related to process metrics (cpu, mem, etc) @@ -76,7 +76,7 @@ func RegisterProcessMetrics(cfg servicetelemetry.TelemetrySettings, ballastSizeB return err } - _, err = metadata.NewTelemetryBuilder(cfg.ToComponentTelemetrySettings(&component.InstanceID{}), + _, err = metadata.NewTelemetryBuilder(cfg.ToComponentTelemetrySettings(&pipelines.InstanceID{}), metadata.WithProcessUptimeCallback(pm.updateProcessUptime), metadata.WithProcessRuntimeHeapAllocBytesCallback(pm.updateAllocMem), metadata.WithProcessRuntimeTotalAllocBytesCallback(pm.updateTotalAllocMem), diff --git a/service/internal/servicetelemetry/nop_telemetry_settings.go b/service/internal/servicetelemetry/nop_telemetry_settings.go index 116554a51f8..b17d9820831 100644 --- a/service/internal/servicetelemetry/nop_telemetry_settings.go +++ b/service/internal/servicetelemetry/nop_telemetry_settings.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/service/internal/status" + "go.opentelemetry.io/collector/service/pipelines" ) // NewNopTelemetrySettings returns a new nop settings for Create* functions. @@ -22,6 +23,6 @@ func NewNopTelemetrySettings() TelemetrySettings { MeterProvider: noopmetric.NewMeterProvider(), MetricsLevel: configtelemetry.LevelNone, Resource: pcommon.NewResource(), - Status: status.NewReporter(func(*component.InstanceID, *component.StatusEvent) {}, func(error) {}), + Status: status.NewReporter(func(*pipelines.InstanceID, *component.StatusEvent) {}, func(error) {}), } } diff --git a/service/internal/servicetelemetry/nop_telemetry_settings_test.go b/service/internal/servicetelemetry/nop_telemetry_settings_test.go index 8c4a401e0f0..2efe82f97d7 100644 --- a/service/internal/servicetelemetry/nop_telemetry_settings_test.go +++ b/service/internal/servicetelemetry/nop_telemetry_settings_test.go @@ -14,6 +14,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/service/pipelines" ) func TestNewNopSettings(t *testing.T) { @@ -27,9 +28,9 @@ func TestNewNopSettings(t *testing.T) { require.Equal(t, configtelemetry.LevelNone, set.MetricsLevel) require.Equal(t, pcommon.NewResource(), set.Resource) set.Status.ReportStatus( - &component.InstanceID{}, + &pipelines.InstanceID{}, component.NewStatusEvent(component.StatusStarting), ) - set.Status.ReportOKIfStarting(&component.InstanceID{}) + set.Status.ReportOKIfStarting(&pipelines.InstanceID{}) } diff --git a/service/internal/servicetelemetry/telemetry_settings.go b/service/internal/servicetelemetry/telemetry_settings.go index 55c6b9f3962..320a37db216 100644 --- a/service/internal/servicetelemetry/telemetry_settings.go +++ b/service/internal/servicetelemetry/telemetry_settings.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/service/internal/status" + "go.opentelemetry.io/collector/service/pipelines" ) // TelemetrySettings mirrors component.TelemetrySettings except for the mechanism for reporting @@ -42,7 +43,7 @@ type TelemetrySettings struct { // ToComponentTelemetrySettings returns a TelemetrySettings for a specific component derived from // this service level Settings object. -func (s TelemetrySettings) ToComponentTelemetrySettings(id *component.InstanceID) component.TelemetrySettings { +func (s TelemetrySettings) ToComponentTelemetrySettings(id *pipelines.InstanceID) component.TelemetrySettings { statusFunc := status.NewReportStatusFunc(id, s.Status.ReportStatus) return component.TelemetrySettings{ Logger: s.Logger, diff --git a/service/internal/servicetelemetry/telemetry_settings_test.go b/service/internal/servicetelemetry/telemetry_settings_test.go index 5aad2c6c2b6..b3068a61c4d 100644 --- a/service/internal/servicetelemetry/telemetry_settings_test.go +++ b/service/internal/servicetelemetry/telemetry_settings_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/service/internal/status" + "go.opentelemetry.io/collector/service/pipelines" ) func TestSettings(t *testing.T) { @@ -25,16 +26,16 @@ func TestSettings(t *testing.T) { MetricsLevel: configtelemetry.LevelNone, Resource: pcommon.NewResource(), Status: status.NewReporter( - func(*component.InstanceID, *component.StatusEvent) {}, + func(*pipelines.InstanceID, *component.StatusEvent) {}, func(err error) { require.NoError(t, err) }), } set.Status.Ready() set.Status.ReportStatus( - &component.InstanceID{}, + &pipelines.InstanceID{}, component.NewStatusEvent(component.StatusStarting), ) - set.Status.ReportOKIfStarting(&component.InstanceID{}) + set.Status.ReportOKIfStarting(&pipelines.InstanceID{}) - compSet := set.ToComponentTelemetrySettings(&component.InstanceID{}) + compSet := set.ToComponentTelemetrySettings(&pipelines.InstanceID{}) compSet.ReportStatus(component.NewStatusEvent(component.StatusStarting)) } diff --git a/service/internal/status/status.go b/service/internal/status/status.go index e1d524906e5..b31f59eabd1 100644 --- a/service/internal/status/status.go +++ b/service/internal/status/status.go @@ -9,6 +9,7 @@ import ( "sync" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/service/pipelines" ) // onTransitionFunc receives a component.StatusEvent on a successful state transition @@ -84,13 +85,13 @@ func newFSM(onTransition onTransitionFunc) *fsm { } // NotifyStatusFunc is the receiver of status events after successful state transitions -type NotifyStatusFunc func(*component.InstanceID, *component.StatusEvent) +type NotifyStatusFunc func(*pipelines.InstanceID, *component.StatusEvent) // InvalidTransitionFunc is the receiver of invalid transition errors type InvalidTransitionFunc func(error) // ServiceStatusFunc is the expected type of ReportStatus for servicetelemetry.Settings -type ServiceStatusFunc func(*component.InstanceID, *component.StatusEvent) +type ServiceStatusFunc func(*pipelines.InstanceID, *component.StatusEvent) // ErrStatusNotReady is returned when trying to report status before service start var ErrStatusNotReady = errors.New("report component status is not ready until service start") @@ -99,7 +100,7 @@ var ErrStatusNotReady = errors.New("report component status is not ready until s type Reporter struct { mu sync.Mutex ready bool - fsmMap map[*component.InstanceID]*fsm + fsmMap map[*pipelines.InstanceID]*fsm onStatusChange NotifyStatusFunc onInvalidTransition InvalidTransitionFunc } @@ -108,7 +109,7 @@ type Reporter struct { // has changed. func NewReporter(onStatusChange NotifyStatusFunc, onInvalidTransition InvalidTransitionFunc) *Reporter { return &Reporter{ - fsmMap: make(map[*component.InstanceID]*fsm), + fsmMap: make(map[*pipelines.InstanceID]*fsm), onStatusChange: onStatusChange, onInvalidTransition: onInvalidTransition, } @@ -123,7 +124,7 @@ func (r *Reporter) Ready() { // ReportStatus reports status for the given InstanceID func (r *Reporter) ReportStatus( - id *component.InstanceID, + id *pipelines.InstanceID, ev *component.StatusEvent, ) { r.mu.Lock() @@ -137,7 +138,7 @@ func (r *Reporter) ReportStatus( } } -func (r *Reporter) ReportOKIfStarting(id *component.InstanceID) { +func (r *Reporter) ReportOKIfStarting(id *pipelines.InstanceID) { r.mu.Lock() defer r.mu.Unlock() if !r.ready { @@ -152,7 +153,7 @@ func (r *Reporter) ReportOKIfStarting(id *component.InstanceID) { } // Note: a lock must be acquired before calling this method. -func (r *Reporter) componentFSM(id *component.InstanceID) *fsm { +func (r *Reporter) componentFSM(id *pipelines.InstanceID) *fsm { fsm, ok := r.fsmMap[id] if !ok { fsm = newFSM(func(ev *component.StatusEvent) { r.onStatusChange(id, ev) }) @@ -165,7 +166,7 @@ func (r *Reporter) componentFSM(id *component.InstanceID) *fsm { // component.TelemetrySettings, which differs from servicetelemetry.Settings in that // the component version is tied to specific component instance. func NewReportStatusFunc( - id *component.InstanceID, + id *pipelines.InstanceID, srvStatus ServiceStatusFunc, ) func(*component.StatusEvent) { return func(ev *component.StatusEvent) { diff --git a/service/internal/status/status_test.go b/service/internal/status/status_test.go index c31c649e496..85777376e9d 100644 --- a/service/internal/status/status_test.go +++ b/service/internal/status/status_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/service/pipelines" ) func TestStatusFSM(t *testing.T) { @@ -179,11 +180,11 @@ func TestValidSeqsToStopped(t *testing.T) { } func TestStatusFuncs(t *testing.T) { - id1 := &component.InstanceID{} - id2 := &component.InstanceID{} + id1 := &pipelines.InstanceID{} + id2 := &pipelines.InstanceID{} - actualStatuses := make(map[*component.InstanceID][]component.Status) - statusFunc := func(id *component.InstanceID, ev *component.StatusEvent) { + actualStatuses := make(map[*pipelines.InstanceID][]component.Status) + statusFunc := func(id *pipelines.InstanceID, ev *component.StatusEvent) { actualStatuses[id] = append(actualStatuses[id], ev.Status()) } @@ -203,7 +204,7 @@ func TestStatusFuncs(t *testing.T) { component.StatusStopped, } - expectedStatuses := map[*component.InstanceID][]component.Status{ + expectedStatuses := map[*pipelines.InstanceID][]component.Status{ id1: statuses1, id2: statuses2, } @@ -228,9 +229,9 @@ func TestStatusFuncs(t *testing.T) { } func TestStatusFuncsConcurrent(t *testing.T) { - ids := []*component.InstanceID{{}, {}, {}, {}} + ids := []*pipelines.InstanceID{{}, {}, {}, {}} count := 0 - statusFunc := func(*component.InstanceID, *component.StatusEvent) { + statusFunc := func(*pipelines.InstanceID, *component.StatusEvent) { count++ } rep := NewReporter(statusFunc, @@ -260,13 +261,13 @@ func TestStatusFuncsConcurrent(t *testing.T) { } func TestReporterReady(t *testing.T) { - statusFunc := func(*component.InstanceID, *component.StatusEvent) {} + statusFunc := func(*pipelines.InstanceID, *component.StatusEvent) {} var err error rep := NewReporter(statusFunc, func(e error) { err = e }) - id := &component.InstanceID{} + id := &pipelines.InstanceID{} rep.ReportStatus(id, component.NewStatusEvent(component.StatusStarting)) require.ErrorIs(t, err, ErrStatusNotReady) @@ -331,7 +332,7 @@ func TestReportComponentOKIfStarting(t *testing.T) { var receivedStatuses []component.Status rep := NewReporter( - func(_ *component.InstanceID, ev *component.StatusEvent) { + func(_ *pipelines.InstanceID, ev *component.StatusEvent) { receivedStatuses = append(receivedStatuses, ev.Status()) }, func(err error) { @@ -340,7 +341,7 @@ func TestReportComponentOKIfStarting(t *testing.T) { ) rep.Ready() - id := &component.InstanceID{} + id := &pipelines.InstanceID{} for _, status := range tc.initialStatuses { rep.ReportStatus(id, component.NewStatusEvent(status)) } diff --git a/service/pipelines/config.go b/service/pipelines/config.go index 3beb9714305..2d4e1f66ec4 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -71,3 +71,10 @@ func (cfg *PipelineConfig) Validate() error { return nil } + +// InstanceID uniquely identifies a component instance +type InstanceID struct { + ID component.ID + Kind component.Kind + PipelineIDs map[component.PipelineID]struct{} +} diff --git a/service/service_test.go b/service/service_test.go index 5e45fcc125a..d9641c7ffa1 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -422,7 +422,7 @@ func TestServiceFatalError(t *testing.T) { go func() { ev := component.NewFatalErrorEvent(assert.AnError) - srv.host.notifyComponentStatusChange(&component.InstanceID{}, ev) + srv.host.notifyComponentStatusChange(&pipelines.InstanceID{}, ev) }() err = <-srv.host.asyncErrorChannel From 304d0b021d9313add4231871bf187e84106ab768 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Mon, 10 Jun 2024 18:39:48 -0400 Subject: [PATCH 23/38] go.mod tidy --- cmd/mdatagen/go.mod | 18 ++++++++++- cmd/mdatagen/go.sum | 4 +-- component/go.mod | 6 ++-- component/go.sum | 12 +++---- component/status_test.go | 42 ++++++++++++------------- config/configauth/go.mod | 35 ++++++++++++++++++--- config/configauth/go.sum | 16 +++++----- config/configgrpc/go.mod | 19 ++++++++++- config/configgrpc/go.sum | 4 +-- config/confighttp/go.mod | 21 ++++++++++++- config/internal/go.mod | 20 ++++++++++++ connector/forwardconnector/go.mod | 20 +++++++++++- connector/forwardconnector/go.sum | 4 +-- connector/go.mod | 20 +++++++++++- connector/go.sum | 4 +-- exporter/debugexporter/go.mod | 13 ++++++++ exporter/go.mod | 13 ++++++++ exporter/loggingexporter/go.mod | 13 ++++++++ exporter/nopexporter/go.mod | 12 +++++++ exporter/otlpexporter/go.mod | 11 +++++++ exporter/otlphttpexporter/go.mod | 13 ++++++++ extension/auth/go.mod | 35 ++++++++++++++++++--- extension/auth/go.sum | 16 +++++----- extension/ballastextension/go.mod | 21 ++++++++++++- extension/ballastextension/go.sum | 4 +-- extension/go.mod | 35 ++++++++++++++++++--- extension/go.sum | 16 +++++----- extension/memorylimiterextension/go.mod | 21 ++++++++++++- extension/memorylimiterextension/go.sum | 4 +-- extension/zpagesextension/go.mod | 17 +++++++++- extension/zpagesextension/go.sum | 4 +-- go.mod | 23 +++++++++++++- go.sum | 4 +-- internal/e2e/go.mod | 11 +++++++ processor/batchprocessor/go.mod | 20 +++++++++++- processor/batchprocessor/go.sum | 4 +-- processor/go.mod | 20 +++++++++++- processor/go.sum | 4 +-- processor/memorylimiterprocessor/go.mod | 20 +++++++++++- processor/memorylimiterprocessor/go.sum | 4 +-- receiver/go.mod | 20 +++++++++++- receiver/go.sum | 4 +-- receiver/nopreceiver/go.mod | 20 +++++++++++- receiver/nopreceiver/go.sum | 4 +-- receiver/otlpreceiver/go.mod | 15 +++++++++ 45 files changed, 559 insertions(+), 107 deletions(-) diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index e258d63a5fe..3ad686c5b67 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -49,7 +49,7 @@ require ( go.opentelemetry.io/otel/sdk v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect @@ -85,3 +85,19 @@ retract ( v0.76.1 v0.65.0 ) + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/extension => ../../extension diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum index 4a4d76787c8..06e51927203 100644 --- a/cmd/mdatagen/go.sum +++ b/cmd/mdatagen/go.sum @@ -95,8 +95,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= diff --git a/component/go.mod b/component/go.mod index a870abba8d2..1601e457c12 100644 --- a/component/go.mod +++ b/component/go.mod @@ -29,10 +29,10 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/component/go.sum b/component/go.sum index ec205ab4aba..6aaa629aaa1 100644 --- a/component/go.sum +++ b/component/go.sum @@ -62,8 +62,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -74,8 +74,8 @@ golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -84,8 +84,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= diff --git a/component/status_test.go b/component/status_test.go index 6ce727f4411..20efad283f8 100644 --- a/component/status_test.go +++ b/component/status_test.go @@ -9,8 +9,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "go.opentelemetry.io/collector/service/pipelines" ) func TestNewStatusEvent(t *testing.T) { @@ -54,12 +52,12 @@ func TestStatusEventsWithError(t *testing.T) { func TestAggregateStatus(t *testing.T) { for _, tc := range []struct { name string - statusMap map[*pipelines.InstanceID]*StatusEvent + statusMap map[*ID]*StatusEvent expectedStatus Status }{ { name: "aggregate status with fatal is FatalError", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusFatalError), @@ -69,7 +67,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with permanent is PermanentError", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusPermanentError), @@ -79,7 +77,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with stopping is Stopping", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -89,7 +87,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with stopped and non-stopped is Stopping", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -99,7 +97,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with all stopped is Stopped", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStopped), {}: NewStatusEvent(StatusStopped), {}: NewStatusEvent(StatusStopped), @@ -108,7 +106,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with recoverable is RecoverableError", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -117,7 +115,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with starting is Starting", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), }, @@ -125,7 +123,7 @@ func TestAggregateStatus(t *testing.T) { }, { name: "aggregate status with all ok is OK", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusOK), @@ -191,12 +189,12 @@ func TestAggregateStatusEvent(t *testing.T) { for _, tc := range []struct { name string - statusMap map[*pipelines.InstanceID]*StatusEvent + statusMap map[*ID]*StatusEvent expectedStatus *StatusEvent }{ { name: "FatalError - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewFatalErrorEvent(assert.AnError)), @@ -210,7 +208,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "FatalError - synthetic event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewFatalErrorEvent(assert.AnError), @@ -224,7 +222,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "PermanentError - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewPermanentErrorEvent(assert.AnError)), @@ -238,7 +236,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "PermanentError - synthetic event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewPermanentErrorEvent(assert.AnError), @@ -252,7 +250,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopping - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -265,7 +263,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopping - synthetic event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: NewStatusEvent(StatusRecoverableError), @@ -278,7 +276,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Stopped - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStopped), {}: latest(NewStatusEvent(StatusStopped)), {}: NewStatusEvent(StatusStopped), @@ -290,7 +288,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "RecoverableError - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: NewStatusEvent(StatusOK), {}: latest(NewRecoverableErrorEvent(assert.AnError)), @@ -303,7 +301,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "Starting - synthetic event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusStarting), {}: latest(NewStatusEvent(StatusOK)), }, @@ -314,7 +312,7 @@ func TestAggregateStatusEvent(t *testing.T) { }, { name: "OK - existing event", - statusMap: map[*pipelines.InstanceID]*StatusEvent{ + statusMap: map[*ID]*StatusEvent{ {}: NewStatusEvent(StatusOK), {}: latest(NewStatusEvent(StatusOK)), {}: NewStatusEvent(StatusOK), diff --git a/config/configauth/go.mod b/config/configauth/go.mod index 2d92d1b09cf..a6af59491ae 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -23,15 +23,16 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -43,8 +44,34 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/component => ../../component +replace go.opentelemetry.io/collector/service => ../../service + replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemetry replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/consumer => ../../consumer + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/config/confignet => ../confignet + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/config/configretry => ../configretry + +replace go.opentelemetry.io/collector => ../.. + +replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/connector => ../../connector diff --git a/config/configauth/go.sum b/config/configauth/go.sum index f058d94d6ae..b5d3fe5ff45 100644 --- a/config/configauth/go.sum +++ b/config/configauth/go.sum @@ -73,20 +73,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -95,8 +95,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index a22e4b507ff..65cb5caf865 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -52,6 +52,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect @@ -59,7 +60,7 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.1 // indirect @@ -97,3 +98,19 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/consumer => ../../consumer + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/config/configretry => ../configretry + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/processor => ../../processor diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum index dc78c6d50d7..d730c5b0e68 100644 --- a/config/configgrpc/go.sum +++ b/config/configgrpc/go.sum @@ -105,8 +105,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index 0076f421a53..105d2c8efaa 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -48,6 +48,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect @@ -88,6 +89,24 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/consumer => ../../consumer +replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/config/configretry => ../configretry + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/config/confignet => ../confignet + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/consumer => ../../consumer diff --git a/config/internal/go.mod b/config/internal/go.mod index bc1c7f91db0..6d228ffd2e8 100644 --- a/config/internal/go.mod +++ b/config/internal/go.mod @@ -33,3 +33,23 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/config/confignet => ../confignet + +replace go.opentelemetry.io/collector/config/configretry => ../configretry + +replace go.opentelemetry.io/collector/connector => ../../connector diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index ad2489afc17..4346bba4169 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -45,7 +45,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -75,3 +75,21 @@ retract ( ) replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry diff --git a/connector/forwardconnector/go.sum b/connector/forwardconnector/go.sum index ace4d10d26a..f8409145e25 100644 --- a/connector/forwardconnector/go.sum +++ b/connector/forwardconnector/go.sum @@ -95,8 +95,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/connector/go.mod b/connector/go.mod index c636056da7c..1d1d5e3ca79 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -38,7 +38,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect go.opentelemetry.io/otel/trace v1.27.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -61,3 +61,21 @@ replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata + +replace go.opentelemetry.io/collector/service => ../service + +replace go.opentelemetry.io/collector/receiver => ../receiver + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension + +replace go.opentelemetry.io/collector/semconv => ../semconv + +replace go.opentelemetry.io/collector/exporter => ../exporter + +replace go.opentelemetry.io/collector/processor => ../processor + +replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/config/confignet => ../config/confignet + +replace go.opentelemetry.io/collector/extension => ../extension diff --git a/connector/go.sum b/connector/go.sum index aaa6afbf77b..19e96b90dbe 100644 --- a/connector/go.sum +++ b/connector/go.sum @@ -83,8 +83,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index bb18171ce89..3dbadfe18db 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -42,6 +42,7 @@ require ( go.opentelemetry.io/collector/config/configretry v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -81,3 +82,15 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension diff --git a/exporter/go.mod b/exporter/go.mod index e015b48b82d..8cd0d780ac1 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -49,6 +49,7 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect golang.org/x/net v0.25.0 // indirect golang.org/x/text v0.15.0 // indirect @@ -80,3 +81,15 @@ retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/config/configretry => ../config/configretry replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry + +replace go.opentelemetry.io/collector/service => ../service + +replace go.opentelemetry.io/collector/processor => ../processor + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension + +replace go.opentelemetry.io/collector/semconv => ../semconv + +replace go.opentelemetry.io/collector/connector => ../connector + +replace go.opentelemetry.io/collector/config/confignet => ../config/confignet diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index 8a9989c35b7..b7787c7d69c 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -42,6 +42,7 @@ require ( go.opentelemetry.io/collector/consumer v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -86,3 +87,15 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index d9740d3d54c..e2c6eb0f3c1 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -76,3 +76,15 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/processor => ../../processor diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index e60c40d1e3a..03532f12412 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -60,6 +60,7 @@ require ( go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect @@ -128,3 +129,13 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 166771069a2..d5912e60914 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -59,6 +59,7 @@ require ( go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect @@ -125,3 +126,15 @@ retract ( ) replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/processor => ../../processor diff --git a/extension/auth/go.mod b/extension/auth/go.mod index fb61f5aed5b..e60bddd5caa 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -31,6 +31,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -39,10 +40,10 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -56,3 +57,29 @@ 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/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension + +replace go.opentelemetry.io/collector/consumer => ../../consumer + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector => ../.. + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/exporter => ../../exporter diff --git a/extension/auth/go.sum b/extension/auth/go.sum index 000c077e9bc..8b06a611e09 100644 --- a/extension/auth/go.sum +++ b/extension/auth/go.sum @@ -74,20 +74,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -96,8 +96,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index c0715c58028..663913f19e2 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -41,6 +41,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -49,7 +50,7 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -79,3 +80,21 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension diff --git a/extension/ballastextension/go.sum b/extension/ballastextension/go.sum index 561e60dbea4..6c8b57d0c17 100644 --- a/extension/ballastextension/go.sum +++ b/extension/ballastextension/go.sum @@ -103,8 +103,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/extension/go.mod b/extension/go.mod index a681c080970..81ee85ac8ec 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -7,6 +7,7 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.1 go.opentelemetry.io/collector/confmap v0.102.1 + go.opentelemetry.io/collector/service v0.102.1 go.uber.org/goleak v1.3.0 ) @@ -38,10 +39,10 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -54,3 +55,29 @@ replace go.opentelemetry.io/collector/confmap => ../confmap replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry + +replace go.opentelemetry.io/collector/exporter => ../exporter + +replace go.opentelemetry.io/collector => ../ + +replace go.opentelemetry.io/collector/service => ../service + +replace go.opentelemetry.io/collector/processor => ../processor + +replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata + +replace go.opentelemetry.io/collector/semconv => ../semconv + +replace go.opentelemetry.io/collector/featuregate => ../featuregate + +replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/connector => ../connector + +replace go.opentelemetry.io/collector/consumer => ../consumer + +replace go.opentelemetry.io/collector/config/confignet => ../config/confignet + +replace go.opentelemetry.io/collector/receiver => ../receiver + +replace go.opentelemetry.io/collector/extension/zpagesextension => ./zpagesextension diff --git a/extension/go.sum b/extension/go.sum index 3ca262fb778..f55144304f8 100644 --- a/extension/go.sum +++ b/extension/go.sum @@ -76,20 +76,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -98,8 +98,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index 2b68dbae290..27dee12fedc 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -40,6 +40,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -48,7 +49,7 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -73,3 +74,21 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/connector => ../../connector diff --git a/extension/memorylimiterextension/go.sum b/extension/memorylimiterextension/go.sum index 561e60dbea4..6c8b57d0c17 100644 --- a/extension/memorylimiterextension/go.sum +++ b/extension/memorylimiterextension/go.sum @@ -103,8 +103,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index f44f97d235f..be45952e494 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -39,6 +39,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect @@ -54,7 +55,7 @@ require ( go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect @@ -87,3 +88,17 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/processor => ../../processor diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 175064a2c97..50dd3b2668a 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -108,8 +108,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/go.mod b/go.mod index b4c6bab7f18..1e8e6a1d690 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 go.opentelemetry.io/collector/pdata v1.9.0 go.opentelemetry.io/collector/pdata/testdata v0.102.1 + go.opentelemetry.io/collector/service v0.102.1 go.opentelemetry.io/contrib/config v0.7.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 @@ -72,7 +73,7 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect @@ -101,3 +102,23 @@ retract ( v0.57.0 // Release failed, use v0.57.2 v0.32.0 // Contains incomplete metrics transition to proto 0.9.0, random components are not working. ) + +replace go.opentelemetry.io/collector/extension/zpagesextension => ./extension/zpagesextension + +replace go.opentelemetry.io/collector/exporter => ./exporter + +replace go.opentelemetry.io/collector/receiver => ./receiver + +replace go.opentelemetry.io/collector/config/configretry => ./config/configretry + +replace go.opentelemetry.io/collector/connector => ./connector + +replace go.opentelemetry.io/collector/service => ./service + +replace go.opentelemetry.io/collector/semconv => ./semconv + +replace go.opentelemetry.io/collector/processor => ./processor + +replace go.opentelemetry.io/collector/extension => ./extension + +replace go.opentelemetry.io/collector/config/confignet => ./config/confignet diff --git a/go.sum b/go.sum index 060e6a0293f..f0ee94fabc3 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index ae78f5fb268..410c451ede0 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -62,6 +62,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect @@ -138,3 +139,13 @@ replace go.opentelemetry.io/collector/exporter => ../../exporter replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/semconv => ../../semconv diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index d64b1e53b17..3cd9158c290 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel/sdk v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -76,3 +76,21 @@ retract ( ) replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/connector => ../../connector diff --git a/processor/batchprocessor/go.sum b/processor/batchprocessor/go.sum index ace4d10d26a..f8409145e25 100644 --- a/processor/batchprocessor/go.sum +++ b/processor/batchprocessor/go.sum @@ -95,8 +95,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/processor/go.mod b/processor/go.mod index eb908c75d49..892e0d8fc2f 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -38,7 +38,7 @@ require ( go.opentelemetry.io/otel/sdk v1.27.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -61,3 +61,21 @@ replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry + +replace go.opentelemetry.io/collector/semconv => ../semconv + +replace go.opentelemetry.io/collector/receiver => ../receiver + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension + +replace go.opentelemetry.io/collector/extension => ../extension + +replace go.opentelemetry.io/collector/config/confignet => ../config/confignet + +replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/connector => ../connector + +replace go.opentelemetry.io/collector/exporter => ../exporter + +replace go.opentelemetry.io/collector/service => ../service diff --git a/processor/go.sum b/processor/go.sum index aaa6afbf77b..19e96b90dbe 100644 --- a/processor/go.sum +++ b/processor/go.sum @@ -83,8 +83,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index aa890028df6..48082d80800 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -53,7 +53,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -83,3 +83,21 @@ retract ( ) replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry + +replace go.opentelemetry.io/collector/receiver => ../../receiver + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry diff --git a/processor/memorylimiterprocessor/go.sum b/processor/memorylimiterprocessor/go.sum index 721c7422dea..93477b212e6 100644 --- a/processor/memorylimiterprocessor/go.sum +++ b/processor/memorylimiterprocessor/go.sum @@ -114,8 +114,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/receiver/go.mod b/receiver/go.mod index e40ddd8725b..33ec680fe02 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -37,7 +37,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -62,3 +62,21 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry + +replace go.opentelemetry.io/collector/service => ../service + +replace go.opentelemetry.io/collector/semconv => ../semconv + +replace go.opentelemetry.io/collector/config/confignet => ../config/confignet + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension + +replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/extension => ../extension + +replace go.opentelemetry.io/collector/exporter => ../exporter + +replace go.opentelemetry.io/collector/processor => ../processor + +replace go.opentelemetry.io/collector/connector => ../connector diff --git a/receiver/go.sum b/receiver/go.sum index aaa6afbf77b..19e96b90dbe 100644 --- a/receiver/go.sum +++ b/receiver/go.sum @@ -83,8 +83,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 12792d8f460..2d84e4d8854 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -44,7 +44,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -69,3 +69,21 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector => ../.. replace go.opentelemetry.io/collector/featuregate => ../../featuregate + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/extension => ../../extension diff --git a/receiver/nopreceiver/go.sum b/receiver/nopreceiver/go.sum index ace4d10d26a..f8409145e25 100644 --- a/receiver/nopreceiver/go.sum +++ b/receiver/nopreceiver/go.sum @@ -95,8 +95,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 3a2e0a11d83..11925f367d1 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -61,6 +61,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect @@ -128,3 +129,17 @@ 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/processor => ../../processor + +replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension From 6a94f32aaf42b8151a958f68790f2672b12b68e3 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 14:51:47 -0400 Subject: [PATCH 24/38] separator is public --- component/identifiable.go | 12 ++++++------ component/pipeline.go | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/component/identifiable.go b/component/identifiable.go index 765e906d9e4..d9e2f9d4aae 100644 --- a/component/identifiable.go +++ b/component/identifiable.go @@ -9,8 +9,8 @@ import ( "strings" ) -// typeAndNameSeparator is the separator that is used between type and name in type/name composite keys. -const typeAndNameSeparator = "/" +// TypeAndNameSeparator is the separator that is used between type and name in type/name composite keys. +const TypeAndNameSeparator = "/" // ID represents the identity for a component. It combines two values: // * type - the Type of the component. @@ -63,7 +63,7 @@ func (id ID) MarshalText() (text []byte, err error) { // UnmarshalText implements the encoding.TextUnmarshaler interface. func (id *ID) UnmarshalText(text []byte) error { idStr := string(text) - items := strings.SplitN(idStr, typeAndNameSeparator, 2) + items := strings.SplitN(idStr, TypeAndNameSeparator, 2) var typeStr, nameStr string if len(items) >= 1 { typeStr = strings.TrimSpace(items[0]) @@ -74,14 +74,14 @@ func (id *ID) UnmarshalText(text []byte) error { } if typeStr == "" { - return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, TypeAndNameSeparator) } if len(items) > 1 { // "name" part is present. nameStr = strings.TrimSpace(items[1]) if nameStr == "" { - return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, TypeAndNameSeparator) } } @@ -100,5 +100,5 @@ func (id ID) String() string { return id.typeVal.String() } - return id.typeVal.String() + typeAndNameSeparator + id.nameVal + return id.typeVal.String() + TypeAndNameSeparator + id.nameVal } diff --git a/component/pipeline.go b/component/pipeline.go index f5e279fd941..c50a7608f3c 100644 --- a/component/pipeline.go +++ b/component/pipeline.go @@ -43,7 +43,7 @@ func (id PipelineID) MarshalText() (text []byte, err error) { // UnmarshalText implements the encoding.TextUnmarshaler interface. func (id *PipelineID) UnmarshalText(text []byte) error { idStr := string(text) - items := strings.SplitN(idStr, typeAndNameSeparator, 2) + items := strings.SplitN(idStr, TypeAndNameSeparator, 2) var typeStr, nameStr string if len(items) >= 1 { typeStr = strings.TrimSpace(items[0]) @@ -54,14 +54,14 @@ func (id *PipelineID) UnmarshalText(text []byte) error { } if typeStr == "" { - return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, TypeAndNameSeparator) } if len(items) > 1 { // "name" part is present. nameStr = strings.TrimSpace(items[1]) if nameStr == "" { - return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, TypeAndNameSeparator) } } @@ -81,5 +81,5 @@ func (id PipelineID) String() string { return id.typeVal.String() } - return id.typeVal.String() + typeAndNameSeparator + id.nameVal + return id.typeVal.String() + TypeAndNameSeparator + id.nameVal } From b86c1e42d594bc1b912733b4d68963dbc888e130 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 15:09:57 -0400 Subject: [PATCH 25/38] datatype unmarshal --- component/config.go | 20 ++++++++++++-------- component/config_test.go | 25 +++++++++++++++---------- component/pipeline.go | 5 +++-- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/component/config.go b/component/config.go index d8e3c7078b6..e1228c3c41f 100644 --- a/component/config.go +++ b/component/config.go @@ -172,18 +172,22 @@ func (dt DataType) MarshalText() (text []byte, err error) { return []byte(dt), nil } -func newDataType(ty string) (DataType, error) { - if len(ty) == 0 { - return "", errors.New("id must not be empty") +func (dt *DataType) UnmarshalText(text []byte) error { + if len(text) == 0 { + return errors.New("id must not be empty") } - switch ty { + strText := string(text) + switch strText { case "metrics": - return DataTypeMetrics, nil + *dt = DataTypeMetrics + return nil case "logs": - return DataTypeLogs, nil + *dt = DataTypeLogs + return nil case "traces": - return DataTypeTraces, nil + *dt = DataTypeTraces + return nil default: - return "", fmt.Errorf("invalid data type %s", ty) + return fmt.Errorf("invalid data type %s", strText) } } diff --git a/component/config_test.go b/component/config_test.go index a2d3646a0ae..33ab13fb238 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -422,14 +422,16 @@ func TestNewType(t *testing.T) { } func TestNewDataType(t *testing.T) { - ty, err := newDataType("logs") + var dt DataType + err := dt.UnmarshalText([]byte("logs")) require.NoError(t, err) - assert.Equal(t, ty, DataTypeLogs) + assert.Equal(t, DataTypeLogs, dt) + var dt2 DataType // hopefully this reminds us to update DataType when profiles get included - ty, err = newDataType("profiles") - assert.Equal(t, DataType(""), ty) - assert.Equal(t, err, errors.New("invalid data type profiles")) + err = dt2.UnmarshalText([]byte("profiles")) + assert.Equal(t, DataType(""), dt2) + assert.Equal(t, errors.New("invalid data type profiles"), err) } func TestDataTypeStringMarshal(t *testing.T) { @@ -440,16 +442,19 @@ func TestDataTypeStringMarshal(t *testing.T) { } func TestDataTypeFromSignal(t *testing.T) { - dt, err := newDataType("metrics") + var dt DataType + err := dt.UnmarshalText([]byte("metrics")) assert.Nil(t, err) assert.Equal(t, DataTypeMetrics, dt) - dt, err = newDataType("traces") - assert.Equal(t, DataTypeTraces, dt) + var dt2 DataType + err = dt2.UnmarshalText([]byte("traces")) + assert.Equal(t, DataTypeTraces, dt2) assert.Nil(t, err) - dt, err = newDataType("") + var dt3 DataType + err = dt3.UnmarshalText([]byte("")) assert.Equal(t, errors.New("id must not be empty"), err) - assert.Equal(t, DataType(""), dt) + assert.Equal(t, DataType(""), dt3) } diff --git a/component/pipeline.go b/component/pipeline.go index c50a7608f3c..caf31a796b5 100644 --- a/component/pipeline.go +++ b/component/pipeline.go @@ -66,10 +66,11 @@ func (id *PipelineID) UnmarshalText(text []byte) error { } var err error - - if id.typeVal, err = newDataType(typeStr); err != nil { + var dt DataType + if err = dt.UnmarshalText([]byte(typeStr)); err != nil { return fmt.Errorf("in %q id: %w", idStr, err) } + id.typeVal = dt id.nameVal = nameStr return nil From 777bb206ac5caf61a917427336cb17e7d6798ae4 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 18:05:11 -0400 Subject: [PATCH 26/38] new module --- .../generated_component_test.go | 7 +- connector/logs_router.go | 14 +- connector/logs_router_test.go | 23 +- connector/metrics_router.go | 8 +- connector/metrics_router_test.go | 23 +- connector/router.go | 14 +- connector/traces_router.go | 8 +- connector/traces_router_test.go | 23 +- otelcol/config_test.go | 17 +- otelcol/otelcoltest/config_test.go | 3 +- pipeline/Makefile | 1 + pipeline/go.mod | 3 + pipeline/go.sum | 101 ++++++ {component => pipeline}/pipeline.go | 24 +- {component => pipeline}/pipeline_test.go | 14 +- service/config_test.go | 7 +- service/internal/components/loggers.go | 3 +- service/internal/graph/graph.go | 25 +- service/internal/graph/graph_test.go | 313 +++++++++--------- service/internal/graph/nodes.go | 19 +- .../internal/testcomponents/example_router.go | 5 +- .../testcomponents/example_router_test.go | 19 +- service/pipelines/config.go | 5 +- service/pipelines/config_test.go | 13 +- service/service_test.go | 9 +- 25 files changed, 413 insertions(+), 288 deletions(-) create mode 100644 pipeline/Makefile create mode 100644 pipeline/go.mod create mode 100644 pipeline/go.sum rename {component => pipeline}/pipeline.go (72%) rename {component => pipeline}/pipeline_test.go (77%) diff --git a/connector/forwardconnector/generated_component_test.go b/connector/forwardconnector/generated_component_test.go index 7dc26b62009..992001b2050 100644 --- a/connector/forwardconnector/generated_component_test.go +++ b/connector/forwardconnector/generated_component_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/pipeline" ) func TestComponentFactoryType(t *testing.T) { @@ -36,7 +37,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.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.PipelineID]consumer.Logs{pipeline.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -44,7 +45,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.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.PipelineID]consumer.Metrics{pipeline.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -52,7 +53,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.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.PipelineID]consumer.Traces{pipeline.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, diff --git a/connector/logs_router.go b/connector/logs_router.go index 0d2b31f0e13..77d20fe9bb4 100644 --- a/connector/logs_router.go +++ b/connector/logs_router.go @@ -8,16 +8,16 @@ import ( "go.uber.org/multierr" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/internal/fanoutconsumer" + "go.opentelemetry.io/collector/pipeline" ) // LogsRouterAndConsumer feeds the first consumer.Logs in each of the specified pipelines. type LogsRouterAndConsumer interface { consumer.Logs - Consumer(...component.PipelineID) (consumer.Logs, error) - PipelineIDs() []component.PipelineID + Consumer(...pipeline.PipelineID) (consumer.Logs, error) + PipelineIDs() []pipeline.PipelineID privateFunc() } @@ -26,7 +26,7 @@ type logsRouter struct { baseRouter[consumer.Logs] } -func NewLogsRouter(cm map[component.PipelineID]consumer.Logs) LogsRouterAndConsumer { +func NewLogsRouter(cm map[pipeline.PipelineID]consumer.Logs) LogsRouterAndConsumer { consumers := make([]consumer.Logs, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) @@ -37,15 +37,15 @@ func NewLogsRouter(cm map[component.PipelineID]consumer.Logs) LogsRouterAndConsu } } -func (r *logsRouter) PipelineIDs() []component.PipelineID { - ids := make([]component.PipelineID, 0, len(r.consumers)) +func (r *logsRouter) PipelineIDs() []pipeline.PipelineID { + ids := make([]pipeline.PipelineID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *logsRouter) Consumer(pipelineIDs ...component.PipelineID) (consumer.Logs, error) { +func (r *logsRouter) Consumer(pipelineIDs ...pipeline.PipelineID) (consumer.Logs, error) { if len(pipelineIDs) == 0 { return nil, fmt.Errorf("missing consumers") } diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index aa30685ab5f..82101c04c22 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/testdata" + "go.opentelemetry.io/collector/pipeline" ) type mutatingLogsSink struct { @@ -42,13 +43,13 @@ func TestLogsRouterMultiplexing(t *testing.T) { func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.PipelineID, 0, numCons) + allIDs := make([]pipeline.PipelineID, 0, numCons) allCons := make([]consumer.Logs, 0, numCons) - allConsMap := make(map[component.PipelineID]consumer.Logs) + allConsMap := make(map[pipeline.PipelineID]consumer.Logs) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numLogs+i)%4 == 0 { allCons = append(allCons, &mutatingLogsSink{LogsSink: new(consumertest.LogsSink)}) @@ -63,11 +64,11 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteLogs. - expected := make(map[component.PipelineID]int, numCons) + expected := make(map[pipeline.PipelineID]int, numCons) for i := 0; i < numLogs; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.PipelineID]bool, numIDs) + randCons := make(map[pipeline.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +76,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -108,16 +109,16 @@ func TestLogsRouterConsumers(t *testing.T) { ctx := context.Background() ld := testdata.GenerateLogs(1) - fooID := component.NewPipelineID(component.DataTypeLogs) - barID := component.NewPipelineID(component.DataTypeMetrics) + fooID := pipeline.NewPipelineID(component.DataTypeLogs) + barID := pipeline.NewPipelineID(component.DataTypeMetrics) foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) - r := NewLogsRouter(map[component.PipelineID]consumer.Logs{fooID: foo, barID: bar}) + r := NewLogsRouter(map[pipeline.PipelineID]consumer.Logs{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllLogs(), 0) assert.Len(t, bar.AllLogs(), 0) @@ -150,7 +151,7 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.NewPipelineID(component.DataTypeTraces)) + fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/metrics_router.go b/connector/metrics_router.go index d7d972ae6cb..0dc574b4e7f 100644 --- a/connector/metrics_router.go +++ b/connector/metrics_router.go @@ -4,16 +4,16 @@ package connector // import "go.opentelemetry.io/collector/connector" import ( - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/internal/fanoutconsumer" + "go.opentelemetry.io/collector/pipeline" ) // MetricsRouterAndConsumer feeds the first consumer.Metrics in each of the specified pipelines. type MetricsRouterAndConsumer interface { consumer.Metrics - Consumer(...component.PipelineID) (consumer.Metrics, error) - PipelineIDs() []component.PipelineID + Consumer(...pipeline.PipelineID) (consumer.Metrics, error) + PipelineIDs() []pipeline.PipelineID privateFunc() } @@ -22,7 +22,7 @@ type metricsRouter struct { baseRouter[consumer.Metrics] } -func NewMetricsRouter(cm map[component.PipelineID]consumer.Metrics) MetricsRouterAndConsumer { +func NewMetricsRouter(cm map[pipeline.PipelineID]consumer.Metrics) MetricsRouterAndConsumer { consumers := make([]consumer.Metrics, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index 36316c000c6..c8ff597f541 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/testdata" + "go.opentelemetry.io/collector/pipeline" ) type mutatingMetricsSink struct { @@ -43,13 +44,13 @@ func TestMetricsRouterMultiplexing(t *testing.T) { func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.PipelineID, 0, numCons) + allIDs := make([]pipeline.PipelineID, 0, numCons) allCons := make([]consumer.Metrics, 0, numCons) - allConsMap := make(map[component.PipelineID]consumer.Metrics) + allConsMap := make(map[pipeline.PipelineID]consumer.Metrics) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numMetrics+i)%4 == 0 { allCons = append(allCons, &mutatingMetricsSink{MetricsSink: new(consumertest.MetricsSink)}) @@ -64,11 +65,11 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteMetrics. - expected := make(map[component.PipelineID]int, numCons) + expected := make(map[pipeline.PipelineID]int, numCons) for i := 0; i < numMetrics; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.PipelineID]bool, numIDs) + randCons := make(map[pipeline.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -76,7 +77,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -109,16 +110,16 @@ func TestMetricsRouterConsumers(t *testing.T) { ctx := context.Background() md := testdata.GenerateMetrics(1) - fooID := component.NewPipelineID(component.DataTypeMetrics) - barID := component.NewPipelineID(component.DataTypeTraces) + fooID := pipeline.NewPipelineID(component.DataTypeMetrics) + barID := pipeline.NewPipelineID(component.DataTypeTraces) foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) - r := NewMetricsRouter(map[component.PipelineID]consumer.Metrics{fooID: foo, barID: bar}) + r := NewMetricsRouter(map[pipeline.PipelineID]consumer.Metrics{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllMetrics(), 0) assert.Len(t, bar.AllMetrics(), 0) @@ -151,7 +152,7 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.NewPipelineID(component.DataTypeLogs)) + fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeLogs)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/router.go b/connector/router.go index 65b873fae53..c85f7485e47 100644 --- a/connector/router.go +++ b/connector/router.go @@ -8,31 +8,31 @@ import ( "go.uber.org/multierr" - "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pipeline" ) type baseRouter[T any] struct { fanout func([]T) T - consumers map[component.PipelineID]T + consumers map[pipeline.PipelineID]T } -func newBaseRouter[T any](fanout func([]T) T, cm map[component.PipelineID]T) baseRouter[T] { - consumers := make(map[component.PipelineID]T, len(cm)) +func newBaseRouter[T any](fanout func([]T) T, cm map[pipeline.PipelineID]T) baseRouter[T] { + consumers := make(map[pipeline.PipelineID]T, len(cm)) for k, v := range cm { consumers[k] = v } return baseRouter[T]{fanout: fanout, consumers: consumers} } -func (r *baseRouter[T]) PipelineIDs() []component.PipelineID { - ids := make([]component.PipelineID, 0, len(r.consumers)) +func (r *baseRouter[T]) PipelineIDs() []pipeline.PipelineID { + ids := make([]pipeline.PipelineID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *baseRouter[T]) Consumer(pipelineIDs ...component.PipelineID) (T, error) { +func (r *baseRouter[T]) Consumer(pipelineIDs ...pipeline.PipelineID) (T, error) { var ret T if len(pipelineIDs) == 0 { return ret, fmt.Errorf("missing consumers") diff --git a/connector/traces_router.go b/connector/traces_router.go index 65749f54d15..6f953021de1 100644 --- a/connector/traces_router.go +++ b/connector/traces_router.go @@ -4,16 +4,16 @@ package connector // import "go.opentelemetry.io/collector/connector" import ( - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/internal/fanoutconsumer" + "go.opentelemetry.io/collector/pipeline" ) // TracesRouterAndConsumer feeds the first consumer.Traces in each of the specified pipelines. type TracesRouterAndConsumer interface { consumer.Traces - Consumer(...component.PipelineID) (consumer.Traces, error) - PipelineIDs() []component.PipelineID + Consumer(...pipeline.PipelineID) (consumer.Traces, error) + PipelineIDs() []pipeline.PipelineID privateFunc() } @@ -22,7 +22,7 @@ type tracesRouter struct { baseRouter[consumer.Traces] } -func NewTracesRouter(cm map[component.PipelineID]consumer.Traces) TracesRouterAndConsumer { +func NewTracesRouter(cm map[pipeline.PipelineID]consumer.Traces) TracesRouterAndConsumer { consumers := make([]consumer.Traces, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 2e117ad35e2..857809275b6 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/pdata/testdata" + "go.opentelemetry.io/collector/pipeline" ) type mutatingTracesSink struct { @@ -42,13 +43,13 @@ func TestTracesRouterMultiplexing(t *testing.T) { func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]component.PipelineID, 0, numCons) + allIDs := make([]pipeline.PipelineID, 0, numCons) allCons := make([]consumer.Traces, 0, numCons) - allConsMap := make(map[component.PipelineID]consumer.Traces) + allConsMap := make(map[pipeline.PipelineID]consumer.Traces) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, component.NewPipelineIDWithName(component.DataTypeTraces, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeTraces, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numTraces+i)%4 == 0 { allCons = append(allCons, &mutatingTracesSink{TracesSink: new(consumertest.TracesSink)}) @@ -63,11 +64,11 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteTraces. - expected := make(map[component.PipelineID]int, numCons) + expected := make(map[pipeline.PipelineID]int, numCons) for i := 0; i < numTraces; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[component.PipelineID]bool, numIDs) + randCons := make(map[pipeline.PipelineID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -75,7 +76,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]component.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.PipelineID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -108,16 +109,16 @@ func TestTracesRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateTraces(1) - fooID := component.NewPipelineID(component.DataTypeMetrics) - barID := component.NewPipelineID(component.DataTypeLogs) + fooID := pipeline.NewPipelineID(component.DataTypeMetrics) + barID := pipeline.NewPipelineID(component.DataTypeLogs) foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) - r := NewTracesRouter(map[component.PipelineID]consumer.Traces{fooID: foo, barID: bar}) + r := NewTracesRouter(map[pipeline.PipelineID]consumer.Traces{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []component.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) assert.Len(t, foo.AllTraces(), 0) assert.Len(t, bar.AllTraces(), 0) @@ -150,7 +151,7 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(component.NewPipelineID(component.DataTypeTraces)) + fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/otelcol/config_test.go b/otelcol/config_test.go index 04cd083481c..1d3e77a2da8 100644 --- a/otelcol/config_test.go +++ b/otelcol/config_test.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service" "go.opentelemetry.io/collector/service/pipelines" "go.opentelemetry.io/collector/service/telemetry" @@ -98,7 +99,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-receiver-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -108,7 +109,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -118,7 +119,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-exporter-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -185,7 +186,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Receivers[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -198,7 +199,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Exporters[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -209,7 +210,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -219,7 +220,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -280,7 +281,7 @@ func generateConfig() *Config { }, Extensions: []component.ID{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/otelcol/otelcoltest/config_test.go b/otelcol/otelcoltest/config_test.go index e720b66d73c..b0dd4504440 100644 --- a/otelcol/otelcoltest/config_test.go +++ b/otelcol/otelcoltest/config_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/pipelines" ) @@ -55,7 +56,7 @@ func TestLoadConfig(t *testing.T) { Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - cfg.Service.Pipelines[component.NewPipelineID(component.DataTypeTraces)], + cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)], "Did not load pipeline config correctly") } diff --git a/pipeline/Makefile b/pipeline/Makefile new file mode 100644 index 00000000000..39734bfaebb --- /dev/null +++ b/pipeline/Makefile @@ -0,0 +1 @@ +include ../Makefile.Common diff --git a/pipeline/go.mod b/pipeline/go.mod new file mode 100644 index 00000000000..340247f7024 --- /dev/null +++ b/pipeline/go.mod @@ -0,0 +1,3 @@ +module go.opentelemetry.io/collector/pipeline + +go 1.22.1 diff --git a/pipeline/go.sum b/pipeline/go.sum new file mode 100644 index 00000000000..61b19090630 --- /dev/null +++ b/pipeline/go.sum @@ -0,0 +1,101 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.102.1 h1:66z+LN5dVCXhvuVKD1b56/3cYLK+mtYSLIwlskYA9IQ= +go.opentelemetry.io/collector/component v0.102.1/go.mod h1:XfkiSeImKYaewT2DavA80l0VZ3JjvGndZ8ayPXfp8d0= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1 h1:f/CYcrOkaHd+COIJ2lWnEgBCHfhEycpbow4ZhrGwAlA= +go.opentelemetry.io/collector/config/configtelemetry v0.102.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.102.1 h1:wZuH+d/P11Suz8wbp+xQCJ0BPE9m5pybtUe74c+rU7E= +go.opentelemetry.io/collector/confmap v0.102.1/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= +go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw= +go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/component/pipeline.go b/pipeline/pipeline.go similarity index 72% rename from component/pipeline.go rename to pipeline/pipeline.go index caf31a796b5..4776c2503f0 100644 --- a/component/pipeline.go +++ b/pipeline/pipeline.go @@ -1,21 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package component // import "go.opentelemetry.io/collector/component" +package pipeline // import "go.opentelemetry.io/collector/pipeline" import ( "errors" "fmt" "strings" + + "go.opentelemetry.io/collector/component" ) type PipelineID struct { - typeVal DataType `mapstructure:"-"` - nameVal string `mapstructure:"-"` + typeVal component.DataType `mapstructure:"-"` + nameVal string `mapstructure:"-"` } // Type returns the type of the component. -func (id PipelineID) Type() DataType { +func (id PipelineID) Type() component.DataType { return id.typeVal } @@ -25,12 +27,12 @@ func (id PipelineID) Name() string { } // NewPipelineID returns a new PipelineID with the given DataType and empty name. -func NewPipelineID(typeVal DataType) PipelineID { +func NewPipelineID(typeVal component.DataType) PipelineID { return PipelineID{typeVal: typeVal} } // NewPipelineIDWithName returns a new PipelineID with the given DataType and name. -func NewPipelineIDWithName(typeVal DataType, nameVal string) PipelineID { +func NewPipelineIDWithName(typeVal component.DataType, nameVal string) PipelineID { return PipelineID{typeVal: typeVal, nameVal: nameVal} } @@ -43,7 +45,7 @@ func (id PipelineID) MarshalText() (text []byte, err error) { // UnmarshalText implements the encoding.TextUnmarshaler interface. func (id *PipelineID) UnmarshalText(text []byte) error { idStr := string(text) - items := strings.SplitN(idStr, TypeAndNameSeparator, 2) + items := strings.SplitN(idStr, component.TypeAndNameSeparator, 2) var typeStr, nameStr string if len(items) >= 1 { typeStr = strings.TrimSpace(items[0]) @@ -54,19 +56,19 @@ func (id *PipelineID) UnmarshalText(text []byte) error { } if typeStr == "" { - return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, TypeAndNameSeparator) + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, component.TypeAndNameSeparator) } if len(items) > 1 { // "name" part is present. nameStr = strings.TrimSpace(items[1]) if nameStr == "" { - return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, TypeAndNameSeparator) + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, component.TypeAndNameSeparator) } } var err error - var dt DataType + var dt component.DataType if err = dt.UnmarshalText([]byte(typeStr)); err != nil { return fmt.Errorf("in %q id: %w", idStr, err) } @@ -82,5 +84,5 @@ func (id PipelineID) String() string { return id.typeVal.String() } - return id.typeVal.String() + TypeAndNameSeparator + id.nameVal + return id.typeVal.String() + component.TypeAndNameSeparator + id.nameVal } diff --git a/component/pipeline_test.go b/pipeline/pipeline_test.go similarity index 77% rename from component/pipeline_test.go rename to pipeline/pipeline_test.go index 80cf5bc3f14..54c46f50914 100644 --- a/component/pipeline_test.go +++ b/pipeline/pipeline_test.go @@ -1,21 +1,23 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package component +package pipeline import ( "testing" "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/component" ) func TestNewPipelineID(t *testing.T) { - id := NewPipelineID(DataTypeMetrics) + id := NewPipelineID(component.DataTypeMetrics) assert.Equal(t, "", id.nameVal) } func TestPipelineIDMarshalText(t *testing.T) { - id := NewPipelineIDWithName(DataTypeMetrics, "name") + id := NewPipelineIDWithName(component.DataTypeMetrics, "name") got, err := id.MarshalText() assert.NoError(t, err) assert.Equal(t, id.String(), string(got)) @@ -29,15 +31,15 @@ func TestPipelineIDUnmarshalText(t *testing.T) { }{ { idStr: "metrics", - expectedID: PipelineID{typeVal: DataTypeMetrics, nameVal: ""}, + expectedID: PipelineID{typeVal: component.DataTypeMetrics, nameVal: ""}, }, { idStr: "logs/valid_name", - expectedID: PipelineID{typeVal: DataTypeLogs, nameVal: "valid_name"}, + expectedID: PipelineID{typeVal: component.DataTypeLogs, nameVal: "valid_name"}, }, { idStr: " traces / valid_name ", - expectedID: PipelineID{typeVal: DataTypeTraces, nameVal: "valid_name"}, + expectedID: PipelineID{typeVal: component.DataTypeTraces, nameVal: "valid_name"}, }, { idStr: "/valid_name", diff --git a/service/config_test.go b/service/config_test.go index 02a544dec09..6403058aa1a 100644 --- a/service/config_test.go +++ b/service/config_test.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/extensions" "go.opentelemetry.io/collector/service/pipelines" "go.opentelemetry.io/collector/service/telemetry" @@ -42,7 +43,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Pipelines[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -52,7 +53,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() *Config { cfg := generateConfig() - cfg.Pipelines[component.NewPipelineID("wrongtype")] = &pipelines.PipelineConfig{ + cfg.Pipelines[pipeline.NewPipelineID("wrongtype")] = &pipelines.PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -101,7 +102,7 @@ func generateConfig() *Config { }, Extensions: extensions.Config{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/components/loggers.go b/service/internal/components/loggers.go index 7a3b17992c6..7e269f00718 100644 --- a/service/internal/components/loggers.go +++ b/service/internal/components/loggers.go @@ -9,6 +9,7 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pipeline" ) const ( @@ -28,7 +29,7 @@ func ReceiverLogger(logger *zap.Logger, id component.ID, dt component.DataType) zap.String(zapDataTypeKey, dt.String())) } -func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID component.PipelineID) *zap.Logger { +func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID pipeline.PipelineID) *zap.Logger { return logger.With( zap.String(zapKindKey, strings.ToLower(component.KindProcessor.String())), zap.String(zapNameKey, id.String()), diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index 03f704ee6b3..faf5db07fcf 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -28,6 +28,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/internal/fanoutconsumer" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/service/internal/capabilityconsumer" @@ -54,7 +55,7 @@ type Graph struct { componentGraph *simple.DirectedGraph // Keep track of how nodes relate to pipelines, so we can declare edges in the graph. - pipelines map[component.PipelineID]*pipelineNodes + pipelines map[pipeline.PipelineID]*pipelineNodes // Keep track of status source per node instanceIDs map[int64]*pipelines.InstanceID @@ -67,7 +68,7 @@ type Graph struct { func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), - pipelines: make(map[component.PipelineID]*pipelineNodes, len(set.PipelineConfigs)), + pipelines: make(map[pipeline.PipelineID]*pipelineNodes, len(set.PipelineConfigs)), instanceIDs: make(map[int64]*pipelines.InstanceID), telemetry: set.Telemetry, } @@ -91,8 +92,8 @@ func (g *Graph) createNodes(set Settings) error { connectors := make(map[component.ID]struct{}) // Keep track of connectors and where they are used. (map[connectorID][]pipelineID) - connectorsAsExporter := make(map[component.ID][]component.PipelineID) - connectorsAsReceiver := make(map[component.ID][]component.PipelineID) + connectorsAsExporter := make(map[component.ID][]pipeline.PipelineID) + connectorsAsReceiver := make(map[component.ID][]pipeline.PipelineID) // Build each pipelineNodes struct for each pipeline by parsing the pipelineCfg. // Also populates the connectors, connectorsAsExporter and connectorsAsReceiver maps. @@ -190,7 +191,7 @@ func (g *Graph) createNodes(set Settings) error { return nil } -func (g *Graph) createReceiver(pipelineID component.PipelineID, recvID component.ID) *receiverNode { +func (g *Graph) createReceiver(pipelineID pipeline.PipelineID, recvID component.ID) *receiverNode { rcvrNode := newReceiverNode(pipelineID.Type(), recvID) if node := g.componentGraph.Node(rcvrNode.ID()); node != nil { g.instanceIDs[node.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -200,27 +201,27 @@ func (g *Graph) createReceiver(pipelineID component.PipelineID, recvID component g.instanceIDs[rcvrNode.ID()] = &pipelines.InstanceID{ ID: recvID, Kind: component.KindReceiver, - PipelineIDs: map[component.PipelineID]struct{}{ + PipelineIDs: map[pipeline.PipelineID]struct{}{ pipelineID: {}, }, } return rcvrNode } -func (g *Graph) createProcessor(pipelineID component.PipelineID, procID component.ID) *processorNode { +func (g *Graph) createProcessor(pipelineID pipeline.PipelineID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) g.instanceIDs[procNode.ID()] = &pipelines.InstanceID{ ID: procID, Kind: component.KindProcessor, - PipelineIDs: map[component.PipelineID]struct{}{ + PipelineIDs: map[pipeline.PipelineID]struct{}{ pipelineID: {}, }, } return procNode } -func (g *Graph) createExporter(pipelineID component.PipelineID, exprID component.ID) *exporterNode { +func (g *Graph) createExporter(pipelineID pipeline.PipelineID, exprID component.ID) *exporterNode { expNode := newExporterNode(pipelineID.Type(), exprID) if node := g.componentGraph.Node(expNode.ID()); node != nil { g.instanceIDs[expNode.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -230,14 +231,14 @@ func (g *Graph) createExporter(pipelineID component.PipelineID, exprID component g.instanceIDs[expNode.ID()] = &pipelines.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, - PipelineIDs: map[component.PipelineID]struct{}{ + PipelineIDs: map[pipeline.PipelineID]struct{}{ pipelineID: {}, }, } return expNode } -func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.PipelineID, connID component.ID) *connectorNode { +func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID pipeline.PipelineID, connID component.ID) *connectorNode { connNode := newConnectorNode(exprPipelineID.Type(), rcvrPipelineID.Type(), connID) if node := g.componentGraph.Node(connNode.ID()); node != nil { instanceID := g.instanceIDs[connNode.ID()] @@ -249,7 +250,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID component.Pipelin g.instanceIDs[connNode.ID()] = &pipelines.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, - PipelineIDs: map[component.PipelineID]struct{}{ + PipelineIDs: map[pipeline.PipelineID]struct{}{ exprPipelineID: {}, rcvrPipelineID: {}, }, diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index de4f1bd1777..eb7f4252d22 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/pdata/testdata" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" "go.opentelemetry.io/collector/receiver" @@ -229,17 +230,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -250,17 +251,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_mutate.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -271,17 +272,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_multi_proc.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -292,15 +293,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_no_proc.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -310,17 +311,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, @@ -331,15 +332,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi_no_proc.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, @@ -349,30 +350,30 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "multi_pipeline_receivers_and_exporters.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -382,12 +383,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_traces.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -398,12 +399,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -414,12 +415,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_logs.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -430,22 +431,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_traces.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "type0"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "type1"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -456,22 +457,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "type0"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "type1"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -482,22 +483,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_logs.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "type0"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "type1"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -508,17 +509,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_traces.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -529,17 +530,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -550,17 +551,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_logs.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -571,32 +572,32 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_matrix.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -607,27 +608,27 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_lanes.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -637,22 +638,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_traces.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out0"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "middle"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out1"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -663,22 +664,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_metrics.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out0"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "middle"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out1"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -689,22 +690,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_logs.yaml", pipelineConfigs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out0"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "middle"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out1"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -770,7 +771,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { assert.NoError(t, pg.StartAll(context.Background(), componenttest.NewNopHost())) - mutatingPipelines := make(map[component.PipelineID]bool, len(test.pipelineConfigs)) + mutatingPipelines := make(map[pipeline.PipelineID]bool, len(test.pipelineConfigs)) // Check each pipeline individually, ensuring that all components are started // and that they have observed no signals yet. @@ -991,17 +992,17 @@ func TestConnectorRouter(t *testing.T) { expRightID := component.MustNewIDWithName("exampleexporter", "right") expLeftID := component.MustNewIDWithName("exampleexporter", "left") - tracesInID := component.NewPipelineIDWithName(component.DataTypeTraces, "in") - tracesRightID := component.NewPipelineIDWithName(component.DataTypeTraces, "right") - tracesLeftID := component.NewPipelineIDWithName(component.DataTypeTraces, "left") + tracesInID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in") + tracesRightID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "right") + tracesLeftID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "left") - metricsInID := component.NewPipelineIDWithName(component.DataTypeMetrics, "in") - metricsRightID := component.NewPipelineIDWithName(component.DataTypeMetrics, "right") - metricsLeftID := component.NewPipelineIDWithName(component.DataTypeMetrics, "left") + metricsInID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in") + metricsRightID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "right") + metricsLeftID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "left") - logsInID := component.NewPipelineIDWithName(component.DataTypeLogs, "in") - logsRightID := component.NewPipelineIDWithName(component.DataTypeLogs, "right") - logsLeftID := component.NewPipelineIDWithName(component.DataTypeLogs, "left") + logsInID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in") + logsRightID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "right") + logsLeftID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "left") ctx := context.Background() set := Settings{ @@ -1194,7 +1195,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1210,7 +1211,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1226,7 +1227,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1245,7 +1246,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1265,7 +1266,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1285,7 +1286,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1302,7 +1303,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1318,7 +1319,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1334,7 +1335,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1353,11 +1354,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1376,11 +1377,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1399,11 +1400,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1422,11 +1423,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1445,11 +1446,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1468,11 +1469,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1491,11 +1492,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1514,11 +1515,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1537,11 +1538,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1560,7 +1561,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, @@ -1579,7 +1580,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1598,15 +1599,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, @@ -1625,15 +1626,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1655,7 +1656,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1681,7 +1682,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1707,7 +1708,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1735,22 +1736,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "2"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1780,22 +1781,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "2"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1825,22 +1826,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "1"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "2"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1871,37 +1872,37 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "rawlog"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "copy1"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "copy2"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "copy2a"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2a"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "copy2b"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2b"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, }, - component.NewPipelineIDWithName(component.DataTypeMetrics, "count"): { + pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "count"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "count")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - component.NewPipelineIDWithName(component.DataTypeLogs, "raw"): { + pipeline.NewPipelineIDWithName(component.DataTypeLogs, "raw"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, // cannot loop back to "nop/fork" @@ -1925,7 +1926,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, }, @@ -1941,7 +1942,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, @@ -1960,7 +1961,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1980,7 +1981,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1997,7 +1998,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2013,7 +2014,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2032,11 +2033,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - component.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, - component.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2140,7 +2141,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt := range dataTypes { t.Run(dt.String()+"/receiver", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewPipelineID(dt): { + pipeline.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2154,7 +2155,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/processor", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewPipelineID(dt): { + pipeline.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2168,7 +2169,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/exporter", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewPipelineID(dt): { + pipeline.NewPipelineID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, @@ -2183,12 +2184,12 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt2 := range dataTypes { t.Run(dt.String()+"/"+dt2.String()+"/connector", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - component.NewPipelineIDWithName(dt, "in"): { + pipeline.NewPipelineIDWithName(dt, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, }, - component.NewPipelineIDWithName(dt2, "out"): { + pipeline.NewPipelineIDWithName(dt2, "out"): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2389,7 +2390,7 @@ func (g *Graph) getReceivers() map[component.DataType]map[component.ID]component // However, within an individual pipeline, we expect: // - E instances of the connector as a receiver. // - R instances of the connector as an exporter. -func expectedInstances(m pipelines.Config, pID component.PipelineID) (int, int) { +func expectedInstances(m pipelines.Config, pID pipeline.PipelineID) (int, int) { exConnectorType := component.MustNewType("exampleconnector") var r, e int for _, rID := range m[pID].Receivers { diff --git a/service/internal/graph/nodes.go b/service/internal/graph/nodes.go index 1b6906f554e..dfec33c4271 100644 --- a/service/internal/graph/nodes.go +++ b/service/internal/graph/nodes.go @@ -14,6 +14,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/internal/fanoutconsumer" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/service/internal/capabilityconsumer" @@ -111,11 +112,11 @@ var _ consumerNode = (*processorNode)(nil) type processorNode struct { nodeID componentID component.ID - pipelineID component.PipelineID + pipelineID pipeline.PipelineID component.Component } -func newProcessorNode(pipelineID component.PipelineID, procID component.ID) *processorNode { +func newProcessorNode(pipelineID pipeline.PipelineID, procID component.ID) *processorNode { return &processorNode{ nodeID: newNodeID(processorSeed, pipelineID.String(), procID.String()), componentID: procID, @@ -239,7 +240,7 @@ func (n *connectorNode) buildComponent( switch n.rcvrPipelineType { case component.DataTypeTraces: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.PipelineID]consumer.Traces, len(nexts)) + consumers := make(map[pipeline.PipelineID]consumer.Traces, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Traces) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -275,7 +276,7 @@ func (n *connectorNode) buildComponent( case component.DataTypeMetrics: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.PipelineID]consumer.Metrics, len(nexts)) + consumers := make(map[pipeline.PipelineID]consumer.Metrics, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Metrics) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -310,7 +311,7 @@ func (n *connectorNode) buildComponent( } case component.DataTypeLogs: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[component.PipelineID]consumer.Logs, len(nexts)) + consumers := make(map[pipeline.PipelineID]consumer.Logs, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Logs) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -356,14 +357,14 @@ var _ consumerNode = (*capabilitiesNode)(nil) // The nodeID is derived from "pipeline ID". type capabilitiesNode struct { nodeID - pipelineID component.PipelineID + pipelineID pipeline.PipelineID baseConsumer consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc } -func newCapabilitiesNode(pipelineID component.PipelineID) *capabilitiesNode { +func newCapabilitiesNode(pipelineID pipeline.PipelineID) *capabilitiesNode { return &capabilitiesNode{ nodeID: newNodeID(capabilitiesSeed, pipelineID.String()), pipelineID: pipelineID, @@ -380,11 +381,11 @@ var _ consumerNode = (*fanOutNode)(nil) // Therefore, nodeID is derived from "pipeline ID". type fanOutNode struct { nodeID - pipelineID component.PipelineID + pipelineID pipeline.PipelineID baseConsumer } -func newFanOutNode(pipelineID component.PipelineID) *fanOutNode { +func newFanOutNode(pipelineID pipeline.PipelineID) *fanOutNode { return &fanOutNode{ nodeID: newNodeID(fanOutToExporters, pipelineID.String()), pipelineID: pipelineID, diff --git a/service/internal/testcomponents/example_router.go b/service/internal/testcomponents/example_router.go index f1ae88a0b54..68b20a15ba1 100644 --- a/service/internal/testcomponents/example_router.go +++ b/service/internal/testcomponents/example_router.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/pipeline" ) var routerType = component.MustNewType("examplerouter") @@ -26,8 +27,8 @@ var ExampleRouterFactory = connector.NewFactory( ) type LeftRightConfig struct { - Left component.PipelineID `mapstructure:"left"` - Right component.PipelineID `mapstructure:"right"` + Left pipeline.PipelineID `mapstructure:"left"` + Right pipeline.PipelineID `mapstructure:"right"` } type ExampleRouterConfig struct { diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index 523d3044f69..5fd75c0956e 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/testdata" + "go.opentelemetry.io/collector/pipeline" ) func TestExampleRouter(t *testing.T) { @@ -31,8 +32,8 @@ func TestExampleRouter(t *testing.T) { } func TestTracesRouter(t *testing.T) { - leftID := component.NewPipelineIDWithName(component.DataTypeTraces, "left") - rightID := component.NewPipelineIDWithName(component.DataTypeTraces, "right") + leftID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "left") + rightID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "right") sinkLeft := new(consumertest.TracesSink) sinkRight := new(consumertest.TracesSink) @@ -41,7 +42,7 @@ func TestTracesRouter(t *testing.T) { // Many connectors will just call router.ConsumeTraces, // but some implementation will call RouteTraces instead. router := connector.NewTracesRouter( - map[component.PipelineID]consumer.Traces{ + map[pipeline.PipelineID]consumer.Traces{ leftID: sinkLeft, rightID: sinkRight, }) @@ -70,8 +71,8 @@ func TestTracesRouter(t *testing.T) { } func TestMetricsRouter(t *testing.T) { - leftID := component.NewPipelineIDWithName(component.DataTypeMetrics, "left") - rightID := component.NewPipelineIDWithName(component.DataTypeMetrics, "right") + leftID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "left") + rightID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "right") sinkLeft := new(consumertest.MetricsSink) sinkRight := new(consumertest.MetricsSink) @@ -80,7 +81,7 @@ func TestMetricsRouter(t *testing.T) { // Many connectors will just call router.ConsumeMetrics, // but some implementation will call RouteMetrics instead. router := connector.NewMetricsRouter( - map[component.PipelineID]consumer.Metrics{ + map[pipeline.PipelineID]consumer.Metrics{ leftID: sinkLeft, rightID: sinkRight, }) @@ -109,8 +110,8 @@ func TestMetricsRouter(t *testing.T) { } func TestLogsRouter(t *testing.T) { - leftID := component.NewPipelineIDWithName(component.DataTypeLogs, "left") - rightID := component.NewPipelineIDWithName(component.DataTypeLogs, "right") + leftID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "left") + rightID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "right") sinkLeft := new(consumertest.LogsSink) sinkRight := new(consumertest.LogsSink) @@ -119,7 +120,7 @@ func TestLogsRouter(t *testing.T) { // Many connectors will just call router.ConsumeLogs, // but some implementation will call RouteLogs instead. router := connector.NewLogsRouter( - map[component.PipelineID]consumer.Logs{ + map[pipeline.PipelineID]consumer.Logs{ leftID: sinkLeft, rightID: sinkRight, }) diff --git a/service/pipelines/config.go b/service/pipelines/config.go index 2d4e1f66ec4..65f7b0ebe9b 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -8,6 +8,7 @@ import ( "fmt" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pipeline" ) var ( @@ -17,7 +18,7 @@ var ( ) // Config defines the configurable settings for service telemetry. -type Config map[component.PipelineID]*PipelineConfig +type Config map[pipeline.PipelineID]*PipelineConfig func (cfg Config) Validate() error { // Must have at least one pipeline. @@ -76,5 +77,5 @@ func (cfg *PipelineConfig) Validate() error { type InstanceID struct { ID component.ID Kind component.Kind - PipelineIDs map[component.PipelineID]struct{} + PipelineIDs map[pipeline.PipelineID]struct{} } diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index de36fd92de0..e7a6cdcea30 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pipeline" ) func TestConfigValidate(t *testing.T) { @@ -28,7 +29,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() Config { cfg := generateConfig() - pipe := cfg[component.NewPipelineID(component.DataTypeTraces)] + pipe := cfg[pipeline.NewPipelineID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -38,7 +39,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-receivers", cfgFn: func() Config { cfg := generateConfig() - cfg[component.NewPipelineID(component.DataTypeTraces)].Receivers = nil + cfg[pipeline.NewPipelineID(component.DataTypeTraces)].Receivers = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineReceivers), @@ -47,7 +48,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-exporters", cfgFn: func() Config { cfg := generateConfig() - cfg[component.NewPipelineID(component.DataTypeTraces)].Exporters = nil + cfg[pipeline.NewPipelineID(component.DataTypeTraces)].Exporters = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineExporters), @@ -63,7 +64,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() Config { cfg := generateConfig() - cfg[component.NewPipelineID("wrongtype")] = &PipelineConfig{ + cfg[pipeline.NewPipelineID("wrongtype")] = &PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -83,8 +84,8 @@ func TestConfigValidate(t *testing.T) { } func generateConfig() Config { - return map[component.PipelineID]*PipelineConfig{ - component.NewPipelineID(component.DataTypeTraces): { + return map[pipeline.PipelineID]*PipelineConfig{ + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/service_test.go b/service/service_test.go index d9641c7ffa1..1841825d51e 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -30,6 +30,7 @@ import ( "go.opentelemetry.io/collector/extension/zpagesextension" "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor/processortest" "go.opentelemetry.io/collector/receiver/receivertest" "go.opentelemetry.io/collector/service/extensions" @@ -240,7 +241,7 @@ func TestServiceGetExporters(t *testing.T) { // and another service with a valid config can be started right after. func TestServiceTelemetryCleanupOnError(t *testing.T) { invalidCfg := newNopConfig() - invalidCfg.Pipelines[component.NewPipelineID(component.DataTypeTraces)].Processors[0] = component.MustNewID("invalid") + invalidCfg.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)].Processors[0] = component.MustNewID("invalid") // Create a service with an invalid config and expect an error _, err := New(context.Background(), newNopSettings(), invalidCfg) require.Error(t, err) @@ -532,17 +533,17 @@ func newNopSettings() Settings { func newNopConfig() Config { return newNopConfigPipelineConfigs(pipelines.Config{ - component.NewPipelineID(component.DataTypeTraces): { + pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - component.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewPipelineID(component.DataTypeMetrics): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - component.NewPipelineID(component.DataTypeLogs): { + pipeline.NewPipelineID(component.DataTypeLogs): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, From a43fa357a87a464e4abbdee3e52f3809cbcc6cb0 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 18:25:25 -0400 Subject: [PATCH 27/38] go mod updates --- cmd/mdatagen/go.mod | 2 ++ cmd/otelcorecol/go.mod | 3 +++ config/configauth/go.mod | 3 +++ config/configgrpc/go.mod | 3 +++ config/confighttp/go.mod | 3 +++ config/internal/go.mod | 2 ++ connector/forwardconnector/go.mod | 3 +++ connector/go.mod | 3 +++ exporter/debugexporter/go.mod | 3 +++ exporter/go.mod | 3 +++ exporter/loggingexporter/go.mod | 3 +++ exporter/nopexporter/go.mod | 2 ++ exporter/otlpexporter/go.mod | 3 +++ exporter/otlphttpexporter/go.mod | 3 +++ extension/auth/go.mod | 3 +++ extension/ballastextension/go.mod | 3 +++ extension/go.mod | 3 +++ extension/memorylimiterextension/go.mod | 3 +++ extension/zpagesextension/go.mod | 3 +++ go.mod | 3 +++ internal/e2e/go.mod | 3 +++ otelcol/go.mod | 3 +++ pipeline/go.mod | 33 ++++++++++++++++++++++++- pipeline/go.sum | 29 +++------------------- processor/batchprocessor/go.mod | 2 ++ processor/go.mod | 2 ++ processor/memorylimiterprocessor/go.mod | 2 ++ receiver/go.mod | 2 ++ receiver/nopreceiver/go.mod | 2 ++ receiver/otlpreceiver/go.mod | 3 +++ service/go.mod | 3 +++ versions.yaml | 1 + 32 files changed, 115 insertions(+), 27 deletions(-) diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 3ad686c5b67..27976e8ffa6 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -101,3 +101,5 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 5da9dceec49..79d5d45a364 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -94,6 +94,7 @@ require ( go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/semconv v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect @@ -218,3 +219,5 @@ replace go.opentelemetry.io/collector/processor/memorylimiterprocessor => ../../ replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/service => ../../service + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/configauth/go.mod b/config/configauth/go.mod index a6af59491ae..d3d16796c30 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -23,6 +23,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -75,3 +76,5 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 65cb5caf865..7291a291a0a 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -52,6 +52,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -114,3 +115,5 @@ replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index 105d2c8efaa..9f63941c8f0 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -48,6 +48,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -110,3 +111,5 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/exporter => ../../exporter replace go.opentelemetry.io/collector/consumer => ../../consumer + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/internal/go.mod b/config/internal/go.mod index 6d228ffd2e8..07091deaf6b 100644 --- a/config/internal/go.mod +++ b/config/internal/go.mod @@ -53,3 +53,5 @@ replace go.opentelemetry.io/collector/config/confignet => ../confignet replace go.opentelemetry.io/collector/config/configretry => ../configretry replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 4346bba4169..8bf59652411 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -9,6 +9,7 @@ require ( go.opentelemetry.io/collector/connector v0.102.1 go.opentelemetry.io/collector/consumer v0.102.1 go.opentelemetry.io/collector/pdata v1.9.0 + go.opentelemetry.io/collector/pipeline v0.102.1 go.uber.org/goleak v1.3.0 ) @@ -93,3 +94,5 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/exporter => ../../exporter replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/connector/go.mod b/connector/go.mod index 1d1d5e3ca79..dd692464771 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -10,6 +10,7 @@ require ( go.opentelemetry.io/collector/consumer v0.102.1 go.opentelemetry.io/collector/pdata v1.9.0 go.opentelemetry.io/collector/pdata/testdata v0.102.1 + go.opentelemetry.io/collector/pipeline v0.102.1 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -79,3 +80,5 @@ replace go.opentelemetry.io/collector/config/configretry => ../config/configretr replace go.opentelemetry.io/collector/config/confignet => ../config/confignet replace go.opentelemetry.io/collector/extension => ../extension + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 3dbadfe18db..98dde32abbb 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -41,6 +41,7 @@ require ( go.opentelemetry.io/collector v0.102.1 // indirect go.opentelemetry.io/collector/config/configretry v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect @@ -94,3 +95,5 @@ replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/go.mod b/exporter/go.mod index 8cd0d780ac1..ae33fa7c88a 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -49,6 +49,7 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect golang.org/x/net v0.25.0 // indirect @@ -93,3 +94,5 @@ replace go.opentelemetry.io/collector/semconv => ../semconv replace go.opentelemetry.io/collector/connector => ../connector replace go.opentelemetry.io/collector/config/confignet => ../config/confignet + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index b7787c7d69c..69322581a7e 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -41,6 +41,7 @@ require ( go.opentelemetry.io/collector/config/configretry v0.102.1 // indirect go.opentelemetry.io/collector/consumer v0.102.1 // indirect go.opentelemetry.io/collector/extension v0.102.1 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect @@ -99,3 +100,5 @@ replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index e2c6eb0f3c1..354609963c2 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -88,3 +88,5 @@ replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extensi replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 03532f12412..6938441c0d5 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -59,6 +59,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect @@ -139,3 +140,5 @@ replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/processor => ../../processor replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index d5912e60914..48cd415a785 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -58,6 +58,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect @@ -138,3 +139,5 @@ replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extensi replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/auth/go.mod b/extension/auth/go.mod index e60bddd5caa..1ce0512bf7b 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -31,6 +31,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -83,3 +84,5 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/exporter => ../../exporter + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index 663913f19e2..8ec4d394007 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -41,6 +41,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -98,3 +99,5 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/go.mod b/extension/go.mod index 81ee85ac8ec..4ae7cd326dc 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -31,6 +31,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -81,3 +82,5 @@ replace go.opentelemetry.io/collector/config/confignet => ../config/confignet replace go.opentelemetry.io/collector/receiver => ../receiver replace go.opentelemetry.io/collector/extension/zpagesextension => ./zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index 27dee12fedc..8e1ce763cf5 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -40,6 +40,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -92,3 +93,5 @@ replace go.opentelemetry.io/collector/exporter => ../../exporter replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index be45952e494..f85595a9faf 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -39,6 +39,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect @@ -102,3 +103,5 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/processor => ../../processor + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/go.mod b/go.mod index 1e8e6a1d690..9951d0cef80 100644 --- a/go.mod +++ b/go.mod @@ -58,6 +58,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.102.1 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect @@ -122,3 +123,5 @@ replace go.opentelemetry.io/collector/processor => ./processor replace go.opentelemetry.io/collector/extension => ./extension replace go.opentelemetry.io/collector/config/confignet => ./config/confignet + +replace go.opentelemetry.io/collector/pipeline => ./pipeline diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index 410c451ede0..46461ce9494 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -62,6 +62,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect @@ -149,3 +150,5 @@ replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extensi replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/semconv => ../../semconv + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/otelcol/go.mod b/otelcol/go.mod index 3c8640b770f..2f2898a8d47 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -18,6 +18,7 @@ require ( go.opentelemetry.io/collector/exporter v0.102.1 go.opentelemetry.io/collector/extension v0.102.1 go.opentelemetry.io/collector/featuregate v1.9.0 + go.opentelemetry.io/collector/pipeline v0.102.1 go.opentelemetry.io/collector/processor v0.102.1 go.opentelemetry.io/collector/receiver v0.102.1 go.opentelemetry.io/collector/service v0.102.1 @@ -144,3 +145,5 @@ replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/config/confignet => ../config/confignet replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/pipeline/go.mod b/pipeline/go.mod index 340247f7024..4e5f67f8f20 100644 --- a/pipeline/go.mod +++ b/pipeline/go.mod @@ -1,3 +1,34 @@ module go.opentelemetry.io/collector/pipeline -go 1.22.1 +go 1.21.0 + +require ( + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/collector/component v0.102.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect + go.opentelemetry.io/collector/pdata v1.9.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace go.opentelemetry.io/collector/pdata => ../pdata + +replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry + +replace go.opentelemetry.io/collector/component => ../component diff --git a/pipeline/go.sum b/pipeline/go.sum index 61b19090630..c89106d8e09 100644 --- a/pipeline/go.sum +++ b/pipeline/go.sum @@ -4,28 +4,16 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -34,14 +22,6 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.102.1 h1:66z+LN5dVCXhvuVKD1b56/3cYLK+mtYSLIwlskYA9IQ= -go.opentelemetry.io/collector/component v0.102.1/go.mod h1:XfkiSeImKYaewT2DavA80l0VZ3JjvGndZ8ayPXfp8d0= -go.opentelemetry.io/collector/config/configtelemetry v0.102.1 h1:f/CYcrOkaHd+COIJ2lWnEgBCHfhEycpbow4ZhrGwAlA= -go.opentelemetry.io/collector/config/configtelemetry v0.102.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.102.1 h1:wZuH+d/P11Suz8wbp+xQCJ0BPE9m5pybtUe74c+rU7E= -go.opentelemetry.io/collector/confmap v0.102.1/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= -go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw= -go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= @@ -63,8 +43,7 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -76,8 +55,7 @@ golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -87,8 +65,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 3cd9158c290..1476b4a14d3 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -94,3 +94,5 @@ replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension replace go.opentelemetry.io/collector/connector => ../../connector + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/processor/go.mod b/processor/go.mod index 892e0d8fc2f..402faf42507 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -79,3 +79,5 @@ replace go.opentelemetry.io/collector/connector => ../connector replace go.opentelemetry.io/collector/exporter => ../exporter replace go.opentelemetry.io/collector/service => ../service + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index 48082d80800..bc55bcc80f2 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -101,3 +101,5 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/connector => ../../connector replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/receiver/go.mod b/receiver/go.mod index 33ec680fe02..7fcc78aa40a 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -80,3 +80,5 @@ replace go.opentelemetry.io/collector/exporter => ../exporter replace go.opentelemetry.io/collector/processor => ../processor replace go.opentelemetry.io/collector/connector => ../connector + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index 2d84e4d8854..ba95c74c97d 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -87,3 +87,5 @@ replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/extension => ../../extension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 11925f367d1..136797dfdc6 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -61,6 +61,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect + go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect @@ -143,3 +144,5 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/service => ../../service replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension + +replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/service/go.mod b/service/go.mod index 5ff0699bb63..025f297f707 100644 --- a/service/go.mod +++ b/service/go.mod @@ -23,6 +23,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 go.opentelemetry.io/collector/pdata v1.9.0 go.opentelemetry.io/collector/pdata/testdata v0.102.1 + go.opentelemetry.io/collector/pipeline v0.102.1 go.opentelemetry.io/collector/processor v0.102.1 go.opentelemetry.io/collector/receiver v0.102.1 go.opentelemetry.io/collector/semconv v0.102.1 @@ -122,3 +123,5 @@ replace go.opentelemetry.io/collector/featuregate => ../featuregate replace go.opentelemetry.io/collector/config/confignet => ../config/confignet replace go.opentelemetry.io/collector/config/configretry => ../config/configretry + +replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/versions.yaml b/versions.yaml index 49c6b625c58..391af3d3cdc 100644 --- a/versions.yaml +++ b/versions.yaml @@ -48,6 +48,7 @@ module-sets: - go.opentelemetry.io/collector/otelcol - go.opentelemetry.io/collector/pdata/pprofile - go.opentelemetry.io/collector/pdata/testdata + - go.opentelemetry.io/collector/pipeline - go.opentelemetry.io/collector/processor - go.opentelemetry.io/collector/processor/batchprocessor - go.opentelemetry.io/collector/processor/memorylimiterprocessor From 929f67ac4340f9fdd014001ef4d0fdb38c9dccca Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:02:54 -0400 Subject: [PATCH 28/38] rename pipeline id --- .../generated_component_test.go | 6 ++--- connector/logs_router.go | 12 ++++----- connector/logs_router_test.go | 14 +++++----- connector/metrics_router.go | 6 ++--- connector/metrics_router_test.go | 14 +++++----- connector/router.go | 12 ++++----- connector/traces_router.go | 6 ++--- connector/traces_router_test.go | 14 +++++----- pipeline/pipeline.go | 24 ++++++++--------- pipeline/pipeline_test.go | 10 +++---- service/internal/components/loggers.go | 2 +- service/internal/graph/graph.go | 26 +++++++++---------- service/internal/graph/graph_test.go | 4 +-- service/internal/graph/nodes.go | 18 ++++++------- .../internal/testcomponents/example_router.go | 4 +-- .../testcomponents/example_router_test.go | 6 ++--- service/pipelines/config.go | 4 +-- service/pipelines/config_test.go | 2 +- 18 files changed, 92 insertions(+), 92 deletions(-) diff --git a/connector/forwardconnector/generated_component_test.go b/connector/forwardconnector/generated_component_test.go index 992001b2050..b492f6e2d7d 100644 --- a/connector/forwardconnector/generated_component_test.go +++ b/connector/forwardconnector/generated_component_test.go @@ -37,7 +37,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[pipeline.PipelineID]consumer.Logs{pipeline.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.ID]consumer.Logs{pipeline.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -45,7 +45,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[pipeline.PipelineID]consumer.Metrics{pipeline.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{pipeline.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -53,7 +53,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[pipeline.PipelineID]consumer.Traces{pipeline.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.ID]consumer.Traces{pipeline.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, diff --git a/connector/logs_router.go b/connector/logs_router.go index 77d20fe9bb4..21e9404f9fb 100644 --- a/connector/logs_router.go +++ b/connector/logs_router.go @@ -16,8 +16,8 @@ import ( // LogsRouterAndConsumer feeds the first consumer.Logs in each of the specified pipelines. type LogsRouterAndConsumer interface { consumer.Logs - Consumer(...pipeline.PipelineID) (consumer.Logs, error) - PipelineIDs() []pipeline.PipelineID + Consumer(...pipeline.ID) (consumer.Logs, error) + PipelineIDs() []pipeline.ID privateFunc() } @@ -26,7 +26,7 @@ type logsRouter struct { baseRouter[consumer.Logs] } -func NewLogsRouter(cm map[pipeline.PipelineID]consumer.Logs) LogsRouterAndConsumer { +func NewLogsRouter(cm map[pipeline.ID]consumer.Logs) LogsRouterAndConsumer { consumers := make([]consumer.Logs, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) @@ -37,15 +37,15 @@ func NewLogsRouter(cm map[pipeline.PipelineID]consumer.Logs) LogsRouterAndConsum } } -func (r *logsRouter) PipelineIDs() []pipeline.PipelineID { - ids := make([]pipeline.PipelineID, 0, len(r.consumers)) +func (r *logsRouter) PipelineIDs() []pipeline.ID { + ids := make([]pipeline.ID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *logsRouter) Consumer(pipelineIDs ...pipeline.PipelineID) (consumer.Logs, error) { +func (r *logsRouter) Consumer(pipelineIDs ...pipeline.ID) (consumer.Logs, error) { if len(pipelineIDs) == 0 { return nil, fmt.Errorf("missing consumers") } diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index 82101c04c22..43cccb7f955 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -43,9 +43,9 @@ func TestLogsRouterMultiplexing(t *testing.T) { func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]pipeline.PipelineID, 0, numCons) + allIDs := make([]pipeline.ID, 0, numCons) allCons := make([]consumer.Logs, 0, numCons) - allConsMap := make(map[pipeline.PipelineID]consumer.Logs) + allConsMap := make(map[pipeline.ID]consumer.Logs) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -64,11 +64,11 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteLogs. - expected := make(map[pipeline.PipelineID]int, numCons) + expected := make(map[pipeline.ID]int, numCons) for i := 0; i < numLogs; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[pipeline.PipelineID]bool, numIDs) + randCons := make(map[pipeline.ID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -76,7 +76,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]pipeline.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.ID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -114,11 +114,11 @@ func TestLogsRouterConsumers(t *testing.T) { foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) - r := NewLogsRouter(map[pipeline.PipelineID]consumer.Logs{fooID: foo, barID: bar}) + r := NewLogsRouter(map[pipeline.ID]consumer.Logs{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.ID{fooID, barID}, rcs) assert.Len(t, foo.AllLogs(), 0) assert.Len(t, bar.AllLogs(), 0) diff --git a/connector/metrics_router.go b/connector/metrics_router.go index 0dc574b4e7f..35f68eac2a4 100644 --- a/connector/metrics_router.go +++ b/connector/metrics_router.go @@ -12,8 +12,8 @@ import ( // MetricsRouterAndConsumer feeds the first consumer.Metrics in each of the specified pipelines. type MetricsRouterAndConsumer interface { consumer.Metrics - Consumer(...pipeline.PipelineID) (consumer.Metrics, error) - PipelineIDs() []pipeline.PipelineID + Consumer(...pipeline.ID) (consumer.Metrics, error) + PipelineIDs() []pipeline.ID privateFunc() } @@ -22,7 +22,7 @@ type metricsRouter struct { baseRouter[consumer.Metrics] } -func NewMetricsRouter(cm map[pipeline.PipelineID]consumer.Metrics) MetricsRouterAndConsumer { +func NewMetricsRouter(cm map[pipeline.ID]consumer.Metrics) MetricsRouterAndConsumer { consumers := make([]consumer.Metrics, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index c8ff597f541..2b19a1402a4 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -44,9 +44,9 @@ func TestMetricsRouterMultiplexing(t *testing.T) { func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]pipeline.PipelineID, 0, numCons) + allIDs := make([]pipeline.ID, 0, numCons) allCons := make([]consumer.Metrics, 0, numCons) - allConsMap := make(map[pipeline.PipelineID]consumer.Metrics) + allConsMap := make(map[pipeline.ID]consumer.Metrics) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -65,11 +65,11 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteMetrics. - expected := make(map[pipeline.PipelineID]int, numCons) + expected := make(map[pipeline.ID]int, numCons) for i := 0; i < numMetrics; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[pipeline.PipelineID]bool, numIDs) + randCons := make(map[pipeline.ID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -77,7 +77,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]pipeline.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.ID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -115,11 +115,11 @@ func TestMetricsRouterConsumers(t *testing.T) { foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) - r := NewMetricsRouter(map[pipeline.PipelineID]consumer.Metrics{fooID: foo, barID: bar}) + r := NewMetricsRouter(map[pipeline.ID]consumer.Metrics{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.ID{fooID, barID}, rcs) assert.Len(t, foo.AllMetrics(), 0) assert.Len(t, bar.AllMetrics(), 0) diff --git a/connector/router.go b/connector/router.go index c85f7485e47..86b0fe5f874 100644 --- a/connector/router.go +++ b/connector/router.go @@ -13,26 +13,26 @@ import ( type baseRouter[T any] struct { fanout func([]T) T - consumers map[pipeline.PipelineID]T + consumers map[pipeline.ID]T } -func newBaseRouter[T any](fanout func([]T) T, cm map[pipeline.PipelineID]T) baseRouter[T] { - consumers := make(map[pipeline.PipelineID]T, len(cm)) +func newBaseRouter[T any](fanout func([]T) T, cm map[pipeline.ID]T) baseRouter[T] { + consumers := make(map[pipeline.ID]T, len(cm)) for k, v := range cm { consumers[k] = v } return baseRouter[T]{fanout: fanout, consumers: consumers} } -func (r *baseRouter[T]) PipelineIDs() []pipeline.PipelineID { - ids := make([]pipeline.PipelineID, 0, len(r.consumers)) +func (r *baseRouter[T]) PipelineIDs() []pipeline.ID { + ids := make([]pipeline.ID, 0, len(r.consumers)) for id := range r.consumers { ids = append(ids, id) } return ids } -func (r *baseRouter[T]) Consumer(pipelineIDs ...pipeline.PipelineID) (T, error) { +func (r *baseRouter[T]) Consumer(pipelineIDs ...pipeline.ID) (T, error) { var ret T if len(pipelineIDs) == 0 { return ret, fmt.Errorf("missing consumers") diff --git a/connector/traces_router.go b/connector/traces_router.go index 6f953021de1..ec0a82d5474 100644 --- a/connector/traces_router.go +++ b/connector/traces_router.go @@ -12,8 +12,8 @@ import ( // TracesRouterAndConsumer feeds the first consumer.Traces in each of the specified pipelines. type TracesRouterAndConsumer interface { consumer.Traces - Consumer(...pipeline.PipelineID) (consumer.Traces, error) - PipelineIDs() []pipeline.PipelineID + Consumer(...pipeline.ID) (consumer.Traces, error) + PipelineIDs() []pipeline.ID privateFunc() } @@ -22,7 +22,7 @@ type tracesRouter struct { baseRouter[consumer.Traces] } -func NewTracesRouter(cm map[pipeline.PipelineID]consumer.Traces) TracesRouterAndConsumer { +func NewTracesRouter(cm map[pipeline.ID]consumer.Traces) TracesRouterAndConsumer { consumers := make([]consumer.Traces, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 857809275b6..0d0864d463a 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -43,9 +43,9 @@ func TestTracesRouterMultiplexing(t *testing.T) { func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { return func(t *testing.T) { - allIDs := make([]pipeline.PipelineID, 0, numCons) + allIDs := make([]pipeline.ID, 0, numCons) allCons := make([]consumer.Traces, 0, numCons) - allConsMap := make(map[pipeline.PipelineID]consumer.Traces) + allConsMap := make(map[pipeline.ID]consumer.Traces) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -64,11 +64,11 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // Keep track of how many logs each consumer should receive. // This will be validated after every call to RouteTraces. - expected := make(map[pipeline.PipelineID]int, numCons) + expected := make(map[pipeline.ID]int, numCons) for i := 0; i < numTraces; i++ { // Build a random set of ids (no duplicates) - randCons := make(map[pipeline.PipelineID]bool, numIDs) + randCons := make(map[pipeline.ID]bool, numIDs) for j := 0; j < numIDs; j++ { // This number should be pretty random and less than numCons conNum := (numCons + numIDs + i + j) % numCons @@ -76,7 +76,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { } // Convert to slice, update expectations - conIDs := make([]pipeline.PipelineID, 0, len(randCons)) + conIDs := make([]pipeline.ID, 0, len(randCons)) for id := range randCons { conIDs = append(conIDs, id) expected[id]++ @@ -114,11 +114,11 @@ func TestTracesRouterConsumer(t *testing.T) { foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) - r := NewTracesRouter(map[pipeline.PipelineID]consumer.Traces{fooID: foo, barID: bar}) + r := NewTracesRouter(map[pipeline.ID]consumer.Traces{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) - assert.ElementsMatch(t, []pipeline.PipelineID{fooID, barID}, rcs) + assert.ElementsMatch(t, []pipeline.ID{fooID, barID}, rcs) assert.Len(t, foo.AllTraces(), 0) assert.Len(t, bar.AllTraces(), 0) diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 4776c2503f0..513ad3ca538 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -11,39 +11,39 @@ import ( "go.opentelemetry.io/collector/component" ) -type PipelineID struct { +type ID struct { typeVal component.DataType `mapstructure:"-"` nameVal string `mapstructure:"-"` } // Type returns the type of the component. -func (id PipelineID) Type() component.DataType { +func (id ID) Type() component.DataType { return id.typeVal } // Name returns the custom name of the component. -func (id PipelineID) Name() string { +func (id ID) Name() string { return id.nameVal } -// NewPipelineID returns a new PipelineID with the given DataType and empty name. -func NewPipelineID(typeVal component.DataType) PipelineID { - return PipelineID{typeVal: typeVal} +// NewPipelineID returns a new ID with the given DataType and empty name. +func NewPipelineID(typeVal component.DataType) ID { + return ID{typeVal: typeVal} } -// NewPipelineIDWithName returns a new PipelineID with the given DataType and name. -func NewPipelineIDWithName(typeVal component.DataType, nameVal string) PipelineID { - return PipelineID{typeVal: typeVal, nameVal: nameVal} +// NewPipelineIDWithName returns a new ID with the given DataType and name. +func NewPipelineIDWithName(typeVal component.DataType, nameVal string) ID { + return ID{typeVal: typeVal, nameVal: nameVal} } // MarshalText implements the encoding.TextMarshaler interface. // This marshals the type and name as one string in the config. -func (id PipelineID) MarshalText() (text []byte, err error) { +func (id ID) MarshalText() (text []byte, err error) { return []byte(id.String()), nil } // UnmarshalText implements the encoding.TextUnmarshaler interface. -func (id *PipelineID) UnmarshalText(text []byte) error { +func (id *ID) UnmarshalText(text []byte) error { idStr := string(text) items := strings.SplitN(idStr, component.TypeAndNameSeparator, 2) var typeStr, nameStr string @@ -79,7 +79,7 @@ func (id *PipelineID) UnmarshalText(text []byte) error { } // String returns the ID string representation as "type[/name]" format. -func (id PipelineID) String() string { +func (id ID) String() string { if id.nameVal == "" { return id.typeVal.String() } diff --git a/pipeline/pipeline_test.go b/pipeline/pipeline_test.go index 54c46f50914..93c4b179628 100644 --- a/pipeline/pipeline_test.go +++ b/pipeline/pipeline_test.go @@ -27,19 +27,19 @@ func TestPipelineIDUnmarshalText(t *testing.T) { var testCases = []struct { idStr string expectedErr bool - expectedID PipelineID + expectedID ID }{ { idStr: "metrics", - expectedID: PipelineID{typeVal: component.DataTypeMetrics, nameVal: ""}, + expectedID: ID{typeVal: component.DataTypeMetrics, nameVal: ""}, }, { idStr: "logs/valid_name", - expectedID: PipelineID{typeVal: component.DataTypeLogs, nameVal: "valid_name"}, + expectedID: ID{typeVal: component.DataTypeLogs, nameVal: "valid_name"}, }, { idStr: " traces / valid_name ", - expectedID: PipelineID{typeVal: component.DataTypeTraces, nameVal: "valid_name"}, + expectedID: ID{typeVal: component.DataTypeTraces, nameVal: "valid_name"}, }, { idStr: "/valid_name", @@ -65,7 +65,7 @@ func TestPipelineIDUnmarshalText(t *testing.T) { for _, test := range testCases { t.Run(test.idStr, func(t *testing.T) { - id := PipelineID{} + id := ID{} err := id.UnmarshalText([]byte(test.idStr)) if test.expectedErr { assert.Error(t, err) diff --git a/service/internal/components/loggers.go b/service/internal/components/loggers.go index 7e269f00718..c473cc41984 100644 --- a/service/internal/components/loggers.go +++ b/service/internal/components/loggers.go @@ -29,7 +29,7 @@ func ReceiverLogger(logger *zap.Logger, id component.ID, dt component.DataType) zap.String(zapDataTypeKey, dt.String())) } -func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID pipeline.PipelineID) *zap.Logger { +func ProcessorLogger(logger *zap.Logger, id component.ID, pipelineID pipeline.ID) *zap.Logger { return logger.With( zap.String(zapKindKey, strings.ToLower(component.KindProcessor.String())), zap.String(zapNameKey, id.String()), diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index faf5db07fcf..f4e9354b4cf 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -46,7 +46,7 @@ type Settings struct { ExporterBuilder *exporter.Builder ConnectorBuilder *connector.Builder - // PipelineConfigs is a map of component.PipelineID to PipelineConfig. + // PipelineConfigs is a map of component.ID to PipelineConfig. PipelineConfigs pipelines.Config } @@ -55,7 +55,7 @@ type Graph struct { componentGraph *simple.DirectedGraph // Keep track of how nodes relate to pipelines, so we can declare edges in the graph. - pipelines map[pipeline.PipelineID]*pipelineNodes + pipelines map[pipeline.ID]*pipelineNodes // Keep track of status source per node instanceIDs map[int64]*pipelines.InstanceID @@ -68,7 +68,7 @@ type Graph struct { func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), - pipelines: make(map[pipeline.PipelineID]*pipelineNodes, len(set.PipelineConfigs)), + pipelines: make(map[pipeline.ID]*pipelineNodes, len(set.PipelineConfigs)), instanceIDs: make(map[int64]*pipelines.InstanceID), telemetry: set.Telemetry, } @@ -92,8 +92,8 @@ func (g *Graph) createNodes(set Settings) error { connectors := make(map[component.ID]struct{}) // Keep track of connectors and where they are used. (map[connectorID][]pipelineID) - connectorsAsExporter := make(map[component.ID][]pipeline.PipelineID) - connectorsAsReceiver := make(map[component.ID][]pipeline.PipelineID) + connectorsAsExporter := make(map[component.ID][]pipeline.ID) + connectorsAsReceiver := make(map[component.ID][]pipeline.ID) // Build each pipelineNodes struct for each pipeline by parsing the pipelineCfg. // Also populates the connectors, connectorsAsExporter and connectorsAsReceiver maps. @@ -191,7 +191,7 @@ func (g *Graph) createNodes(set Settings) error { return nil } -func (g *Graph) createReceiver(pipelineID pipeline.PipelineID, recvID component.ID) *receiverNode { +func (g *Graph) createReceiver(pipelineID pipeline.ID, recvID component.ID) *receiverNode { rcvrNode := newReceiverNode(pipelineID.Type(), recvID) if node := g.componentGraph.Node(rcvrNode.ID()); node != nil { g.instanceIDs[node.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -201,27 +201,27 @@ func (g *Graph) createReceiver(pipelineID pipeline.PipelineID, recvID component. g.instanceIDs[rcvrNode.ID()] = &pipelines.InstanceID{ ID: recvID, Kind: component.KindReceiver, - PipelineIDs: map[pipeline.PipelineID]struct{}{ + PipelineIDs: map[pipeline.ID]struct{}{ pipelineID: {}, }, } return rcvrNode } -func (g *Graph) createProcessor(pipelineID pipeline.PipelineID, procID component.ID) *processorNode { +func (g *Graph) createProcessor(pipelineID pipeline.ID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) g.instanceIDs[procNode.ID()] = &pipelines.InstanceID{ ID: procID, Kind: component.KindProcessor, - PipelineIDs: map[pipeline.PipelineID]struct{}{ + PipelineIDs: map[pipeline.ID]struct{}{ pipelineID: {}, }, } return procNode } -func (g *Graph) createExporter(pipelineID pipeline.PipelineID, exprID component.ID) *exporterNode { +func (g *Graph) createExporter(pipelineID pipeline.ID, exprID component.ID) *exporterNode { expNode := newExporterNode(pipelineID.Type(), exprID) if node := g.componentGraph.Node(expNode.ID()); node != nil { g.instanceIDs[expNode.ID()].PipelineIDs[pipelineID] = struct{}{} @@ -231,14 +231,14 @@ func (g *Graph) createExporter(pipelineID pipeline.PipelineID, exprID component. g.instanceIDs[expNode.ID()] = &pipelines.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, - PipelineIDs: map[pipeline.PipelineID]struct{}{ + PipelineIDs: map[pipeline.ID]struct{}{ pipelineID: {}, }, } return expNode } -func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID pipeline.PipelineID, connID component.ID) *connectorNode { +func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID pipeline.ID, connID component.ID) *connectorNode { connNode := newConnectorNode(exprPipelineID.Type(), rcvrPipelineID.Type(), connID) if node := g.componentGraph.Node(connNode.ID()); node != nil { instanceID := g.instanceIDs[connNode.ID()] @@ -250,7 +250,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID pipeline.Pipeline g.instanceIDs[connNode.ID()] = &pipelines.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, - PipelineIDs: map[pipeline.PipelineID]struct{}{ + PipelineIDs: map[pipeline.ID]struct{}{ exprPipelineID: {}, rcvrPipelineID: {}, }, diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index eb7f4252d22..176a46b0837 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -771,7 +771,7 @@ func TestConnectorPipelinesGraph(t *testing.T) { assert.NoError(t, pg.StartAll(context.Background(), componenttest.NewNopHost())) - mutatingPipelines := make(map[pipeline.PipelineID]bool, len(test.pipelineConfigs)) + mutatingPipelines := make(map[pipeline.ID]bool, len(test.pipelineConfigs)) // Check each pipeline individually, ensuring that all components are started // and that they have observed no signals yet. @@ -2390,7 +2390,7 @@ func (g *Graph) getReceivers() map[component.DataType]map[component.ID]component // However, within an individual pipeline, we expect: // - E instances of the connector as a receiver. // - R instances of the connector as an exporter. -func expectedInstances(m pipelines.Config, pID pipeline.PipelineID) (int, int) { +func expectedInstances(m pipelines.Config, pID pipeline.ID) (int, int) { exConnectorType := component.MustNewType("exampleconnector") var r, e int for _, rID := range m[pID].Receivers { diff --git a/service/internal/graph/nodes.go b/service/internal/graph/nodes.go index dfec33c4271..a98e31bc7dc 100644 --- a/service/internal/graph/nodes.go +++ b/service/internal/graph/nodes.go @@ -112,11 +112,11 @@ var _ consumerNode = (*processorNode)(nil) type processorNode struct { nodeID componentID component.ID - pipelineID pipeline.PipelineID + pipelineID pipeline.ID component.Component } -func newProcessorNode(pipelineID pipeline.PipelineID, procID component.ID) *processorNode { +func newProcessorNode(pipelineID pipeline.ID, procID component.ID) *processorNode { return &processorNode{ nodeID: newNodeID(processorSeed, pipelineID.String(), procID.String()), componentID: procID, @@ -240,7 +240,7 @@ func (n *connectorNode) buildComponent( switch n.rcvrPipelineType { case component.DataTypeTraces: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[pipeline.PipelineID]consumer.Traces, len(nexts)) + consumers := make(map[pipeline.ID]consumer.Traces, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Traces) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -276,7 +276,7 @@ func (n *connectorNode) buildComponent( case component.DataTypeMetrics: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[pipeline.PipelineID]consumer.Metrics, len(nexts)) + consumers := make(map[pipeline.ID]consumer.Metrics, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Metrics) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -311,7 +311,7 @@ func (n *connectorNode) buildComponent( } case component.DataTypeLogs: capability := consumer.Capabilities{MutatesData: false} - consumers := make(map[pipeline.PipelineID]consumer.Logs, len(nexts)) + consumers := make(map[pipeline.ID]consumer.Logs, len(nexts)) for _, next := range nexts { consumers[next.(*capabilitiesNode).pipelineID] = next.(consumer.Logs) capability.MutatesData = capability.MutatesData || next.Capabilities().MutatesData @@ -357,14 +357,14 @@ var _ consumerNode = (*capabilitiesNode)(nil) // The nodeID is derived from "pipeline ID". type capabilitiesNode struct { nodeID - pipelineID pipeline.PipelineID + pipelineID pipeline.ID baseConsumer consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc } -func newCapabilitiesNode(pipelineID pipeline.PipelineID) *capabilitiesNode { +func newCapabilitiesNode(pipelineID pipeline.ID) *capabilitiesNode { return &capabilitiesNode{ nodeID: newNodeID(capabilitiesSeed, pipelineID.String()), pipelineID: pipelineID, @@ -381,11 +381,11 @@ var _ consumerNode = (*fanOutNode)(nil) // Therefore, nodeID is derived from "pipeline ID". type fanOutNode struct { nodeID - pipelineID pipeline.PipelineID + pipelineID pipeline.ID baseConsumer } -func newFanOutNode(pipelineID pipeline.PipelineID) *fanOutNode { +func newFanOutNode(pipelineID pipeline.ID) *fanOutNode { return &fanOutNode{ nodeID: newNodeID(fanOutToExporters, pipelineID.String()), pipelineID: pipelineID, diff --git a/service/internal/testcomponents/example_router.go b/service/internal/testcomponents/example_router.go index 68b20a15ba1..a71d26264ed 100644 --- a/service/internal/testcomponents/example_router.go +++ b/service/internal/testcomponents/example_router.go @@ -27,8 +27,8 @@ var ExampleRouterFactory = connector.NewFactory( ) type LeftRightConfig struct { - Left pipeline.PipelineID `mapstructure:"left"` - Right pipeline.PipelineID `mapstructure:"right"` + Left pipeline.ID `mapstructure:"left"` + Right pipeline.ID `mapstructure:"right"` } type ExampleRouterConfig struct { diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index 5fd75c0956e..ed8d1f94094 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -42,7 +42,7 @@ func TestTracesRouter(t *testing.T) { // Many connectors will just call router.ConsumeTraces, // but some implementation will call RouteTraces instead. router := connector.NewTracesRouter( - map[pipeline.PipelineID]consumer.Traces{ + map[pipeline.ID]consumer.Traces{ leftID: sinkLeft, rightID: sinkRight, }) @@ -81,7 +81,7 @@ func TestMetricsRouter(t *testing.T) { // Many connectors will just call router.ConsumeMetrics, // but some implementation will call RouteMetrics instead. router := connector.NewMetricsRouter( - map[pipeline.PipelineID]consumer.Metrics{ + map[pipeline.ID]consumer.Metrics{ leftID: sinkLeft, rightID: sinkRight, }) @@ -120,7 +120,7 @@ func TestLogsRouter(t *testing.T) { // Many connectors will just call router.ConsumeLogs, // but some implementation will call RouteLogs instead. router := connector.NewLogsRouter( - map[pipeline.PipelineID]consumer.Logs{ + map[pipeline.ID]consumer.Logs{ leftID: sinkLeft, rightID: sinkRight, }) diff --git a/service/pipelines/config.go b/service/pipelines/config.go index 65f7b0ebe9b..1416272c7c7 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -18,7 +18,7 @@ var ( ) // Config defines the configurable settings for service telemetry. -type Config map[pipeline.PipelineID]*PipelineConfig +type Config map[pipeline.ID]*PipelineConfig func (cfg Config) Validate() error { // Must have at least one pipeline. @@ -77,5 +77,5 @@ func (cfg *PipelineConfig) Validate() error { type InstanceID struct { ID component.ID Kind component.Kind - PipelineIDs map[pipeline.PipelineID]struct{} + PipelineIDs map[pipeline.ID]struct{} } diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index e7a6cdcea30..d6caaf3811f 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -84,7 +84,7 @@ func TestConfigValidate(t *testing.T) { } func generateConfig() Config { - return map[pipeline.PipelineID]*PipelineConfig{ + return map[pipeline.ID]*PipelineConfig{ pipeline.NewPipelineID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, From 2c1a00b7adf7c2c6192217088afc312ae5564a33 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:06:03 -0400 Subject: [PATCH 29/38] instance id move --- extension/extension.go | 4 +-- .../extensiontest/statuswatcher_extension.go | 8 ++--- .../statuswatcher_extension_test.go | 6 ++-- .../sharedcomponent/sharedcomponent_test.go | 10 +++--- otelcol/collector_test.go | 6 ++-- pipeline/instance.go | 10 ++++++ service/extensions/extensions.go | 10 +++--- service/extensions/extensions_test.go | 4 +-- service/host.go | 4 +-- service/internal/graph/graph.go | 12 +++---- service/internal/graph/graph_test.go | 32 +++++++++---------- .../proctelemetry/process_telemetry.go | 4 +-- .../nop_telemetry_settings.go | 4 +-- .../nop_telemetry_settings_test.go | 6 ++-- .../servicetelemetry/telemetry_settings.go | 4 +-- .../telemetry_settings_test.go | 10 +++--- service/internal/status/status.go | 18 +++++------ service/internal/status/status_test.go | 24 +++++++------- service/pipelines/config.go | 7 ---- service/service_test.go | 2 +- 20 files changed, 94 insertions(+), 91 deletions(-) create mode 100644 pipeline/instance.go diff --git a/extension/extension.go b/extension/extension.go index 3284cd39cf8..7badac31f51 100644 --- a/extension/extension.go +++ b/extension/extension.go @@ -9,7 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) // Extension is the interface for objects hosted by the OpenTelemetry Collector that @@ -60,7 +60,7 @@ type StatusWatcher interface { // Extensions that implement this interface must be ready that the ComponentStatusChanged // may be called before, after or concurrently with calls to Component.Start() and Component.Shutdown(). // The function may be called concurrently with itself. - ComponentStatusChanged(source *pipelines.InstanceID, event *component.StatusEvent) + ComponentStatusChanged(source *pipeline.InstanceID, event *component.StatusEvent) } // CreateSettings is passed to Factory.Create(...) function. diff --git a/extension/extensiontest/statuswatcher_extension.go b/extension/extensiontest/statuswatcher_extension.go index 0ad5ca94c07..3477698b0a6 100644 --- a/extension/extensiontest/statuswatcher_extension.go +++ b/extension/extensiontest/statuswatcher_extension.go @@ -9,7 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) // NewStatusWatcherExtensionCreateSettings returns a new nop settings for Create*Extension functions. @@ -22,7 +22,7 @@ func NewStatusWatcherExtensionCreateSettings() extension.Settings { // NewStatusWatcherExtensionFactory returns a component.ExtensionFactory to construct a status watcher extension. func NewStatusWatcherExtensionFactory( - onStatusChanged func(source *pipelines.InstanceID, event *component.StatusEvent), + onStatusChanged func(source *pipeline.InstanceID, event *component.StatusEvent), ) extension.Factory { return extension.NewFactory( component.MustNewType("statuswatcher"), @@ -40,9 +40,9 @@ func NewStatusWatcherExtensionFactory( type statusWatcherExtension struct { component.StartFunc component.ShutdownFunc - onStatusChanged func(source *pipelines.InstanceID, event *component.StatusEvent) + onStatusChanged func(source *pipeline.InstanceID, event *component.StatusEvent) } -func (e statusWatcherExtension) ComponentStatusChanged(source *pipelines.InstanceID, event *component.StatusEvent) { +func (e statusWatcherExtension) ComponentStatusChanged(source *pipeline.InstanceID, event *component.StatusEvent) { e.onStatusChanged(source, event) } diff --git a/extension/extensiontest/statuswatcher_extension_test.go b/extension/extensiontest/statuswatcher_extension_test.go index c452479d7d6..f54de7c403d 100644 --- a/extension/extensiontest/statuswatcher_extension_test.go +++ b/extension/extensiontest/statuswatcher_extension_test.go @@ -13,13 +13,13 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) func TestStatusWatcherExtension(t *testing.T) { statusChanged := false factory := NewStatusWatcherExtensionFactory( - func(*pipelines.InstanceID, *component.StatusEvent) { + func(*pipeline.InstanceID, *component.StatusEvent) { statusChanged = true }, ) @@ -33,7 +33,7 @@ func TestStatusWatcherExtension(t *testing.T) { assert.NoError(t, ext.Start(context.Background(), componenttest.NewNopHost())) assert.False(t, statusChanged) - ext.(extension.StatusWatcher).ComponentStatusChanged(&pipelines.InstanceID{}, &component.StatusEvent{}) + ext.(extension.StatusWatcher).ComponentStatusChanged(&pipeline.InstanceID{}, &component.StatusEvent{}) assert.True(t, statusChanged) assert.NoError(t, ext.Shutdown(context.Background())) diff --git a/internal/sharedcomponent/sharedcomponent_test.go b/internal/sharedcomponent/sharedcomponent_test.go index 66d29d5db9e..8ff88059ac7 100644 --- a/internal/sharedcomponent/sharedcomponent_test.go +++ b/internal/sharedcomponent/sharedcomponent_test.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) var id = component.MustNewID("test") @@ -109,9 +109,9 @@ func TestSharedComponent(t *testing.T) { assert.Equal(t, 1, calledStop) } func TestSharedComponentsReportStatus(t *testing.T) { - reportedStatuses := make(map[*pipelines.InstanceID][]component.Status) + reportedStatuses := make(map[*pipeline.InstanceID][]component.Status) newStatusFunc := func() func(*component.StatusEvent) { - instanceID := &pipelines.InstanceID{} + instanceID := &pipeline.InstanceID{} return func(ev *component.StatusEvent) { if ev.Status() == component.StatusNone { return @@ -219,9 +219,9 @@ func TestReportStatusOnStartShutdown(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - reportedStatuses := make(map[*pipelines.InstanceID][]component.Status) + reportedStatuses := make(map[*pipeline.InstanceID][]component.Status) newStatusFunc := func() func(*component.StatusEvent) { - instanceID := &pipelines.InstanceID{} + instanceID := &pipeline.InstanceID{} return func(ev *component.StatusEvent) { reportedStatuses[instanceID] = append(reportedStatuses[instanceID], ev.Status()) } diff --git a/otelcol/collector_test.go b/otelcol/collector_test.go index 226cfe912c3..486f6e5930d 100644 --- a/otelcol/collector_test.go +++ b/otelcol/collector_test.go @@ -19,8 +19,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension/extensiontest" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor/processortest" - "go.opentelemetry.io/collector/service/pipelines" ) func TestStateString(t *testing.T) { @@ -143,9 +143,9 @@ func TestComponentStatusWatcher(t *testing.T) { factories.Processors[unhealthyProcessorFactory.Type()] = unhealthyProcessorFactory // Keep track of all status changes in a map. - changedComponents := map[*pipelines.InstanceID][]component.Status{} + changedComponents := map[*pipeline.InstanceID][]component.Status{} var mux sync.Mutex - onStatusChanged := func(source *pipelines.InstanceID, event *component.StatusEvent) { + onStatusChanged := func(source *pipeline.InstanceID, event *component.StatusEvent) { if source.ID.Type() != unhealthyProcessorFactory.Type() { return } diff --git a/pipeline/instance.go b/pipeline/instance.go new file mode 100644 index 00000000000..4c77a88fa8f --- /dev/null +++ b/pipeline/instance.go @@ -0,0 +1,10 @@ +package pipeline + +import "go.opentelemetry.io/collector/component" + +// InstanceID uniquely identifies a component instance +type InstanceID struct { + ID component.ID + Kind component.Kind + PipelineIDs map[ID]struct{} +} diff --git a/service/extensions/extensions.go b/service/extensions/extensions.go index 30c16ac5ce9..2fff134193e 100644 --- a/service/extensions/extensions.go +++ b/service/extensions/extensions.go @@ -14,10 +14,10 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/components" "go.opentelemetry.io/collector/service/internal/servicetelemetry" "go.opentelemetry.io/collector/service/internal/zpages" - "go.opentelemetry.io/collector/service/pipelines" ) const zExtensionName = "zextensionname" @@ -26,7 +26,7 @@ const zExtensionName = "zextensionname" type Extensions struct { telemetry servicetelemetry.TelemetrySettings extMap map[component.ID]extension.Extension - instanceIDs map[component.ID]*pipelines.InstanceID + instanceIDs map[component.ID]*pipeline.InstanceID extensionIDs []component.ID // start order (and reverse stop order) } @@ -119,7 +119,7 @@ func (bes *Extensions) NotifyConfig(ctx context.Context, conf *confmap.Conf) err return errs } -func (bes *Extensions) NotifyComponentStatusChange(source *pipelines.InstanceID, event *component.StatusEvent) { +func (bes *Extensions) NotifyComponentStatusChange(source *pipeline.InstanceID, event *component.StatusEvent) { for _, extID := range bes.extensionIDs { ext := bes.extMap[extID] if sw, ok := ext.(extension.StatusWatcher); ok { @@ -176,11 +176,11 @@ func New(ctx context.Context, set Settings, cfg Config) (*Extensions, error) { exts := &Extensions{ telemetry: set.Telemetry, extMap: make(map[component.ID]extension.Extension), - instanceIDs: make(map[component.ID]*pipelines.InstanceID), + instanceIDs: make(map[component.ID]*pipeline.InstanceID), extensionIDs: make([]component.ID, 0, len(cfg)), } for _, extID := range cfg { - instanceID := &pipelines.InstanceID{ + instanceID := &pipeline.InstanceID{ ID: extID, Kind: component.KindExtension, } diff --git a/service/extensions/extensions_test.go b/service/extensions/extensions_test.go index b9f21a4eea8..43a0ebd98da 100644 --- a/service/extensions/extensions_test.go +++ b/service/extensions/extensions_test.go @@ -16,9 +16,9 @@ import ( "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/extension/extensiontest" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/servicetelemetry" "go.opentelemetry.io/collector/service/internal/status" - "go.opentelemetry.io/collector/service/pipelines" ) func TestBuildExtensions(t *testing.T) { @@ -434,7 +434,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { assert.NoError(t, err) var actualStatuses []*component.StatusEvent - rep := status.NewReporter(func(_ *pipelines.InstanceID, ev *component.StatusEvent) { + rep := status.NewReporter(func(_ *pipeline.InstanceID, ev *component.StatusEvent) { actualStatuses = append(actualStatuses, ev) }, func(err error) { require.NoError(t, err) diff --git a/service/host.go b/service/host.go index 134183ac951..e462a6366db 100644 --- a/service/host.go +++ b/service/host.go @@ -8,11 +8,11 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/service/extensions" "go.opentelemetry.io/collector/service/internal/graph" - "go.opentelemetry.io/collector/service/pipelines" ) // TODO: remove as part of https://github.com/open-telemetry/opentelemetry-collector/issues/7370 for service 1.0 @@ -67,7 +67,7 @@ func (host *serviceHost) GetExporters() map[component.DataType]map[component.ID] return host.pipelines.GetExporters() } -func (host *serviceHost) notifyComponentStatusChange(source *pipelines.InstanceID, event *component.StatusEvent) { +func (host *serviceHost) notifyComponentStatusChange(source *pipeline.InstanceID, event *component.StatusEvent) { host.serviceExtensions.NotifyComponentStatusChange(source, event) if event.Status() == component.StatusFatalError { host.asyncErrorChannel <- event.Err() diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index f4e9354b4cf..6273895ad89 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -58,7 +58,7 @@ type Graph struct { pipelines map[pipeline.ID]*pipelineNodes // Keep track of status source per node - instanceIDs map[int64]*pipelines.InstanceID + instanceIDs map[int64]*pipeline.InstanceID telemetry servicetelemetry.TelemetrySettings } @@ -69,7 +69,7 @@ func Build(ctx context.Context, set Settings) (*Graph, error) { pipelines := &Graph{ componentGraph: simple.NewDirectedGraph(), pipelines: make(map[pipeline.ID]*pipelineNodes, len(set.PipelineConfigs)), - instanceIDs: make(map[int64]*pipelines.InstanceID), + instanceIDs: make(map[int64]*pipeline.InstanceID), telemetry: set.Telemetry, } for pipelineID := range set.PipelineConfigs { @@ -198,7 +198,7 @@ func (g *Graph) createReceiver(pipelineID pipeline.ID, recvID component.ID) *rec return node.(*receiverNode) } g.componentGraph.AddNode(rcvrNode) - g.instanceIDs[rcvrNode.ID()] = &pipelines.InstanceID{ + g.instanceIDs[rcvrNode.ID()] = &pipeline.InstanceID{ ID: recvID, Kind: component.KindReceiver, PipelineIDs: map[pipeline.ID]struct{}{ @@ -211,7 +211,7 @@ func (g *Graph) createReceiver(pipelineID pipeline.ID, recvID component.ID) *rec func (g *Graph) createProcessor(pipelineID pipeline.ID, procID component.ID) *processorNode { procNode := newProcessorNode(pipelineID, procID) g.componentGraph.AddNode(procNode) - g.instanceIDs[procNode.ID()] = &pipelines.InstanceID{ + g.instanceIDs[procNode.ID()] = &pipeline.InstanceID{ ID: procID, Kind: component.KindProcessor, PipelineIDs: map[pipeline.ID]struct{}{ @@ -228,7 +228,7 @@ func (g *Graph) createExporter(pipelineID pipeline.ID, exprID component.ID) *exp return node.(*exporterNode) } g.componentGraph.AddNode(expNode) - g.instanceIDs[expNode.ID()] = &pipelines.InstanceID{ + g.instanceIDs[expNode.ID()] = &pipeline.InstanceID{ ID: expNode.componentID, Kind: component.KindExporter, PipelineIDs: map[pipeline.ID]struct{}{ @@ -247,7 +247,7 @@ func (g *Graph) createConnector(exprPipelineID, rcvrPipelineID pipeline.ID, conn return node.(*connectorNode) } g.componentGraph.AddNode(connNode) - g.instanceIDs[connNode.ID()] = &pipelines.InstanceID{ + g.instanceIDs[connNode.ID()] = &pipeline.InstanceID{ ID: connNode.componentID, Kind: component.KindConnector, PipelineIDs: map[pipeline.ID]struct{}{ diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index 176a46b0837..2194d799cfd 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -146,12 +146,12 @@ func TestGraphStartStop(t *testing.T) { pg := &Graph{componentGraph: simple.NewDirectedGraph()} pg.telemetry = servicetelemetry.NewNopTelemetrySettings() - pg.instanceIDs = make(map[int64]*pipelines.InstanceID) + pg.instanceIDs = make(map[int64]*pipeline.InstanceID) for _, edge := range tt.edges { f, t := &testNode{id: edge[0]}, &testNode{id: edge[1]} - pg.instanceIDs[f.ID()] = &pipelines.InstanceID{} - pg.instanceIDs[t.ID()] = &pipelines.InstanceID{} + pg.instanceIDs[f.ID()] = &pipeline.InstanceID{} + pg.instanceIDs[t.ID()] = &pipeline.InstanceID{} pg.componentGraph.SetEdge(simple.Edge{F: f, T: t}) } @@ -177,7 +177,7 @@ func TestGraphStartStopCycle(t *testing.T) { c1 := &testNode{id: component.MustNewIDWithName("c", "1")} e1 := &testNode{id: component.MustNewIDWithName("e", "1")} - pg.instanceIDs = map[int64]*pipelines.InstanceID{ + pg.instanceIDs = map[int64]*pipeline.InstanceID{ r1.ID(): {}, p1.ID(): {}, c1.ID(): {}, @@ -209,7 +209,7 @@ func TestGraphStartStopComponentError(t *testing.T) { id: component.MustNewIDWithName("e", "1"), shutdownErr: errors.New("bar"), } - pg.instanceIDs = map[int64]*pipelines.InstanceID{ + pg.instanceIDs = map[int64]*pipeline.InstanceID{ r1.ID(): {}, e1.ID(): {}, } @@ -2214,7 +2214,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { eStErr := &testNode{id: component.MustNewIDWithName("e_st_err", "1"), startErr: assert.AnError} eSdErr := &testNode{id: component.MustNewIDWithName("e_sd_err", "1"), shutdownErr: assert.AnError} - instanceIDs := map[*testNode]*pipelines.InstanceID{ + instanceIDs := map[*testNode]*pipeline.InstanceID{ rNoErr: {ID: rNoErr.id}, rStErr: {ID: rStErr.id}, rSdErr: {ID: rSdErr.id}, @@ -2224,7 +2224,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { } // compare two maps of status events ignoring timestamp - assertEqualStatuses := func(t *testing.T, evMap1, evMap2 map[*pipelines.InstanceID][]*component.StatusEvent) { + assertEqualStatuses := func(t *testing.T, evMap1, evMap2 map[*pipeline.InstanceID][]*component.StatusEvent) { assert.Equal(t, len(evMap1), len(evMap2)) for id, evts1 := range evMap1 { evts2 := evMap2[id] @@ -2242,14 +2242,14 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { for _, tc := range []struct { name string edge [2]*testNode - expectedStatuses map[*pipelines.InstanceID][]*component.StatusEvent + expectedStatuses map[*pipeline.InstanceID][]*component.StatusEvent startupErr error shutdownErr error }{ { name: "successful startup/shutdown", edge: [2]*testNode{rNoErr, eNoErr}, - expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipeline.InstanceID][]*component.StatusEvent{ instanceIDs[rNoErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2267,7 +2267,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "early startup error", edge: [2]*testNode{rNoErr, eStErr}, - expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipeline.InstanceID][]*component.StatusEvent{ instanceIDs[eStErr]: { component.NewStatusEvent(component.StatusStarting), component.NewPermanentErrorEvent(assert.AnError), @@ -2278,7 +2278,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "late startup error", edge: [2]*testNode{rStErr, eNoErr}, - expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipeline.InstanceID][]*component.StatusEvent{ instanceIDs[rStErr]: { component.NewStatusEvent(component.StatusStarting), component.NewPermanentErrorEvent(assert.AnError), @@ -2295,7 +2295,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "early shutdown error", edge: [2]*testNode{rSdErr, eNoErr}, - expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipeline.InstanceID][]*component.StatusEvent{ instanceIDs[rSdErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2314,7 +2314,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { { name: "late shutdown error", edge: [2]*testNode{rNoErr, eSdErr}, - expectedStatuses: map[*pipelines.InstanceID][]*component.StatusEvent{ + expectedStatuses: map[*pipeline.InstanceID][]*component.StatusEvent{ instanceIDs[rNoErr]: { component.NewStatusEvent(component.StatusStarting), component.NewStatusEvent(component.StatusOK), @@ -2335,8 +2335,8 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { pg := &Graph{componentGraph: simple.NewDirectedGraph()} pg.telemetry = servicetelemetry.NewNopTelemetrySettings() - actualStatuses := make(map[*pipelines.InstanceID][]*component.StatusEvent) - rep := status.NewReporter(func(id *pipelines.InstanceID, ev *component.StatusEvent) { + actualStatuses := make(map[*pipeline.InstanceID][]*component.StatusEvent) + rep := status.NewReporter(func(id *pipeline.InstanceID, ev *component.StatusEvent) { actualStatuses[id] = append(actualStatuses[id], ev) }, func(error) { }) @@ -2345,7 +2345,7 @@ func TestStatusReportedOnStartupShutdown(t *testing.T) { rep.Ready() e0, e1 := tc.edge[0], tc.edge[1] - pg.instanceIDs = map[int64]*pipelines.InstanceID{ + pg.instanceIDs = map[int64]*pipeline.InstanceID{ e0.ID(): instanceIDs[e0], e1.ID(): instanceIDs[e1], } diff --git a/service/internal/proctelemetry/process_telemetry.go b/service/internal/proctelemetry/process_telemetry.go index 62cafb3023d..ebc3fc90b43 100644 --- a/service/internal/proctelemetry/process_telemetry.go +++ b/service/internal/proctelemetry/process_telemetry.go @@ -13,9 +13,9 @@ import ( "github.com/shirou/gopsutil/v3/common" "github.com/shirou/gopsutil/v3/process" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/metadata" "go.opentelemetry.io/collector/service/internal/servicetelemetry" - "go.opentelemetry.io/collector/service/pipelines" ) // processMetrics is a struct that contains views related to process metrics (cpu, mem, etc) @@ -76,7 +76,7 @@ func RegisterProcessMetrics(cfg servicetelemetry.TelemetrySettings, ballastSizeB return err } - _, err = metadata.NewTelemetryBuilder(cfg.ToComponentTelemetrySettings(&pipelines.InstanceID{}), + _, err = metadata.NewTelemetryBuilder(cfg.ToComponentTelemetrySettings(&pipeline.InstanceID{}), metadata.WithProcessUptimeCallback(pm.updateProcessUptime), metadata.WithProcessRuntimeHeapAllocBytesCallback(pm.updateAllocMem), metadata.WithProcessRuntimeTotalAllocBytesCallback(pm.updateTotalAllocMem), diff --git a/service/internal/servicetelemetry/nop_telemetry_settings.go b/service/internal/servicetelemetry/nop_telemetry_settings.go index b17d9820831..f95cfc07a72 100644 --- a/service/internal/servicetelemetry/nop_telemetry_settings.go +++ b/service/internal/servicetelemetry/nop_telemetry_settings.go @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/status" - "go.opentelemetry.io/collector/service/pipelines" ) // NewNopTelemetrySettings returns a new nop settings for Create* functions. @@ -23,6 +23,6 @@ func NewNopTelemetrySettings() TelemetrySettings { MeterProvider: noopmetric.NewMeterProvider(), MetricsLevel: configtelemetry.LevelNone, Resource: pcommon.NewResource(), - Status: status.NewReporter(func(*pipelines.InstanceID, *component.StatusEvent) {}, func(error) {}), + Status: status.NewReporter(func(*pipeline.InstanceID, *component.StatusEvent) {}, func(error) {}), } } diff --git a/service/internal/servicetelemetry/nop_telemetry_settings_test.go b/service/internal/servicetelemetry/nop_telemetry_settings_test.go index 2efe82f97d7..1f6089e0ffe 100644 --- a/service/internal/servicetelemetry/nop_telemetry_settings_test.go +++ b/service/internal/servicetelemetry/nop_telemetry_settings_test.go @@ -14,7 +14,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) func TestNewNopSettings(t *testing.T) { @@ -28,9 +28,9 @@ func TestNewNopSettings(t *testing.T) { require.Equal(t, configtelemetry.LevelNone, set.MetricsLevel) require.Equal(t, pcommon.NewResource(), set.Resource) set.Status.ReportStatus( - &pipelines.InstanceID{}, + &pipeline.InstanceID{}, component.NewStatusEvent(component.StatusStarting), ) - set.Status.ReportOKIfStarting(&pipelines.InstanceID{}) + set.Status.ReportOKIfStarting(&pipeline.InstanceID{}) } diff --git a/service/internal/servicetelemetry/telemetry_settings.go b/service/internal/servicetelemetry/telemetry_settings.go index 320a37db216..2a3720da9fa 100644 --- a/service/internal/servicetelemetry/telemetry_settings.go +++ b/service/internal/servicetelemetry/telemetry_settings.go @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/status" - "go.opentelemetry.io/collector/service/pipelines" ) // TelemetrySettings mirrors component.TelemetrySettings except for the mechanism for reporting @@ -43,7 +43,7 @@ type TelemetrySettings struct { // ToComponentTelemetrySettings returns a TelemetrySettings for a specific component derived from // this service level Settings object. -func (s TelemetrySettings) ToComponentTelemetrySettings(id *pipelines.InstanceID) component.TelemetrySettings { +func (s TelemetrySettings) ToComponentTelemetrySettings(id *pipeline.InstanceID) component.TelemetrySettings { statusFunc := status.NewReportStatusFunc(id, s.Status.ReportStatus) return component.TelemetrySettings{ Logger: s.Logger, diff --git a/service/internal/servicetelemetry/telemetry_settings_test.go b/service/internal/servicetelemetry/telemetry_settings_test.go index b3068a61c4d..f963aaede70 100644 --- a/service/internal/servicetelemetry/telemetry_settings_test.go +++ b/service/internal/servicetelemetry/telemetry_settings_test.go @@ -14,8 +14,8 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/service/internal/status" - "go.opentelemetry.io/collector/service/pipelines" ) func TestSettings(t *testing.T) { @@ -26,16 +26,16 @@ func TestSettings(t *testing.T) { MetricsLevel: configtelemetry.LevelNone, Resource: pcommon.NewResource(), Status: status.NewReporter( - func(*pipelines.InstanceID, *component.StatusEvent) {}, + func(*pipeline.InstanceID, *component.StatusEvent) {}, func(err error) { require.NoError(t, err) }), } set.Status.Ready() set.Status.ReportStatus( - &pipelines.InstanceID{}, + &pipeline.InstanceID{}, component.NewStatusEvent(component.StatusStarting), ) - set.Status.ReportOKIfStarting(&pipelines.InstanceID{}) + set.Status.ReportOKIfStarting(&pipeline.InstanceID{}) - compSet := set.ToComponentTelemetrySettings(&pipelines.InstanceID{}) + compSet := set.ToComponentTelemetrySettings(&pipeline.InstanceID{}) compSet.ReportStatus(component.NewStatusEvent(component.StatusStarting)) } diff --git a/service/internal/status/status.go b/service/internal/status/status.go index b31f59eabd1..5a82f686f12 100644 --- a/service/internal/status/status.go +++ b/service/internal/status/status.go @@ -9,7 +9,7 @@ import ( "sync" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) // onTransitionFunc receives a component.StatusEvent on a successful state transition @@ -85,13 +85,13 @@ func newFSM(onTransition onTransitionFunc) *fsm { } // NotifyStatusFunc is the receiver of status events after successful state transitions -type NotifyStatusFunc func(*pipelines.InstanceID, *component.StatusEvent) +type NotifyStatusFunc func(*pipeline.InstanceID, *component.StatusEvent) // InvalidTransitionFunc is the receiver of invalid transition errors type InvalidTransitionFunc func(error) // ServiceStatusFunc is the expected type of ReportStatus for servicetelemetry.Settings -type ServiceStatusFunc func(*pipelines.InstanceID, *component.StatusEvent) +type ServiceStatusFunc func(*pipeline.InstanceID, *component.StatusEvent) // ErrStatusNotReady is returned when trying to report status before service start var ErrStatusNotReady = errors.New("report component status is not ready until service start") @@ -100,7 +100,7 @@ var ErrStatusNotReady = errors.New("report component status is not ready until s type Reporter struct { mu sync.Mutex ready bool - fsmMap map[*pipelines.InstanceID]*fsm + fsmMap map[*pipeline.InstanceID]*fsm onStatusChange NotifyStatusFunc onInvalidTransition InvalidTransitionFunc } @@ -109,7 +109,7 @@ type Reporter struct { // has changed. func NewReporter(onStatusChange NotifyStatusFunc, onInvalidTransition InvalidTransitionFunc) *Reporter { return &Reporter{ - fsmMap: make(map[*pipelines.InstanceID]*fsm), + fsmMap: make(map[*pipeline.InstanceID]*fsm), onStatusChange: onStatusChange, onInvalidTransition: onInvalidTransition, } @@ -124,7 +124,7 @@ func (r *Reporter) Ready() { // ReportStatus reports status for the given InstanceID func (r *Reporter) ReportStatus( - id *pipelines.InstanceID, + id *pipeline.InstanceID, ev *component.StatusEvent, ) { r.mu.Lock() @@ -138,7 +138,7 @@ func (r *Reporter) ReportStatus( } } -func (r *Reporter) ReportOKIfStarting(id *pipelines.InstanceID) { +func (r *Reporter) ReportOKIfStarting(id *pipeline.InstanceID) { r.mu.Lock() defer r.mu.Unlock() if !r.ready { @@ -153,7 +153,7 @@ func (r *Reporter) ReportOKIfStarting(id *pipelines.InstanceID) { } // Note: a lock must be acquired before calling this method. -func (r *Reporter) componentFSM(id *pipelines.InstanceID) *fsm { +func (r *Reporter) componentFSM(id *pipeline.InstanceID) *fsm { fsm, ok := r.fsmMap[id] if !ok { fsm = newFSM(func(ev *component.StatusEvent) { r.onStatusChange(id, ev) }) @@ -166,7 +166,7 @@ func (r *Reporter) componentFSM(id *pipelines.InstanceID) *fsm { // component.TelemetrySettings, which differs from servicetelemetry.Settings in that // the component version is tied to specific component instance. func NewReportStatusFunc( - id *pipelines.InstanceID, + id *pipeline.InstanceID, srvStatus ServiceStatusFunc, ) func(*component.StatusEvent) { return func(ev *component.StatusEvent) { diff --git a/service/internal/status/status_test.go b/service/internal/status/status_test.go index 85777376e9d..ea8012b4975 100644 --- a/service/internal/status/status_test.go +++ b/service/internal/status/status_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/service/pipelines" + "go.opentelemetry.io/collector/pipeline" ) func TestStatusFSM(t *testing.T) { @@ -180,11 +180,11 @@ func TestValidSeqsToStopped(t *testing.T) { } func TestStatusFuncs(t *testing.T) { - id1 := &pipelines.InstanceID{} - id2 := &pipelines.InstanceID{} + id1 := &pipeline.InstanceID{} + id2 := &pipeline.InstanceID{} - actualStatuses := make(map[*pipelines.InstanceID][]component.Status) - statusFunc := func(id *pipelines.InstanceID, ev *component.StatusEvent) { + actualStatuses := make(map[*pipeline.InstanceID][]component.Status) + statusFunc := func(id *pipeline.InstanceID, ev *component.StatusEvent) { actualStatuses[id] = append(actualStatuses[id], ev.Status()) } @@ -204,7 +204,7 @@ func TestStatusFuncs(t *testing.T) { component.StatusStopped, } - expectedStatuses := map[*pipelines.InstanceID][]component.Status{ + expectedStatuses := map[*pipeline.InstanceID][]component.Status{ id1: statuses1, id2: statuses2, } @@ -229,9 +229,9 @@ func TestStatusFuncs(t *testing.T) { } func TestStatusFuncsConcurrent(t *testing.T) { - ids := []*pipelines.InstanceID{{}, {}, {}, {}} + ids := []*pipeline.InstanceID{{}, {}, {}, {}} count := 0 - statusFunc := func(*pipelines.InstanceID, *component.StatusEvent) { + statusFunc := func(*pipeline.InstanceID, *component.StatusEvent) { count++ } rep := NewReporter(statusFunc, @@ -261,13 +261,13 @@ func TestStatusFuncsConcurrent(t *testing.T) { } func TestReporterReady(t *testing.T) { - statusFunc := func(*pipelines.InstanceID, *component.StatusEvent) {} + statusFunc := func(*pipeline.InstanceID, *component.StatusEvent) {} var err error rep := NewReporter(statusFunc, func(e error) { err = e }) - id := &pipelines.InstanceID{} + id := &pipeline.InstanceID{} rep.ReportStatus(id, component.NewStatusEvent(component.StatusStarting)) require.ErrorIs(t, err, ErrStatusNotReady) @@ -332,7 +332,7 @@ func TestReportComponentOKIfStarting(t *testing.T) { var receivedStatuses []component.Status rep := NewReporter( - func(_ *pipelines.InstanceID, ev *component.StatusEvent) { + func(_ *pipeline.InstanceID, ev *component.StatusEvent) { receivedStatuses = append(receivedStatuses, ev.Status()) }, func(err error) { @@ -341,7 +341,7 @@ func TestReportComponentOKIfStarting(t *testing.T) { ) rep.Ready() - id := &pipelines.InstanceID{} + id := &pipeline.InstanceID{} for _, status := range tc.initialStatuses { rep.ReportStatus(id, component.NewStatusEvent(status)) } diff --git a/service/pipelines/config.go b/service/pipelines/config.go index 1416272c7c7..81bba72d0ef 100644 --- a/service/pipelines/config.go +++ b/service/pipelines/config.go @@ -72,10 +72,3 @@ func (cfg *PipelineConfig) Validate() error { return nil } - -// InstanceID uniquely identifies a component instance -type InstanceID struct { - ID component.ID - Kind component.Kind - PipelineIDs map[pipeline.ID]struct{} -} diff --git a/service/service_test.go b/service/service_test.go index 1841825d51e..c2bafbbd4c6 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -423,7 +423,7 @@ func TestServiceFatalError(t *testing.T) { go func() { ev := component.NewFatalErrorEvent(assert.AnError) - srv.host.notifyComponentStatusChange(&pipelines.InstanceID{}, ev) + srv.host.notifyComponentStatusChange(&pipeline.InstanceID{}, ev) }() err = <-srv.host.asyncErrorChannel From 4aec05cc081fdb3552de30586d3efbff4a5a0c02 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:06:34 -0400 Subject: [PATCH 30/38] instanceid go mod --- config/configauth/go.mod | 1 - config/configgrpc/go.mod | 1 - config/confighttp/go.mod | 1 - exporter/debugexporter/go.mod | 1 - exporter/go.mod | 1 - exporter/loggingexporter/go.mod | 1 - exporter/otlpexporter/go.mod | 1 - exporter/otlphttpexporter/go.mod | 1 - extension/auth/go.mod | 1 - extension/ballastextension/go.mod | 1 - extension/go.mod | 3 +-- extension/memorylimiterextension/go.mod | 1 - extension/zpagesextension/go.mod | 1 - go.mod | 3 +-- internal/e2e/go.mod | 1 - receiver/otlpreceiver/go.mod | 1 - 16 files changed, 2 insertions(+), 18 deletions(-) diff --git a/config/configauth/go.mod b/config/configauth/go.mod index d3d16796c30..6b355a82e18 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -24,7 +24,6 @@ require ( go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/trace v1.27.0 // indirect diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 7291a291a0a..7b9db6a0b60 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -53,7 +53,6 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index 9f63941c8f0..ea11ddf7fd8 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -49,7 +49,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 98dde32abbb..8bef49581ec 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -43,7 +43,6 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/exporter/go.mod b/exporter/go.mod index ae33fa7c88a..79d0531b022 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -50,7 +50,6 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect golang.org/x/net v0.25.0 // indirect golang.org/x/text v0.15.0 // indirect diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index 69322581a7e..a5074e8d823 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -43,7 +43,6 @@ require ( go.opentelemetry.io/collector/extension v0.102.1 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 6938441c0d5..98615da0fb0 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -61,7 +61,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 48cd415a785..25dddb83409 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -60,7 +60,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/collector/receiver v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect diff --git a/extension/auth/go.mod b/extension/auth/go.mod index 1ce0512bf7b..0b624eda37f 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -32,7 +32,6 @@ require ( go.opentelemetry.io/collector/confmap v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index 8ec4d394007..3ea7d4bf2e0 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -42,7 +42,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/extension/go.mod b/extension/go.mod index 4ae7cd326dc..199835d50cd 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.1 go.opentelemetry.io/collector/confmap v0.102.1 - go.opentelemetry.io/collector/service v0.102.1 + go.opentelemetry.io/collector/pipeline v0.102.1 go.uber.org/goleak v1.3.0 ) @@ -31,7 +31,6 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect - go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index 8e1ce763cf5..f15f0d31f51 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -41,7 +41,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index f85595a9faf..c5b19398e6f 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -40,7 +40,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect go.opentelemetry.io/collector/pdata v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect diff --git a/go.mod b/go.mod index 9951d0cef80..ed9fa8b7ca9 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.0 go.opentelemetry.io/collector/pdata v1.9.0 go.opentelemetry.io/collector/pdata/testdata v0.102.1 - go.opentelemetry.io/collector/service v0.102.1 + go.opentelemetry.io/collector/pipeline v0.102.1 go.opentelemetry.io/contrib/config v0.7.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 @@ -58,7 +58,6 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.1 // indirect - go.opentelemetry.io/collector/pipeline v0.102.1 // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index 46461ce9494..db4291f8dd7 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -63,7 +63,6 @@ require ( go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 136797dfdc6..c09c8a564f1 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -62,7 +62,6 @@ require ( go.opentelemetry.io/collector/extension/auth v0.102.1 // indirect go.opentelemetry.io/collector/featuregate v1.9.0 // indirect go.opentelemetry.io/collector/pipeline v0.102.1 // indirect - go.opentelemetry.io/collector/service v0.102.1 // indirect go.opentelemetry.io/contrib/config v0.7.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect From dac83e35090ae9c4209e8929065b3558cc0cf0ec Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:07:00 -0400 Subject: [PATCH 31/38] crosslink --- cmd/mdatagen/go.mod | 16 --------------- config/configauth/go.mod | 26 ------------------------- config/configgrpc/go.mod | 16 --------------- config/confighttp/go.mod | 18 ----------------- config/internal/go.mod | 20 ------------------- connector/forwardconnector/go.mod | 18 ----------------- connector/go.mod | 18 ----------------- exporter/debugexporter/go.mod | 12 ------------ exporter/go.mod | 12 ------------ exporter/loggingexporter/go.mod | 12 ------------ exporter/nopexporter/go.mod | 12 ------------ exporter/otlpexporter/go.mod | 10 ---------- exporter/otlphttpexporter/go.mod | 12 ------------ extension/auth/go.mod | 26 ------------------------- extension/ballastextension/go.mod | 18 ----------------- extension/go.mod | 26 ------------------------- extension/memorylimiterextension/go.mod | 18 ----------------- extension/zpagesextension/go.mod | 14 ------------- go.mod | 20 ------------------- internal/e2e/go.mod | 10 ---------- processor/batchprocessor/go.mod | 18 ----------------- processor/go.mod | 18 ----------------- processor/memorylimiterprocessor/go.mod | 18 ----------------- receiver/go.mod | 18 ----------------- receiver/nopreceiver/go.mod | 18 ----------------- receiver/otlpreceiver/go.mod | 14 ------------- 26 files changed, 438 deletions(-) diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 27976e8ffa6..8f59e0e0781 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -86,20 +86,4 @@ retract ( v0.65.0 ) -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension => ../../extension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/configauth/go.mod b/config/configauth/go.mod index 6b355a82e18..37a251b8d36 100644 --- a/config/configauth/go.mod +++ b/config/configauth/go.mod @@ -44,36 +44,10 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/service => ../../service - replace go.opentelemetry.io/collector/config/configtelemetry => ../configtelemetry replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/consumer => ../../consumer - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/config/confignet => ../confignet - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/config/configretry => ../configretry - -replace go.opentelemetry.io/collector => ../.. - -replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/connector => ../../connector - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 7b9db6a0b60..7861c47b3ff 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -99,20 +99,4 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/config/configretry => ../configretry - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/processor => ../../processor - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index ea11ddf7fd8..be8e906a4a9 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -89,26 +89,8 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/component => ../../component -replace go.opentelemetry.io/collector/service => ../../service - replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/config/configretry => ../configretry - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/config/confignet => ../confignet - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/exporter => ../../exporter - replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/internal/go.mod b/config/internal/go.mod index 07091deaf6b..837c6fa7111 100644 --- a/config/internal/go.mod +++ b/config/internal/go.mod @@ -34,24 +34,4 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/extension => ../../extension - -replace go.opentelemetry.io/collector/config/confignet => ../confignet - -replace go.opentelemetry.io/collector/config/configretry => ../configretry - -replace go.opentelemetry.io/collector/connector => ../../connector - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 8bf59652411..341442a7ff9 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -77,22 +77,4 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/extension => ../../extension - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/connector/go.mod b/connector/go.mod index dd692464771..de6c24ae032 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -63,22 +63,4 @@ replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata -replace go.opentelemetry.io/collector/service => ../service - -replace go.opentelemetry.io/collector/receiver => ../receiver - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - -replace go.opentelemetry.io/collector/semconv => ../semconv - -replace go.opentelemetry.io/collector/exporter => ../exporter - -replace go.opentelemetry.io/collector/processor => ../processor - -replace go.opentelemetry.io/collector/config/configretry => ../config/configretry - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - -replace go.opentelemetry.io/collector/extension => ../extension - replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index 8bef49581ec..55c071cd2fa 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -83,16 +83,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/go.mod b/exporter/go.mod index 79d0531b022..588918e942e 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -82,16 +82,4 @@ replace go.opentelemetry.io/collector/config/configretry => ../config/configretr replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/service => ../service - -replace go.opentelemetry.io/collector/processor => ../processor - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - -replace go.opentelemetry.io/collector/semconv => ../semconv - -replace go.opentelemetry.io/collector/connector => ../connector - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod index a5074e8d823..f35e6ffca64 100644 --- a/exporter/loggingexporter/go.mod +++ b/exporter/loggingexporter/go.mod @@ -88,16 +88,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 354609963c2..935fa40e19b 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -77,16 +77,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/extension => ../../extension -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/processor => ../../processor - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index 98615da0fb0..66e86b03923 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -130,14 +130,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 25dddb83409..61f28f0f9d8 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -127,16 +127,4 @@ retract ( replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/processor => ../../processor - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/auth/go.mod b/extension/auth/go.mod index 0b624eda37f..51111c7a79c 100644 --- a/extension/auth/go.mod +++ b/extension/auth/go.mod @@ -58,30 +58,4 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension - -replace go.opentelemetry.io/collector/consumer => ../../consumer - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector => ../.. - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata - -replace go.opentelemetry.io/collector/exporter => ../../exporter - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index 3ea7d4bf2e0..7c1e602f218 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -81,22 +81,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/go.mod b/extension/go.mod index 199835d50cd..163a973b2c6 100644 --- a/extension/go.mod +++ b/extension/go.mod @@ -56,30 +56,4 @@ replace go.opentelemetry.io/collector/pdata => ../pdata replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/exporter => ../exporter - -replace go.opentelemetry.io/collector => ../ - -replace go.opentelemetry.io/collector/service => ../service - -replace go.opentelemetry.io/collector/processor => ../processor - -replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata - -replace go.opentelemetry.io/collector/semconv => ../semconv - -replace go.opentelemetry.io/collector/featuregate => ../featuregate - -replace go.opentelemetry.io/collector/config/configretry => ../config/configretry - -replace go.opentelemetry.io/collector/connector => ../connector - -replace go.opentelemetry.io/collector/consumer => ../consumer - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - -replace go.opentelemetry.io/collector/receiver => ../receiver - -replace go.opentelemetry.io/collector/extension/zpagesextension => ./zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod index f15f0d31f51..210ef600b16 100644 --- a/extension/memorylimiterextension/go.mod +++ b/extension/memorylimiterextension/go.mod @@ -75,22 +75,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../zpagesextension - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/connector => ../../connector - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index c5b19398e6f..ce7db1b6fae 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -89,18 +89,4 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/processor => ../../processor - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/go.mod b/go.mod index ed9fa8b7ca9..8542a450fcc 100644 --- a/go.mod +++ b/go.mod @@ -103,24 +103,4 @@ retract ( v0.32.0 // Contains incomplete metrics transition to proto 0.9.0, random components are not working. ) -replace go.opentelemetry.io/collector/extension/zpagesextension => ./extension/zpagesextension - -replace go.opentelemetry.io/collector/exporter => ./exporter - -replace go.opentelemetry.io/collector/receiver => ./receiver - -replace go.opentelemetry.io/collector/config/configretry => ./config/configretry - -replace go.opentelemetry.io/collector/connector => ./connector - -replace go.opentelemetry.io/collector/service => ./service - -replace go.opentelemetry.io/collector/semconv => ./semconv - -replace go.opentelemetry.io/collector/processor => ./processor - -replace go.opentelemetry.io/collector/extension => ./extension - -replace go.opentelemetry.io/collector/config/confignet => ./config/confignet - replace go.opentelemetry.io/collector/pipeline => ./pipeline diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index db4291f8dd7..971f2a9a1ee 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -140,14 +140,4 @@ replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/semconv => ../../semconv - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 1476b4a14d3..fa0f0bb5667 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -77,22 +77,4 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/extension => ../../extension - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/connector => ../../connector - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/processor/go.mod b/processor/go.mod index 402faf42507..2b79f718d90 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -62,22 +62,4 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/semconv => ../semconv - -replace go.opentelemetry.io/collector/receiver => ../receiver - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - -replace go.opentelemetry.io/collector/extension => ../extension - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - -replace go.opentelemetry.io/collector/config/configretry => ../config/configretry - -replace go.opentelemetry.io/collector/connector => ../connector - -replace go.opentelemetry.io/collector/exporter => ../exporter - -replace go.opentelemetry.io/collector/service => ../service - replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index bc55bcc80f2..dfbb34aae1b 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -84,22 +84,4 @@ retract ( replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/receiver => ../../receiver - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/extension => ../../extension - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/receiver/go.mod b/receiver/go.mod index 7fcc78aa40a..4520e16202e 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -63,22 +63,4 @@ retract v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/service => ../service - -replace go.opentelemetry.io/collector/semconv => ../semconv - -replace go.opentelemetry.io/collector/config/confignet => ../config/confignet - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../extension/zpagesextension - -replace go.opentelemetry.io/collector/config/configretry => ../config/configretry - -replace go.opentelemetry.io/collector/extension => ../extension - -replace go.opentelemetry.io/collector/exporter => ../exporter - -replace go.opentelemetry.io/collector/processor => ../processor - -replace go.opentelemetry.io/collector/connector => ../connector - replace go.opentelemetry.io/collector/pipeline => ../pipeline diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index ba95c74c97d..ad750a08721 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -70,22 +70,4 @@ replace go.opentelemetry.io/collector => ../.. replace go.opentelemetry.io/collector/featuregate => ../../featuregate -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/config/confignet => ../../config/confignet - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension => ../../extension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index c09c8a564f1..f8d8679124b 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -130,18 +130,4 @@ retract ( v0.69.0 // Release failed, use v0.69.1 ) -replace go.opentelemetry.io/collector/processor => ../../processor - -replace go.opentelemetry.io/collector/exporter => ../../exporter - -replace go.opentelemetry.io/collector/connector => ../../connector - -replace go.opentelemetry.io/collector/semconv => ../../semconv - -replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry - -replace go.opentelemetry.io/collector/service => ../../service - -replace go.opentelemetry.io/collector/extension/zpagesextension => ../../extension/zpagesextension - replace go.opentelemetry.io/collector/pipeline => ../../pipeline From a302ca112e0faaf80c35322a9712fe30fafb924a Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:09:24 -0400 Subject: [PATCH 32/38] trim tags --- pipeline/pipeline.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 513ad3ca538..c85e6a8efc3 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -12,8 +12,8 @@ import ( ) type ID struct { - typeVal component.DataType `mapstructure:"-"` - nameVal string `mapstructure:"-"` + typeVal component.DataType + nameVal string } // Type returns the type of the component. From 3676ca01424f6181298e13359b6217a8a3fcce5b Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:17:36 -0400 Subject: [PATCH 33/38] rename some methods --- .../generated_component_test.go | 6 +- connector/logs_router_test.go | 8 +- connector/metrics_router_test.go | 8 +- connector/traces_router_test.go | 8 +- otelcol/config_test.go | 16 +- otelcol/otelcoltest/config_test.go | 2 +- pipeline/pipeline.go | 8 +- pipeline/pipeline_test.go | 4 +- service/config_test.go | 6 +- service/internal/graph/graph_test.go | 308 +++++++++--------- .../testcomponents/example_router_test.go | 12 +- service/pipelines/config_test.go | 10 +- service/service_test.go | 8 +- 13 files changed, 202 insertions(+), 202 deletions(-) diff --git a/connector/forwardconnector/generated_component_test.go b/connector/forwardconnector/generated_component_test.go index b492f6e2d7d..528f4cb5c7c 100644 --- a/connector/forwardconnector/generated_component_test.go +++ b/connector/forwardconnector/generated_component_test.go @@ -37,7 +37,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[pipeline.ID]consumer.Logs{pipeline.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.ID]consumer.Logs{pipeline.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -45,7 +45,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[pipeline.ID]consumer.Metrics{pipeline.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{pipeline.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -53,7 +53,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[pipeline.ID]consumer.Traces{pipeline.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.ID]consumer.Traces{pipeline.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, diff --git a/connector/logs_router_test.go b/connector/logs_router_test.go index 43cccb7f955..dcd56173223 100644 --- a/connector/logs_router_test.go +++ b/connector/logs_router_test.go @@ -49,7 +49,7 @@ func fuzzLogs(numIDs, numCons, numLogs int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numLogs+i)%4 == 0 { allCons = append(allCons, &mutatingLogsSink{LogsSink: new(consumertest.LogsSink)}) @@ -109,8 +109,8 @@ func TestLogsRouterConsumers(t *testing.T) { ctx := context.Background() ld := testdata.GenerateLogs(1) - fooID := pipeline.NewPipelineID(component.DataTypeLogs) - barID := pipeline.NewPipelineID(component.DataTypeMetrics) + fooID := pipeline.NewID(component.DataTypeLogs) + barID := pipeline.NewID(component.DataTypeMetrics) foo := new(consumertest.LogsSink) bar := new(consumertest.LogsSink) @@ -151,7 +151,7 @@ func TestLogsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeTraces)) + fake, err := r.Consumer(pipeline.NewID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/metrics_router_test.go b/connector/metrics_router_test.go index 2b19a1402a4..ae4cb2c371a 100644 --- a/connector/metrics_router_test.go +++ b/connector/metrics_router_test.go @@ -50,7 +50,7 @@ func fuzzMetrics(numIDs, numCons, numMetrics int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(component.DataTypeMetrics, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numMetrics+i)%4 == 0 { allCons = append(allCons, &mutatingMetricsSink{MetricsSink: new(consumertest.MetricsSink)}) @@ -110,8 +110,8 @@ func TestMetricsRouterConsumers(t *testing.T) { ctx := context.Background() md := testdata.GenerateMetrics(1) - fooID := pipeline.NewPipelineID(component.DataTypeMetrics) - barID := pipeline.NewPipelineID(component.DataTypeTraces) + fooID := pipeline.NewID(component.DataTypeMetrics) + barID := pipeline.NewID(component.DataTypeTraces) foo := new(consumertest.MetricsSink) bar := new(consumertest.MetricsSink) @@ -152,7 +152,7 @@ func TestMetricsRouterConsumers(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeLogs)) + fake, err := r.Consumer(pipeline.NewID(component.DataTypeLogs)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/connector/traces_router_test.go b/connector/traces_router_test.go index 0d0864d463a..c069dc1e1bd 100644 --- a/connector/traces_router_test.go +++ b/connector/traces_router_test.go @@ -49,7 +49,7 @@ func fuzzTraces(numIDs, numCons, numTraces int) func(*testing.T) { // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { - allIDs = append(allIDs, pipeline.NewPipelineIDWithName(component.DataTypeTraces, strconv.Itoa(numCons))) + allIDs = append(allIDs, pipeline.NewIDWithName(component.DataTypeTraces, strconv.Itoa(numCons))) // Random chance for each consumer to be mutating if (numCons+numTraces+i)%4 == 0 { allCons = append(allCons, &mutatingTracesSink{TracesSink: new(consumertest.TracesSink)}) @@ -109,8 +109,8 @@ func TestTracesRouterConsumer(t *testing.T) { ctx := context.Background() td := testdata.GenerateTraces(1) - fooID := pipeline.NewPipelineID(component.DataTypeMetrics) - barID := pipeline.NewPipelineID(component.DataTypeLogs) + fooID := pipeline.NewID(component.DataTypeMetrics) + barID := pipeline.NewID(component.DataTypeLogs) foo := new(consumertest.TracesSink) bar := new(consumertest.TracesSink) @@ -151,7 +151,7 @@ func TestTracesRouterConsumer(t *testing.T) { assert.Nil(t, none) assert.Error(t, err) - fake, err := r.Consumer(pipeline.NewPipelineID(component.DataTypeTraces)) + fake, err := r.Consumer(pipeline.NewID(component.DataTypeTraces)) assert.Nil(t, fake) assert.Error(t, err) } diff --git a/otelcol/config_test.go b/otelcol/config_test.go index 1d3e77a2da8..f4c0b78be7f 100644 --- a/otelcol/config_test.go +++ b/otelcol/config_test.go @@ -99,7 +99,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-receiver-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -109,7 +109,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -119,7 +119,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-exporter-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg }, @@ -186,7 +186,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Receivers[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -199,7 +199,7 @@ func TestConfigValidate(t *testing.T) { cfg := generateConfig() cfg.Exporters[component.MustNewID("nop2")] = &errConfig{} cfg.Connectors[component.MustNewID("nop2")] = &errConfig{} - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "2")) pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "2")) return cfg @@ -210,7 +210,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Receivers = append(pipe.Receivers, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -220,7 +220,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-connector-reference-as-receiver", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Exporters = append(pipe.Exporters, component.MustNewIDWithName("nop", "conn2")) return cfg }, @@ -281,7 +281,7 @@ func generateConfig() *Config { }, Extensions: []component.ID{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/otelcol/otelcoltest/config_test.go b/otelcol/otelcoltest/config_test.go index b0dd4504440..3bf5310ca67 100644 --- a/otelcol/otelcoltest/config_test.go +++ b/otelcol/otelcoltest/config_test.go @@ -56,7 +56,7 @@ func TestLoadConfig(t *testing.T) { Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - cfg.Service.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)], + cfg.Service.Pipelines[pipeline.NewID(component.DataTypeTraces)], "Did not load pipeline config correctly") } diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index c85e6a8efc3..b151faace01 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -26,13 +26,13 @@ func (id ID) Name() string { return id.nameVal } -// NewPipelineID returns a new ID with the given DataType and empty name. -func NewPipelineID(typeVal component.DataType) ID { +// NewID returns a new ID with the given DataType and empty name. +func NewID(typeVal component.DataType) ID { return ID{typeVal: typeVal} } -// NewPipelineIDWithName returns a new ID with the given DataType and name. -func NewPipelineIDWithName(typeVal component.DataType, nameVal string) ID { +// NewIDWithName returns a new ID with the given DataType and name. +func NewIDWithName(typeVal component.DataType, nameVal string) ID { return ID{typeVal: typeVal, nameVal: nameVal} } diff --git a/pipeline/pipeline_test.go b/pipeline/pipeline_test.go index 93c4b179628..8b7323c8004 100644 --- a/pipeline/pipeline_test.go +++ b/pipeline/pipeline_test.go @@ -12,12 +12,12 @@ import ( ) func TestNewPipelineID(t *testing.T) { - id := NewPipelineID(component.DataTypeMetrics) + id := NewID(component.DataTypeMetrics) assert.Equal(t, "", id.nameVal) } func TestPipelineIDMarshalText(t *testing.T) { - id := NewPipelineIDWithName(component.DataTypeMetrics, "name") + id := NewIDWithName(component.DataTypeMetrics, "name") got, err := id.MarshalText() assert.NoError(t, err) assert.Equal(t, id.String(), string(got)) diff --git a/service/config_test.go b/service/config_test.go index 6403058aa1a..745f9fc952b 100644 --- a/service/config_test.go +++ b/service/config_test.go @@ -43,7 +43,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg.Pipelines[pipeline.NewID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -53,7 +53,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() *Config { cfg := generateConfig() - cfg.Pipelines[pipeline.NewPipelineID("wrongtype")] = &pipelines.PipelineConfig{ + cfg.Pipelines[pipeline.NewID("wrongtype")] = &pipelines.PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -102,7 +102,7 @@ func generateConfig() *Config { }, Extensions: extensions.Config{component.MustNewID("nop")}, Pipelines: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/graph/graph_test.go b/service/internal/graph/graph_test.go index 2194d799cfd..36c5d075484 100644 --- a/service/internal/graph/graph_test.go +++ b/service/internal/graph/graph_test.go @@ -230,17 +230,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -251,17 +251,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_mutate.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -272,17 +272,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_multi_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor"), component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -293,15 +293,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_simple_no_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -311,17 +311,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate"), component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, @@ -332,15 +332,15 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_multi_no_proc.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver"), component.MustNewIDWithName("examplereceiver", "1")}, Exporters: []component.ID{component.MustNewID("exampleexporter"), component.MustNewIDWithName("exampleexporter", "1")}, }, @@ -350,30 +350,30 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "multi_pipeline_receivers_and_exporters.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "1"): { + pipeline.NewIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "1"): { + pipeline.NewIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -383,12 +383,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -399,12 +399,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -415,12 +415,12 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_simple_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -431,22 +431,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "type0"): { + pipeline.NewIDWithName(component.DataTypeTraces, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "type1"): { + pipeline.NewIDWithName(component.DataTypeTraces, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -457,22 +457,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "type0"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "type1"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -483,22 +483,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_fork_merge_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "type0"): { + pipeline.NewIDWithName(component.DataTypeLogs, "type0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "type1"): { + pipeline.NewIDWithName(component.DataTypeLogs, "type1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "merge")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -509,17 +509,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -530,17 +530,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -551,17 +551,17 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_translate_from_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleconnector")}, }, - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("exampleconnector")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -572,32 +572,32 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_matrix.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewIDWithName("exampleprocessor", "mutate")}, // mutate propagates upstream to connector Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -608,27 +608,27 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_lanes.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, @@ -638,22 +638,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_traces.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out0"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "middle"): { + pipeline.NewIDWithName(component.DataTypeTraces, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out1"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -664,22 +664,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_metrics.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out0"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "middle"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out1"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -690,22 +690,22 @@ func TestConnectorPipelinesGraph(t *testing.T) { { name: "pipelines_conn_mutate_logs.yaml", pipelineConfigs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("examplereceiver")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out0"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out0"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "middle"): { + pipeline.NewIDWithName(component.DataTypeLogs, "middle"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "inherit_mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out1"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out1"): { Receivers: []component.ID{component.MustNewIDWithName("exampleconnector", "mutate")}, Processors: []component.ID{component.MustNewID("exampleprocessor")}, Exporters: []component.ID{component.MustNewID("exampleexporter")}, @@ -992,17 +992,17 @@ func TestConnectorRouter(t *testing.T) { expRightID := component.MustNewIDWithName("exampleexporter", "right") expLeftID := component.MustNewIDWithName("exampleexporter", "left") - tracesInID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in") - tracesRightID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "right") - tracesLeftID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "left") + tracesInID := pipeline.NewIDWithName(component.DataTypeTraces, "in") + tracesRightID := pipeline.NewIDWithName(component.DataTypeTraces, "right") + tracesLeftID := pipeline.NewIDWithName(component.DataTypeTraces, "left") - metricsInID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in") - metricsRightID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "right") - metricsLeftID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "left") + metricsInID := pipeline.NewIDWithName(component.DataTypeMetrics, "in") + metricsRightID := pipeline.NewIDWithName(component.DataTypeMetrics, "right") + metricsLeftID := pipeline.NewIDWithName(component.DataTypeMetrics, "left") - logsInID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in") - logsRightID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "right") - logsLeftID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "left") + logsInID := pipeline.NewIDWithName(component.DataTypeLogs, "in") + logsRightID := pipeline.NewIDWithName(component.DataTypeLogs, "right") + logsLeftID := pipeline.NewIDWithName(component.DataTypeLogs, "left") ctx := context.Background() set := Settings{ @@ -1195,7 +1195,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1211,7 +1211,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1227,7 +1227,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): badExporterFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, @@ -1246,7 +1246,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1266,7 +1266,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1286,7 +1286,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1303,7 +1303,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1319,7 +1319,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1335,7 +1335,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1354,11 +1354,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1377,11 +1377,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1400,11 +1400,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1423,11 +1423,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1446,11 +1446,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1469,11 +1469,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1492,11 +1492,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1515,11 +1515,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1538,11 +1538,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("bf"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("bf")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewID("bf")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1561,7 +1561,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, @@ -1580,7 +1580,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1599,15 +1599,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, @@ -1626,15 +1626,15 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("mockforward"): mfConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("mockforward")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("mockforward")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -1656,7 +1656,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1682,7 +1682,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1708,7 +1708,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, @@ -1736,22 +1736,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "1"): { + pipeline.NewIDWithName(component.DataTypeTraces, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "2"): { + pipeline.NewIDWithName(component.DataTypeTraces, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1781,22 +1781,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "in"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "1"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "2"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "out"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1826,22 +1826,22 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "conn2"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "in"): { + pipeline.NewIDWithName(component.DataTypeLogs, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "1"): { + pipeline.NewIDWithName(component.DataTypeLogs, "1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn1")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "2"): { + pipeline.NewIDWithName(component.DataTypeLogs, "2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn1")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "conn2"), component.MustNewIDWithName("nop", "conn")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "out"): { + pipeline.NewIDWithName(component.DataTypeLogs, "out"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "conn2")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1872,37 +1872,37 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewIDWithName("nop", "rawlog"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy1"): { + pipeline.NewIDWithName(component.DataTypeTraces, "copy1"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2"): { + pipeline.NewIDWithName(component.DataTypeTraces, "copy2"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "fork")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2a"): { + pipeline.NewIDWithName(component.DataTypeTraces, "copy2a"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "count")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "copy2b"): { + pipeline.NewIDWithName(component.DataTypeTraces, "copy2b"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "forkagain")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "count"): { + pipeline.NewIDWithName(component.DataTypeMetrics, "count"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "count")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeLogs, "raw"): { + pipeline.NewIDWithName(component.DataTypeLogs, "raw"): { Receivers: []component.ID{component.MustNewIDWithName("nop", "rawlog")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewIDWithName("nop", "fork")}, // cannot loop back to "nop/fork" @@ -1926,7 +1926,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, }, @@ -1942,7 +1942,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, @@ -1961,7 +1961,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1981,7 +1981,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -1998,7 +1998,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("nop", "1")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2014,7 +2014,7 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("nop"): nopReceiverFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2033,11 +2033,11 @@ func TestGraphBuildErrors(t *testing.T) { component.MustNewID("unknown"): nopConnectorFactory.CreateDefaultConfig(), }, pipelineCfgs: pipelines.Config{ - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "in"): { + pipeline.NewIDWithName(component.DataTypeTraces, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("unknown")}, }, - pipeline.NewPipelineIDWithName(component.DataTypeTraces, "out"): { + pipeline.NewIDWithName(component.DataTypeTraces, "out"): { Receivers: []component.ID{component.MustNewID("unknown")}, Exporters: []component.ID{component.MustNewID("nop")}, }, @@ -2141,7 +2141,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt := range dataTypes { t.Run(dt.String()+"/receiver", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - pipeline.NewPipelineID(dt): { + pipeline.NewID(dt): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2155,7 +2155,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/processor", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - pipeline.NewPipelineID(dt): { + pipeline.NewID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -2169,7 +2169,7 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { t.Run(dt.String()+"/exporter", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - pipeline.NewPipelineID(dt): { + pipeline.NewID(dt): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewID("err")}, @@ -2184,12 +2184,12 @@ func TestGraphFailToStartAndShutdown(t *testing.T) { for _, dt2 := range dataTypes { t.Run(dt.String()+"/"+dt2.String()+"/connector", func(t *testing.T) { set.PipelineConfigs = pipelines.Config{ - pipeline.NewPipelineIDWithName(dt, "in"): { + pipeline.NewIDWithName(dt, "in"): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, }, - pipeline.NewPipelineIDWithName(dt2, "out"): { + pipeline.NewIDWithName(dt2, "out"): { Receivers: []component.ID{component.MustNewID("nop"), component.MustNewIDWithName("err", "conn")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index ed8d1f94094..a79df3c0810 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -32,8 +32,8 @@ func TestExampleRouter(t *testing.T) { } func TestTracesRouter(t *testing.T) { - leftID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "left") - rightID := pipeline.NewPipelineIDWithName(component.DataTypeTraces, "right") + leftID := pipeline.NewIDWithName(component.DataTypeTraces, "left") + rightID := pipeline.NewIDWithName(component.DataTypeTraces, "right") sinkLeft := new(consumertest.TracesSink) sinkRight := new(consumertest.TracesSink) @@ -71,8 +71,8 @@ func TestTracesRouter(t *testing.T) { } func TestMetricsRouter(t *testing.T) { - leftID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "left") - rightID := pipeline.NewPipelineIDWithName(component.DataTypeMetrics, "right") + leftID := pipeline.NewIDWithName(component.DataTypeMetrics, "left") + rightID := pipeline.NewIDWithName(component.DataTypeMetrics, "right") sinkLeft := new(consumertest.MetricsSink) sinkRight := new(consumertest.MetricsSink) @@ -110,8 +110,8 @@ func TestMetricsRouter(t *testing.T) { } func TestLogsRouter(t *testing.T) { - leftID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "left") - rightID := pipeline.NewPipelineIDWithName(component.DataTypeLogs, "right") + leftID := pipeline.NewIDWithName(component.DataTypeLogs, "left") + rightID := pipeline.NewIDWithName(component.DataTypeLogs, "right") sinkLeft := new(consumertest.LogsSink) sinkRight := new(consumertest.LogsSink) diff --git a/service/pipelines/config_test.go b/service/pipelines/config_test.go index d6caaf3811f..8299bcf425e 100644 --- a/service/pipelines/config_test.go +++ b/service/pipelines/config_test.go @@ -29,7 +29,7 @@ func TestConfigValidate(t *testing.T) { name: "duplicate-processor-reference", cfgFn: func() Config { cfg := generateConfig() - pipe := cfg[pipeline.NewPipelineID(component.DataTypeTraces)] + pipe := cfg[pipeline.NewID(component.DataTypeTraces)] pipe.Processors = append(pipe.Processors, pipe.Processors...) return cfg }, @@ -39,7 +39,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-receivers", cfgFn: func() Config { cfg := generateConfig() - cfg[pipeline.NewPipelineID(component.DataTypeTraces)].Receivers = nil + cfg[pipeline.NewID(component.DataTypeTraces)].Receivers = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineReceivers), @@ -48,7 +48,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-exporters", cfgFn: func() Config { cfg := generateConfig() - cfg[pipeline.NewPipelineID(component.DataTypeTraces)].Exporters = nil + cfg[pipeline.NewID(component.DataTypeTraces)].Exporters = nil return cfg }, expected: fmt.Errorf(`pipeline "traces": %w`, errMissingServicePipelineExporters), @@ -64,7 +64,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-service-pipeline-type", cfgFn: func() Config { cfg := generateConfig() - cfg[pipeline.NewPipelineID("wrongtype")] = &PipelineConfig{ + cfg[pipeline.NewID("wrongtype")] = &PipelineConfig{ Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, @@ -85,7 +85,7 @@ func TestConfigValidate(t *testing.T) { func generateConfig() Config { return map[pipeline.ID]*PipelineConfig{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.MustNewID("nop")}, Processors: []component.ID{component.MustNewID("nop")}, Exporters: []component.ID{component.MustNewID("nop")}, diff --git a/service/service_test.go b/service/service_test.go index c2bafbbd4c6..e185399874b 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -241,7 +241,7 @@ func TestServiceGetExporters(t *testing.T) { // and another service with a valid config can be started right after. func TestServiceTelemetryCleanupOnError(t *testing.T) { invalidCfg := newNopConfig() - invalidCfg.Pipelines[pipeline.NewPipelineID(component.DataTypeTraces)].Processors[0] = component.MustNewID("invalid") + invalidCfg.Pipelines[pipeline.NewID(component.DataTypeTraces)].Processors[0] = component.MustNewID("invalid") // Create a service with an invalid config and expect an error _, err := New(context.Background(), newNopSettings(), invalidCfg) require.Error(t, err) @@ -533,17 +533,17 @@ func newNopSettings() Settings { func newNopConfig() Config { return newNopConfigPipelineConfigs(pipelines.Config{ - pipeline.NewPipelineID(component.DataTypeTraces): { + pipeline.NewID(component.DataTypeTraces): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.NewPipelineID(component.DataTypeMetrics): { + pipeline.NewID(component.DataTypeMetrics): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, }, - pipeline.NewPipelineID(component.DataTypeLogs): { + pipeline.NewID(component.DataTypeLogs): { Receivers: []component.ID{component.NewID(nopType)}, Processors: []component.ID{component.NewID(nopType)}, Exporters: []component.ID{component.NewID(nopType)}, From 22b25394f8e79e3f3c8bfa978fad3eb901b6f54f Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Wed, 12 Jun 2024 19:20:26 -0400 Subject: [PATCH 34/38] chloggen --- .chloggen/datatype-newid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/datatype-newid.yaml b/.chloggen/datatype-newid.yaml index aef26c9f7cc..79d1c7687b9 100644 --- a/.chloggen/datatype-newid.yaml +++ b/.chloggen/datatype-newid.yaml @@ -7,7 +7,7 @@ change_type: enhancement component: component # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "Changes DataType to be an enum of Otel signals. Creates a new struct PipelineID - made up of a DataType and an optional string name. This PipelineID replaces the previous use of component.ID to identify Pipelines." +note: "Changes DataType to be an enum of Otel signals. Creates a new module pipeline to centralize types related to pipelines. Creates a new struct pipeline.ID - made up of a DataType and an optional string name. This pipeline.ID replaces the previous use of component.ID to identify Pipelines. Moves InstanceID to pipeline to break import cycles." # One or more tracking issues or pull requests related to the change issues: [9429] From 1475a2556d80c1a5aebb91304c1fe0ee8615cfaf Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Mon, 24 Jun 2024 17:59:00 -0400 Subject: [PATCH 35/38] quote the bad datatype --- component/config.go | 2 +- component/config_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/component/config.go b/component/config.go index e1228c3c41f..e6586eb7b17 100644 --- a/component/config.go +++ b/component/config.go @@ -188,6 +188,6 @@ func (dt *DataType) UnmarshalText(text []byte) error { *dt = DataTypeTraces return nil default: - return fmt.Errorf("invalid data type %s", strText) + return fmt.Errorf("invalid data type %q", strText) } } diff --git a/component/config_test.go b/component/config_test.go index 33ab13fb238..b6d3ca15502 100644 --- a/component/config_test.go +++ b/component/config_test.go @@ -431,7 +431,7 @@ func TestNewDataType(t *testing.T) { // hopefully this reminds us to update DataType when profiles get included err = dt2.UnmarshalText([]byte("profiles")) assert.Equal(t, DataType(""), dt2) - assert.Equal(t, errors.New("invalid data type profiles"), err) + assert.Equal(t, errors.New("invalid data type \"profiles\""), err) } func TestDataTypeStringMarshal(t *testing.T) { From 534db047bb202b2b9fa066fd859ed1240d8b682a Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 25 Jun 2024 00:07:39 -0400 Subject: [PATCH 36/38] update component tests --- cmd/mdatagen/templates/component_test.go.tmpl | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index 77499dd8b46..637a4b74835 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -44,6 +44,8 @@ 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" @@ -372,7 +374,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.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.ID]consumer.Logs{pipeline.ID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateLogsToLogs(ctx, set, cfg, router) }, }, @@ -381,7 +383,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.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{pipeline.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateLogsToMetrics(ctx, set, cfg, router) }, }, @@ -390,7 +392,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.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.ID]consumer.Traces{pipeline.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateLogsToTraces(ctx, set, cfg, router) }, }, @@ -399,7 +401,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.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.ID]consumer.Logs{pipeline.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateMetricsToLogs(ctx, set, cfg, router) }, }, @@ -408,7 +410,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.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{pipeline.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateMetricsToMetrics(ctx, set, cfg, router) }, }, @@ -417,7 +419,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.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.ID]consumer.Traces{pipeline.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateMetricsToTraces(ctx, set, cfg, router) }, }, @@ -426,7 +428,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.PipelineID]consumer.Logs{component.NewPipelineID(component.DataTypeLogs): consumertest.NewNop()}) + router := connector.NewLogsRouter(map[pipeline.ID]consumer.Logs{pipeline.NewID(component.DataTypeLogs): consumertest.NewNop()}) return factory.CreateTracesToLogs(ctx, set, cfg, router) }, }, @@ -435,7 +437,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.PipelineID]consumer.Metrics{component.NewPipelineID(component.DataTypeMetrics): consumertest.NewNop()}) + router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{pipeline.NewID(component.DataTypeMetrics): consumertest.NewNop()}) return factory.CreateTracesToMetrics(ctx, set, cfg, router) }, }, @@ -444,7 +446,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.PipelineID]consumer.Traces{component.NewPipelineID(component.DataTypeTraces): consumertest.NewNop()}) + router := connector.NewTracesRouter(map[pipeline.ID]consumer.Traces{pipeline.NewID(component.DataTypeTraces): consumertest.NewNop()}) return factory.CreateTracesToTraces(ctx, set, cfg, router) }, }, From 3d82883e61b9c5ae532a0e07b40ad02a581af3f8 Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 25 Jun 2024 00:08:32 -0400 Subject: [PATCH 37/38] add to changelog --- .chloggen/datatype-newid.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.chloggen/datatype-newid.yaml b/.chloggen/datatype-newid.yaml index 79d1c7687b9..2162a5148fa 100644 --- a/.chloggen/datatype-newid.yaml +++ b/.chloggen/datatype-newid.yaml @@ -1,7 +1,7 @@ # Use this changelog template to create an entry for release notes. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: enhancement +change_type: breaking # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) component: component @@ -15,7 +15,14 @@ issues: [9429] # (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: "" +subtext: | + Related API changes: + connector.LogsRouterAndConsumer, connector.MetricsRouterAndConsumer, and connector.TracesRouterAndConsumer `Consumer` methods now accepts pipeline.ID instead of component.ID. Their PipelineIDs function return pipeline.ID instead of component.ID. + NewStatusWatcherExtensionFactory now accepts a pipeline.InstanceID instead of component.InstanceID. + The generated component tests now use PipelineIDs for testing connectors. + extension.ComponentStatusChanged now takes in a *pipeline.InstanceID instead of a *component.InstanceID. + extensiontest.NewStatusWatcherExtensionFactory now takes in a *pipeline.InstanceID instead of a *component.InstanceID. + extensions.NotifyComponentStatusChange now takes in a *pipeline.InstanceID instead of a *component.InstanceID. # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' From c1252e487c4d35ccdd59ac99116f86c93baec2ae Mon Sep 17 00:00:00 2001 From: Ankit Patel Date: Tue, 25 Jun 2024 00:09:57 -0400 Subject: [PATCH 38/38] license --- pipeline/instance.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pipeline/instance.go b/pipeline/instance.go index 4c77a88fa8f..2b2a7c8b9b4 100644 --- a/pipeline/instance.go +++ b/pipeline/instance.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package pipeline import "go.opentelemetry.io/collector/component"