Description
func (s *SimpleProcessor) OnEmit(ctx context.Context, r *Record) (err error) {
if s.exporter == nil {
return nil
}
s.mu.Lock()
defer s.mu.Unlock()
records := simpleProcRecordsPool.Get().(*[]Record)
(*records)[0] = *r
defer func() {
simpleProcRecordsPool.Put(records)
}()
if s.inst != nil {
defer func() {
s.inst.LogProcessed(ctx, err)
}()
}
return s.exporter.Export(ctx, *records)
}
ref #7548 (comment)
In SimpleProcessor.OnEmit, when s.exporter == nil, the function returns nil, Should we define a custom error to describe the fact that it wasn't successfully exported (something like: simple processor has no exporter configured). or we can define a report for this situation.
cc @flc1125