-
Notifications
You must be signed in to change notification settings - Fork 599
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
Generate instrumentation list #514
Generate instrumentation list #514
Conversation
4091583
to
b412628
Compare
c1093cf
to
cff9fde
Compare
This will shrink after #475 is merged and this is rebased on main. |
dfd8215
to
e87e5c0
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.
Overall this looks great, a much needed improvement. Please take a look at the comments.
CHANGELOG.md
Outdated
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.2.0-0.21b0...HEAD) | |||
|
|||
### Changed | |||
- `opentelemetry-bootstrap` is not more robust and less likley to leave systems in a |
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.
- `opentelemetry-bootstrap` is not more robust and less likley to leave systems in a | |
- `opentelemetry-bootstrap` is not more robust and less likely to leave systems in a |
CHANGELOG.md
Outdated
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.2.0-0.21b0...HEAD) | |||
|
|||
### Changed | |||
- `opentelemetry-bootstrap` is not more robust and less likley to leave systems in a | |||
broken state. |
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.
less likley to leave systems in a broken state
It might be useful to just call out why it's less likely to leave things in a broken. As a user, I would just not run the command as I wouldn't understand what to look for to determine if my system is broken or not as a result of opentelemetry-bootstrap
@@ -66,6 +68,32 @@ | |||
|
|||
extras_require["test"] = test_deps | |||
|
|||
|
|||
class JSONMetadataCommand(distutils.cmd.Command): |
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.
Curious if you'd considered putting this class in the instrumentation package for convenience? Wondering if this is something others who want to create instrumentations that are not necessarily in this repo would be able to use.
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.
That would add the instrumentation package as a build/setup dependency to all instrumentations. It is a regular dependency anyway so adding a dep is not a concern but I've never used setup dependencies so not sure how well it works or if it has any downsides.
Instrumentations outside this repo don't really need this as bootstrap command will probably never know about them.
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.
Either way, having it in setup.py keeps the doors open if we want to move it to the opentelemetry-instrumentation package later.
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.
Fair enough.
# the libraries their application uses to figure which one can be | ||
# instrumented. | ||
# NOTE: system-metrics is not to be included. | ||
def all_instrumentations(): |
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.
Seeing this code being removed makes me very happy 🥳
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 know!! 😆
@@ -170,7 +170,7 @@ Below is a checklist of things to be mindful of when implementing a new instrume | |||
- Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L26) | |||
- Supports auto-instrumentation | |||
- Add an entry point (ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/setup.cfg#L56) | |||
- Add instrumentation package to `bootstrap.py` (https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py#L37) | |||
- Run `python scripts/setup.py` followed by `python scripts/generate_instrumentation_bootstrap.py` after adding a new instrumentation package. |
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.
It would be great to add a github action that checks that these scripts have been run.
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.
Also, kudos on using the video to explain the PR, it made the review much easier! |
931d213
to
87498fd
Compare
48e65d7
to
16f98a6
Compare
c3ed017
to
6955e41
Compare
@@ -0,0 +1,6 @@ | |||
-c dev-requirements.txt |
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.
Added a separate file for two reasons:
- tox -e generate only needs these dependencies. Installing everything else from dev-requirements.txt is very unnecessary.
- astor pulls in deps that fails on pypy so if we add astor to dev-requirements, pypy test jobs start failing.
6955e41
to
b93aa75
Compare
- We now automatically generate bootstrap_gen.py file from the list of instrumentations present in the source tree. - Bootstrap command now uses consumes this auto-generated list instead of keeping it's own local copy. - We no longer uninstall packages before installing them as instrumentation package no longer specify libraries as dependencies so the edge cases are no longer there. - We no longer try to install an incompatible version or force upgrade/downgrade an installed version. This used to leave systems in broken states which should happen no more.
b93aa75
to
637b3cf
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.
Thanks for addressing my comments!
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.
Nice video @owais 😎
Description
31.May.2021.-.Loom.Recording.mp4
Details
scripts/prepare_release.py
to generate instrumentation setup.py files and instrumentation list for the bootstrap command.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.