Skip to content

update SDK to call version directly#5145

Open
codeboten wants to merge 12 commits intoopen-telemetry:mainfrom
codeboten:codeboten/memory-footprint-reduction
Open

update SDK to call version directly#5145
codeboten wants to merge 12 commits intoopen-telemetry:mainfrom
codeboten:codeboten/memory-footprint-reduction

Conversation

@codeboten
Copy link
Copy Markdown
Contributor

@codeboten codeboten commented Apr 24, 2026

Description

Removing the call to version in the resource to reduce the amount of libraries imported.

~17–27% memory reduction across all scenarios
~11–23% startup time reduction

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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

  • Ran unit tests

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Removing the call to version in the resource to reduce the amount of libraries imported.

~17–27% memory reduction across all scenarios
~11–23% startup time reduction

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@herin049
Copy link
Copy Markdown
Contributor

Thanks for the updates! One more small comment is that the previous behavior was to allow modifying the merge order of the "otel" resource detector by respecting its position in the resource detectors list if it is explicitly provided. This is a pretty fringe use-case, but I'd prefer to keep this behavior if possible.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
…to method

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@codeboten codeboten marked this pull request as ready for review April 29, 2026 22:23
@codeboten codeboten requested a review from a team as a code owner April 29, 2026 22:23
@codeboten
Copy link
Copy Markdown
Contributor Author

@herin049 i think i've addressed all your comments, please take a look

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Copy link
Copy Markdown
Contributor

@ocelotl ocelotl left a comment

Choose a reason for hiding this comment

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

Just a few comments ✌️

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py
codeboten and others added 5 commits April 30, 2026 08:02
Co-authored-by: Lukas Hering <40302054+herin049@users.noreply.github.com>
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

4 participants