-
Notifications
You must be signed in to change notification settings - Fork 642
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
base: main
Are you sure you want to change the base?
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. |
|
||
_logger = getLogger(__name__) | ||
|
||
|
||
class _EntryPointDistFinder: |
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.
Any reason why you are removing this cache? I'm not sure this cache really helps with anything :)
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.
When I removed line 103 below, I couldn't find any other usages of this class so I removed this class just to keep things tidy.
If I missed a usage or a use case somewhere I am happy to re-add it. I just pulled it since my code search told me it was dead code.
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 actually think get_dist_dependency_conflicts is now unused too
> ag get_dist_dependency_conflicts
opentelemetry-instrumentation/tests/test_dependencies.py
23: get_dist_dependency_conflicts,
68: def test_get_dist_dependency_conflicts(self):
82: conflict = get_dist_dependency_conflicts(dist)
90: def test_get_dist_dependency_conflicts_requires_none(self):
103: conflict = get_dist_dependency_conflicts(dist)
opentelemetry-instrumentation/src/opentelemetry/instrumentation/dependencies.py
51:def get_dist_dependency_conflicts(
CHANGELOG.md
64:- `opentelemetry-instrumentation` Fix `get_dist_dependency_conflicts` if no distribution requires
3533e55
to
aad1679
Compare
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.