@@ -29,12 +29,9 @@ import (
2929 "go.opentelemetry.io/collector/model/pdata"
3030)
3131
32- // LProcessor is a helper interface that allows avoiding implementing all functions in LogsProcessor by using NewLogsProcessor.
33- type LProcessor interface {
34- // ProcessLogs is a helper function that processes the incoming data and returns the data to be sent to the next component.
35- // If error is returned then returned data are ignored. It MUST not call the next component.
36- ProcessLogs (context.Context , pdata.Logs ) (pdata.Logs , error )
37- }
32+ // ProcessLogsFunc is a helper function that processes the incoming data and returns the data to be sent to the next component.
33+ // If error is returned then returned data are ignored. It MUST not call the next component.
34+ type ProcessLogsFunc func (context.Context , pdata.Logs ) (pdata.Logs , error )
3835
3936type logProcessor struct {
4037 component.Component
@@ -46,11 +43,11 @@ type logProcessor struct {
4643func NewLogsProcessor (
4744 cfg config.Processor ,
4845 nextConsumer consumer.Logs ,
49- processor LProcessor ,
46+ logsFunc ProcessLogsFunc ,
5047 options ... Option ,
5148) (component.LogsProcessor , error ) {
52- if processor == nil {
53- return nil , errors .New ("nil processor " )
49+ if logsFunc == nil {
50+ return nil , errors .New ("nil logsFunc " )
5451 }
5552
5653 if nextConsumer == nil {
@@ -63,7 +60,7 @@ func NewLogsProcessor(
6360 span := trace .SpanFromContext (ctx )
6461 span .AddEvent ("Start processing." , eventOptions )
6562 var err error
66- ld , err = processor . ProcessLogs (ctx , ld )
63+ ld , err = logsFunc (ctx , ld )
6764 span .AddEvent ("End processing." , eventOptions )
6865 if err != nil {
6966 if errors .Is (err , ErrSkipProcessingData ) {
0 commit comments