-
Notifications
You must be signed in to change notification settings - Fork 680
Make auto instrumentation use the same dependency resolver as manual instrumentation does #3202
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
Make auto instrumentation use the same dependency resolver as manual instrumentation does #3202
Conversation
opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py
Outdated
Show resolved
Hide resolved
9cf2a02
to
49762d1
Compare
00362cf
to
149f84f
Compare
@xrmx, Here is an option for making the auto instrumentation use the same dependency checker as the manual instrumentation. There are a few rough edges but I think ironing those out gets us down a path of a major rewrite pretty quickly so maybe this little PR could work. |
opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py
Show resolved
Hide resolved
3533e55
to
aad1679
Compare
@xrmx just checking in, have you had a chance to look at this and my responses to your comment? |
28e57e5
to
1b6d07e
Compare
Not yet, sorry |
d8af135
to
a5c86fa
Compare
87a167d
to
eecb02f
Compare
eecb02f
to
e0d489f
Compare
@xrmx changelog fixed up |
instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
Show resolved
Hide resolved
I added some testing but stopped short of the full auto instrumentation test. I stopped short because the maintainer of kafka-python has come back and is now releasing updates again. The maintainer of kafka-python-ng is reccomending switching back to kafka-python and will be archiving kafka-python-ng soon (kafka-python-ng/kafka-python-ng#210 (comment)). These two packages were the reason this whole bug came about. But in a future PR (very soon) I'll be back with an update to the kafka-python instrumentation so it will support py312 and removal of the kafka-python-ng part of this instrumentation. In that vein, I don't think we need to add a test for a use case that will no longer happen here shortly. However, i still believe this PR should be merged and pushed out as I think using the same dependency resolver everywhere is the better option long term as there is one other instrumentation that also has this same behavior. cc @xrmx |
7fa0e85
to
97db979
Compare
psycopg2 / psycopg2-binary won't go away so we can write a test case for that |
Ok ill take a look at those tomorrow... hopefully. :) |
97db979
to
379a9f2
Compare
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_instrumentation.py
Show resolved
Hide resolved
214f9fe
to
92d697a
Compare
instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_instrumentation.py
Outdated
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_instrumentation.py
Outdated
Show resolved
Hide resolved
92d697a
to
f9b310b
Compare
@emdneto thanks for the review. Everything should be updated. |
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_instrumentation.py
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_instrumentation.py
Outdated
Show resolved
Hide resolved
7e3db32
to
91d41d7
Compare
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_instrumentation.py
Outdated
Show resolved
Hide resolved
3eed921
to
cbb765d
Compare
instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_instrumentation.py
Outdated
Show resolved
Hide resolved
…instrumentation does
cbb765d
to
5d983b8
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.
LGTM but unfortunately on conflict this now reproduces open-telemetry/opentelemetry-python#4509 . I'm working on a PR to fix that
UPDATE: PR here open-telemetry/opentelemetry-python#4528
Thanks @xrmx, i can rebase once that PR gets merged. |
Description
In order for the auto instrumentation to use the same dependency checker as the instrumentation itself, I introduce an exception that allows for an early exit from instrument function through the distro and back to the _load.
Fixes #3201
Type of change
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.