Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processor instance per data type #10664

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions service/internal/components/loggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ 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, dt component.DataType) *zap.Logger {
return logger.With(
zap.String(zapKindKey, strings.ToLower(component.KindProcessor.String())),
zap.String(zapNameKey, id.String()),
zap.String(zapPipelineKey, pipelineID.String()))
zap.String(zapPipelineKey, dt.String()))
}

func ExporterLogger(logger *zap.Logger, id component.ID, dt component.DataType) *zap.Logger {
Expand Down
10 changes: 7 additions & 3 deletions service/internal/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ func (g *Graph) createReceiver(pipelineID, recvID component.ID) *receiverNode {
}

func (g *Graph) createProcessor(pipelineID, procID component.ID) *processorNode {
procNode := newProcessorNode(pipelineID, procID)
procNode := newProcessorNode(pipelineID.Type(), procID)
if node := g.componentGraph.Node(procNode.ID()); node != nil {
g.instanceIDs[procNode.ID()].PipelineIDs[pipelineID] = struct{}{}
return node.(*processorNode)
}
g.componentGraph.AddNode(procNode)
g.instanceIDs[procNode.ID()] = &component.InstanceID{
ID: procID,
Expand Down Expand Up @@ -309,7 +313,7 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error {
err = n.buildComponent(ctx, telemetrySettings, set.BuildInfo, set.ReceiverBuilder, g.nextConsumers(n.ID()))
case *processorNode:
// nextConsumers is guaranteed to be length 1. Either it is the next processor or it is the fanout node for the exporters.
err = n.buildComponent(ctx, telemetrySettings, set.BuildInfo, set.ProcessorBuilder, g.nextConsumers(n.ID())[0])
err = n.buildComponent(ctx, telemetrySettings, set.BuildInfo, set.ProcessorBuilder, g.nextConsumers(n.ID()))
case *exporterNode:
err = n.buildComponent(ctx, telemetrySettings, set.BuildInfo, set.ExporterBuilder)
case *connectorNode:
Expand Down Expand Up @@ -536,7 +540,7 @@ func cycleErr(err error, cycles [][]graph.Node) error {
for _, node := range cycle {
switch n := node.(type) {
case *processorNode:
componentDetails = append(componentDetails, fmt.Sprintf("processor %q in pipeline %q", n.componentID, n.pipelineID))
componentDetails = append(componentDetails, fmt.Sprintf("processor %q (%s)", n.componentID, n.pipelineType))
case *connectorNode:
componentDetails = append(componentDetails, fmt.Sprintf("connector %q (%s to %s)", n.componentID, n.exprPipelineType, n.rcvrPipelineType))
default:
Expand Down
Loading
Loading