Skip to content

sdk/log: Redesign BatchProcessor #6797

@pellared

Description

@pellared

Maybe the goroutine responsible for actually exporting the log records should be also responsible for getting/dequeuing the log records from the queue instead of doing it here?

My idea was that here we only signal that we want to have the exporter goroutine (processRecordsBatches) to try to export. The exporter goroutine could dequeue by itself. I do not think we need a sync.Pool for batches as we have only one exporting goroutine.

The idea is also to get rid of something like len(b.recordsBatches) == cap(b.recordsBatches) (or len(e.input) != cap(e.input)) which looks like a code smell.

Currently, the "poll goroutine" can consume almost a whole CPU thread when there is "big traffic" and bufferExporter.Ready returns false over and over (which results in no-op for loop) .

Originally posted by @pellared in #6673 (comment)

Metadata

Metadata

Assignees

Labels

area:logsPart of OpenTelemetry logspkg:SDKRelated to an SDK package

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions