opentelemetry-specification
opentelemetry-specification copied to clipboard
Allow LogProcessor to mutate log records
Resolves #2647.
The simplest possible fix would have been to simply change LogProcessor#emit
to accept LogRecord
instead of LogData
, but I took the opportunity to add some additional detail to make logs more consistent with spans where possible.
Changes include:
- Add TOC
- Rename LogProcessor#emit to LogProcessor#onEmit. This is more consistent with spans (SpanProcessor#onStart, SpanProcessor#onEnd), and avoids confusion by being different than LogEmitter#emit.
- Define LogRecord interface, accepted by LogEmitter#emit
- Define Read/write LogRecord interface, accepted by LogProcessor#onEmit
- Define Readable LogRecord interface, accepted in batches by LogExporter#export
- Add LogExporter#forceFlush method (stubbed out for now) for consistency with SpanExporter#forceFlush
@open-telemetry/specs-logs-approvers please take a look!
This PR was marked stale due to lack of activity. It will be closed in 7 days.
Pinging @open-telemetry/specs-logs-approvers. Please take a look! Otel java has already implemented and published this change here.