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

Logs SDK: consider removing LogData and extending SDK LogRecord to have instrumentation scope #4313

Open
4 tasks
lmolkova opened this issue Nov 23, 2024 · 0 comments
Labels

Comments

@lmolkova
Copy link
Contributor

https://github.com/lmolkova/opentelemetry-python/blob/f6396062c3687cb33102a00b52607e9334ecdc85/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#L255-L264

LogData does not serve any specific purpose besides adding instrumentation scope to the LogRecord.
It would be more efficient and easier to use if SDK version of the LogRecord included instrumentation scope and was used directly by the processing pipeline.

Spec allows this via

The SDK may also use a single type to represent both ReadableLogRecord and ReadWriteLogRecord.

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#additional-logrecord-interfaces

Specific changes:

  • SDK implementation of the LogRecord should have instrumentation scope property
  • SDK Logger implementation should populate instrumentation scope on the log record when it's created or emitted
  • LogRecordProcessor.on_emit should take LogRecord as a parameter
  • LogExporter.export should take Sequence[LogRecord] as parameters

See prototype in lmolkova@ac81b5e#diff-36f9acf9eab5e742a5a9c25b30236b688323375867ba50caf3fdea8ec6a7d91f

Part of open-telemetry/community#1751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants