You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opentelemetry\sdk\_logs\_internal\export\__init__.py", line 97, in <lambda>
formatter: Callable[[LogRecord], str] = lambda record: record.to_json()
^^^^^^^^^^^^^^
AttributeError: 'LogRecord' object has no attribute 'to_json'
Make it possible to (properly) use Logs API alone without touching SDK types
Add example and tests that use vanilla logs API (with note that it's for logging bridges, not end users) (update - this is not necessary anymore, logs API is now for everyone to use)
Consider using a pattern similar to tracing when users don't need to instantiate a new span. Instead they could call logger.emit(....) with parameters and the SDK implementation of logger will create SDK implementation of LogRecord
Let's assume I'm building a logging bridge for one of many python non-standard loggers (e.g. structlog).
I should be able to create a library using logging (bridge) API alone.
So I should write a code like:
It'd fail with
Probably related to #3552
The recommendation
(with note that it's for logging bridges, not end users)(update - this is not necessary anymore, logs API is now for everyone to use)ReadWriteLogRecordand should probably replaceLogData(see Logs SDK: consider removingLogDataand extending SDKLogRecordto have instrumentation scope #4313)logger.emit(....)with parameters and the SDK implementation of logger will create SDK implementation ofLogRecordPart of open-telemetry/community#1751