Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow LogProcessor to mutate log records #2681

Merged
merged 4 commits into from
Aug 24, 2022

Conversation

jack-berg
Copy link
Member

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

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one non-blocking question on sync/async behavior.

specification/logs/logging-library-sdk.md Show resolved Hide resolved
@jack-berg
Copy link
Member Author

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

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label Aug 13, 2022
@jack-berg jack-berg removed the Stale label Aug 15, 2022
@jack-berg
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:logs Related to the specification/logs directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow logs to be mutated in LogProcessor
7 participants