-
Notifications
You must be signed in to change notification settings - Fork 754
[logs-sdk] Remove LogData and extend SDK LogRecord to have instrumentation scope #4676
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
base: main
Are you sure you want to change the base?
[logs-sdk] Remove LogData and extend SDK LogRecord to have instrumentation scope #4676
Conversation
Contrib tests expect an object like log.log_record returned in log_exporter.get_finished_logs() |
What if instead of removing I don't think we need a This way we don't need to update 2 classes every time a change is made to the log data structure. Also I think our implementation is confusing the 2 classes in a bunch of places maybe because they are named the same. For example I think |
@DylanRussell we can also call it SDKLogRecord like Javascript https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/sdk-logs/src/index.ts#L24 |
Yeah I think i'm OK with that name too. But what do you think of it being just the 3 fields I mentioned above ? And switching Logger.emit in the SDK to take the API LogRecord and then create the SDK LogRecord and attach instrumentation_scope/resource to it.. That looks to be what javascript is doing too: |
@DylanRussell updated, still having SDKLogRecord inheriting API LogRecord, having the API LogRecord as an attribute feels really weird to me, I think it could cause more confusion an issues than solving them, let me know what you think. |
@open-telemetry/python-maintainers this is definitely a big breaking change, do we want to use another branch to group the Logs updates together?, we discussed this last week SIG meeting, but trying to understand what is the best way to move forward here. |
In my opinion just have SdkLogRecord with a ApiLogRecord attribute, it should not inherit from it at all now.. We don't need another class with all the same attributes. We just need a small wrapper class..
And |
Looks like some instrumentations fail w/ this change (https://github.com/open-telemetry/opentelemetry-python-contrib/blob/f20fa77ad59d90aae4978ae28cb1a98b12fbb959/instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_function_calling.py#L4 -- this instrumentation is accessing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
I know at one of the spec meetings we agreed it was a good idea to make a bunch of the breaking changes in one release.. Do we want to add the @Deprecation wrappers to some of these things first (ex: on |
I'm a little bit confused why genai tests are failing in contrib, looks like these are also testing sdk logs but not using current changes here, need to dig deeper UPDATE: Events was sending incorrect types, fixed now |
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Outdated
Show resolved
Hide resolved
K looks good to me again |
I'm happy to resolve conflicts and update when release plan is defined |
"LogLimits", | ||
"LogRecord", | ||
"LogRecordProcessor", | ||
"LogDeprecatedInitWarning", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should be ready for another look now, failing tests are about commit mismatch and actual check of breaking changes that is accurate in this case |
Description
Removing LogData and extending SDK LogRecord to have instrumentation scope
Fixes #4313
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration