opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Auto instrumentation issues in Python 3.12

Open bourbonkk opened this issue 1 year ago • 1 comments
trafficstars

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.

bourbonkk avatar Dec 21 '23 00:12 bourbonkk

I believe this PR: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2181 would solve this

andre-meneses-fivestars avatar Apr 09 '24 11:04 andre-meneses-fivestars

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

andre-meneses-fivestars avatar May 20 '24 09:05 andre-meneses-fivestars

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

bourbonkk avatar May 20 '24 13:05 bourbonkk