-
Notifications
You must be signed in to change notification settings - Fork 624
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
Instrumentation runtime checks #475
Instrumentation runtime checks #475
Conversation
5b811ae
to
8829586
Compare
49e25cb
to
f84cbdf
Compare
9377231
to
e00338d
Compare
# limitations under the License. | ||
|
||
|
||
_instruments = ("boto~=2.0",) |
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.
Could you include in CONTRIBUTING.MD
for the instrumentation checklist that _instruments
needs to be included?
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.
Yes. I'll do it in #514 as it includes some more changes wrt to contributing instrumentations.
opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py
Outdated
Show resolved
Hide resolved
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.
Just a minor typo 👍
exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py
Outdated
Show resolved
Hide resolved
e8a1574
to
0fafe94
Compare
0fafe94
to
35e7010
Compare
Since the introduction of the `_instruments` runtime checks in open-telemetry#475, the FastAPI instrumentation has stopped working for versions >= `0.59.0`. However the current test suite passes even for the latest released version at the moment (`0.67.0`). It seems this isn't related to a limitation in the instrumentation code, but actually because of it being created when `0.58` was the latest version: open-telemetry/opentelemetry-python@7bec76a.
Since the introduction of the `_instruments` runtime checks in open-telemetry#475, the FastAPI instrumentation has stopped working for versions >= `0.59.0`. However the current test suite passes even for the latest released version at the moment (`0.67.0`). It seems this isn't related to a limitation in the instrumentation code, but actually because of it being created when `0.58` was the latest version: open-telemetry/opentelemetry-python@7bec76a.
* Allow instrumentation of newer FastAPI versions Since the introduction of the `_instruments` runtime checks in #475, the FastAPI instrumentation has stopped working for versions >= `0.59.0`. However the current test suite passes even for the latest released version at the moment (`0.67.0`). It seems this isn't related to a limitation in the instrumentation code, but actually because of it being created when `0.58` was the latest version: open-telemetry/opentelemetry-python@7bec76a. * Add changelog entry Co-authored-by: Owais Lone <owais@users.noreply.github.com>
Description
This change updates instrumentations to remove the instrumented libraries as install time dependencies. It also adds runtime checks to instrumentations so they don't try to instrument unsupported versions of a library.
Effectively this means installing instrumentations will not automatically install the instrumented libraries. For example:
opentelemetry-instrumentation-requests
will not installrequests
.Manual instrumentation
ImportError
.Auto instrumentation (via opentelemetry-instrument command)
Updated logic is mostly contained in the opentelemetry-instrumentation package. Look at
instrumentors.BaseInsrumentor
andsitecustomize._load_instrumentors
. Rest of the changes are just about updating packaging/layout for all instrumentations.Implements a solution for: open-telemetry/opentelemetry-python#1729
Includes changes from #474. Will get simpler once that is merged.
Blocks #514
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.