fix(logs): optimize LogRecord memory by removing redundant context (#4977)
* fix(logs): optimize LogRecord memory by removing redundant context Removed direct storage of the Context object in LogRecord to prevent memory inflation when logs are buffered. Correlation IDs (TraceId, SpanId, TraceFlags) are still preserved. Resolves #4957 * fix(logs): reduce memory usage in BatchLogRecordProcessor (#4957) Clear LogRecord context references before buffering in the SDK to prevent memory inflation while maintaining context access for synchronous processors. * Revert "fix(logs): optimize LogRecord memory by removing redundant context" This reverts commit c77ecd0bbec1de1025fb330242bac6a2246bbd09. * Update opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/export/__init__.py Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> * logs: address memory optimization review comments - Add missing Context import. - Apply memory optimization to SimpleLogRecordProcessor. - Update BatchLogRecordProcessor to use Context() instead of None. * logs: revert context clearing in SimpleLogRecordProcessor * Replace manual CHANGELOG entry with TownCrier fragment for #4977 --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com>
I
Ijas committed
1d9f40b5ac5864b58b8724a276be3effa04d1903
Parent: 64fcf26
Committed by GitHub <noreply@github.com>
on 6/24/2026, 5:37:30 PM