-
Notifications
You must be signed in to change notification settings - Fork 713
opentelemetry-instrumentation-starlette: fix memory leak and double middleware #3529
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
Conversation
...ntelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py
Show resolved
Hide resolved
...ntelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py
Outdated
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py
Outdated
Show resolved
Hide resolved
@anuraaga this is ready to review since you fixed the testcase right? |
instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py
Outdated
Show resolved
Hide resolved
Yup should be ok now |
Oh no, I didn't check existing PRs before making this one and now see @MattiasDC's #3456 is quite similar. I found the tests seem to pass fine for the current baseline version so didn't raise it here which is the main difference. Feel free to reject this PR as a duplicate and get that one in instead though, then I can send another one with just the |
instrumentation/opentelemetry-instrumentation-starlette/test-requirements.latest.txt
Outdated
Show resolved
Hide resolved
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.
dee09c0
to
3aebb34
Compare
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.
Thanks @emdneto have rebased this PR
instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py
Show resolved
Hide resolved
Co-authored-by: Joe McGinley <[email protected]>
Description
Fixes memory leak from using
set
, which prevents__del__
, which means starlette apps can never be garbage collected.Fixes adding two middlewares if
instrument_app
is called with auto instrumentation active/cc @xrmx
Type of change
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
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.