- Notifications
You must be signed in to change notification settings - Fork776
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
hectorhdzg commentedJul 9, 2025
Contrib tests expect an object like log.log_record returned in log_exporter.get_finished_logs() |
DylanRussell commentedJul 14, 2025
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 |
hectorhdzg commentedJul 14, 2025
@DylanRussell we can also call it SDKLogRecord like Javascripthttps://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/sdk-logs/src/index.ts#L24 |
DylanRussell commentedJul 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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: |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
hectorhdzg commentedJul 17, 2025
@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. |
Uh oh!
There was an error while loading.Please reload this page.
hectorhdzg commentedJul 17, 2025
@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. |
DylanRussell commentedJul 17, 2025
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 |
DylanRussell commentedJul 17, 2025
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 |
DylanRussell left a comment
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 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
DylanRussell commentedJul 21, 2025
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 |
Uh oh!
There was an error while loading.Please reload this page.
hectorhdzg commentedOct 20, 2025
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 |
...proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.pyShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
xrmx commentedOct 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've tried running pyright in this branch: And got a bunch of errors related to *LogRecord classes: Some may predate your changes but maybe worth to fix so we don't have to change typing later, some looks like we typed a RedableLogRecord but we are using methods only available to ReadWriteLogRecord. |
hectorhdzg commentedNov 7, 2025
@xrmx pyright should be good now, I always get "Git operation failed" errors randomly in some test, not sure if there is something I can do to fix that |
xrmx commentedNov 10, 2025
thanks! Unfortunately you cannot do anything about the transient git errors |
Uh oh!
There was an error while loading.Please reload this page.
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.
Just one nit, the rest looks good to me, thanks!
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
880ff71 to6ab5489Compareac45985 to216593eCompare5ddb8e7 intoopen-telemetry:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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