-
Notifications
You must be signed in to change notification settings - Fork 641
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
bootstrap: no need to install tortoiseorm instrumentation if pydantic is found #2409
base: main
Are you sure you want to change the base?
bootstrap: no need to install tortoiseorm instrumentation if pydantic is found #2409
Conversation
89219d8
to
5561b62
Compare
cc @tonybaloney |
d0f7e7a
to
8fa658e
Compare
Hi @xrmx. What use cases would this update fix? e.g. startup errors, duplicate spans, errored spans |
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.
Please give more context on how this PR is fixing an issue.
instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml
Show resolved
Hide resolved
bootstrap looks into this field for adding instrumentations based on the installed libraries. With that line tortoiseorm instrumentation is installed even in the case where just pydantic is installed. |
1800f0d
to
69125d1
Compare
Revamped the PR to teach bootstrap about AND'ed dependencies. |
69125d1
to
778efea
Compare
2ad194f
to
7f41005
Compare
…strumentations Treat packages that express their project.optional-dependencies instruments entry as a list to AND the requirements. This is to install the istrumentation only if all the instruments packages are found. More than one entry in project.optional-dependencies instruments are still considered OR'ed as before.
…tation_bootstrap.py
Remove the hack of using the project.optional-dependencies table for expressing the libraries required for the instrumentation to work. This frees us from the project.optional-dependencies specification that permits to use only strings in dependencies groups.
Use a list to express that the tortoiseorm instrumentation targets projects with both tortoiseorm AND pydantic installed. So that tortoiseorm instrumentation is installed only if both packages are found by opentelemetry-bootstrap.
7f41005
to
fc66e45
Compare
@@ -29,7 +29,7 @@ dependencies = [ | |||
"wrapt >= 1.0.0, < 2.0.0", | |||
] | |||
|
|||
[project.optional-dependencies] | |||
[tool.opentelemetry-bootstrap] |
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.
Maybe this is breaking instrumentation.dependencies.get_dist_dependency_conflicts
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.
Yeah, it' breaking it. Given that AFAICS [tool.*]
metadata is not available in installed package I guess we can use the _package
module inside each instrumentation and maybe make [tool.opentelemetry-bootstrap]
dynamic to avoid duplicating the data.
instrumentation.dependencies.get_dist_dependency_conflicts
would then be updated to look at the _package module instead of the distribution requirements.
Another use case for this is #610 |
Description
Right now opentelemetry-bootstrap is installing tortoiseorm instrumentation if pydantic is found in the currently installed packages. In order to avoid that enhance bootstrap to recognize AND'ed requirements if instruments requirements are in a list.
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.