Skip to content

Auto instrumentation issues in Python 3.12 #2100

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

Open
bourbonkk opened this issue Dec 21, 2023 · 3 comments
Open

Auto instrumentation issues in Python 3.12 #2100

bourbonkk opened this issue Dec 21, 2023 · 3 comments

Comments

@bourbonkk
Copy link
Contributor

Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.

Is your feature request related to a problem?
If so, provide a concise description of the problem.

As you may have noticed, it's been a while since Python 3.12 was released.
In Python 3.12, the pkg_resources package was removed.

As a result, I don't think the auto-instrumentation feature in 3.12 will work with it. If you look at the dependencies.py, it uses pkg_resources to validate supported versions.

I think we need to change to a versioning logic that will be compatible in 3.12.
Are there any ideas being discussed on this?

Describe the solution you'd like
What do you want to happen instead? What is the expected behavior?

auto instrumentation in python 3.12

Describe alternatives you've considered
Which alternative solutions or features have you considered?

I thought about checking the version with the importlib package.
But to compare versions using strings like "flask >= 1.0, < 3.0",
it need a development parsing class (it was able to do this with the pkg_resources package).

And we need to modify the DependencyConflict class to make it universally usable - there is no VersionConflict exception in importlib, all exceptions are PackageNotFoundError.

Additional context
Add any other context about the feature request here.

If you have something in mind, please share.
Python 3.12 has a lot of changes, so I suspect it will probably grow in users quickly.

@andre-meneses-fivestars
Copy link

I believe this PR: #2181 would solve this

@andre-meneses-fivestars

@bourbonkk why close if the linked PR is not merged?

@bourbonkk bourbonkk reopened this May 20, 2024
@bourbonkk
Copy link
Contributor Author

@andre-meneses-fivestars oh i'm sorry, I misunderstood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants