open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.96k stars 2.3k forks source link

[pkg/stanza] Compare performance with and without buffer in `LogEmitter` #35454

Open andrzej-stencel opened 6 days ago

andrzej-stencel commented 6 days ago

Component(s)

pkg/stanza

Describe the issue you're reporting

TL;DR Let's measure the performance impact of removing the 100-log buffer from Stanza adapter's LogEmitter.

The problem:

The LogEmitter's buffer for Stanza entries (in batch field) is a source of data loss during non-graceful collector shutdowns, as the items in the buffer are not persisted and they are already marked as sent by File consumer.

What to do about it:

In an effort to make Filelog receiver (and other Stanza-based receivers) 100% reliable, we want to remove any possibility of data loss. The simplest solution is to remove this buffering and send each log record through the OTLP pipeline separately, as a separate Log Resource. This may have a performance impact though, so the first step is to measure this potential performance impact. After we have this data, we can make further decisions as to next steps.

Expected output:

A comparison (e.g. in form of a table) of collector performance with the current standard build of the collector vs. a build with this buffer removed, or modified to 1 log only, which is probably mostly equal in performance to not having the buffer at all.

Additional context:

This issue is created as a result of discussion in https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/31074, specifically see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/31074#issuecomment-2360284799 and later comments.

github-actions[bot] commented 6 days ago

Pinging code owners:

andrzej-stencel commented 2 days ago

Removing needs triage label as this was discussed with the code owner.