diff --git a/.chloggen/fixbatcherror.yaml b/.chloggen/fixbatcherror.yaml new file mode 100755 index 00000000000..a89e7fbba88 --- /dev/null +++ b/.chloggen/fixbatcherror.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: batchprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix return error for batch processor when consuming Metrics and Logs + +# One or more tracking issues or pull requests related to the change +issues: [7711] diff --git a/processor/batchprocessor/batch_processor.go b/processor/batchprocessor/batch_processor.go index 3274b130b39..170240e5bc1 100644 --- a/processor/batchprocessor/batch_processor.go +++ b/processor/batchprocessor/batch_processor.go @@ -343,7 +343,7 @@ func (bp *batchProcessor) ConsumeTraces(ctx context.Context, td ptrace.Traces) e func (bp *batchProcessor) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { b, err := bp.findBatcher(ctx) if err != nil { - return nil + return err } b.newItem <- md return nil @@ -353,7 +353,7 @@ func (bp *batchProcessor) ConsumeMetrics(ctx context.Context, md pmetric.Metrics func (bp *batchProcessor) ConsumeLogs(ctx context.Context, ld plog.Logs) error { b, err := bp.findBatcher(ctx) if err != nil { - return nil + return err } b.newItem <- ld return nil