opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Allow LogProcessor to mutate log records

Open jack-berg opened this issue 1 year ago • 2 comments

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

jack-berg avatar Jul 20 '22 20:07 jack-berg

@open-telemetry/specs-logs-approvers please take a look!

jack-berg avatar Aug 05 '22 17:08 jack-berg

This PR was marked stale due to lack of activity. It will be closed in 7 days.

github-actions[bot] avatar Aug 13 '22 03:08 github-actions[bot]

Pinging @open-telemetry/specs-logs-approvers. Please take a look! Otel java has already implemented and published this change here.

jack-berg avatar Aug 19 '22 20:08 jack-berg