fix(logs): optimize LogRecord memory by removing redundant context by ajuijas · Pull Request #4977 · open-telemetry/opentelemetry-python
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 open-telemetry#4957
…etry#4957) Clear LogRecord context references before buffering in the SDK to prevent memory inflation while maintaining context access for synchronous processors.
…ntext" This reverts commit c77ecd0.
xrmx approved these changes Mar 17, 2026
xrmx
mentioned this pull request
- Add missing Context import. - Apply memory optimization to SimpleLogRecordProcessor. - Update BatchLogRecordProcessor to use Context() instead of None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters