-
Notifications
You must be signed in to change notification settings - Fork 805
asyncio: fix duplicate instrumentation #3408
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
|
@bourbonkk looks like you commited with multiple accounts and one has not signed the CLA |
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
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.
Thank you!
|
@xrmx |
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
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.
I don't want to block this since it's an improvement. Please just address comments
...rumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_duplicate_instrument.py
Outdated
Show resolved
Hide resolved
...rumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_duplicate_instrument.py
Outdated
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
…memory-leak # Conflicts: # CHANGELOG.md
...y-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/instrumentation_state.py
Outdated
Show resolved
Hide resolved
…telemetry/instrumentation/asyncio/instrumentation_state.py
Description
This PR addresses duplicate instrumentation of Future objects when using AsyncioInstrumentor multiple times on the same Future. Without proper de-duplication, callbacks can continue to accumulate and cause memory leaks. This change introduces a simple attribute check on each Future, coroutine, or function so that once instrumented, no additional callbacks or spans will be attached.
Fixes #3383 aiokafka instrumentation cause memory leak
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
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.