psycopg2 and dbapi instrumentaiton fixes#246
Merged
codeboten merged 2 commits intoopen-telemetry:masterfrom Jan 20, 2021
Merged
psycopg2 and dbapi instrumentaiton fixes#246codeboten merged 2 commits intoopen-telemetry:masterfrom
codeboten merged 2 commits intoopen-telemetry:masterfrom
Conversation
4c39049 to
d6a25cf
Compare
srikanthccv
reviewed
Dec 14, 2020
...tion/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py
Show resolved
Hide resolved
12 tasks
c3192d9 to
c305a8e
Compare
5bf1d30 to
ced0e41
Compare
ocelotl
approved these changes
Jan 19, 2021
instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py
Show resolved
Hide resolved
6f924fe to
a354266
Compare
aabmass
requested changes
Jan 19, 2021
...tion/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py
Show resolved
Hide resolved
...tion/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py
Outdated
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py
Show resolved
Hide resolved
...telemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py
Outdated
Show resolved
Hide resolved
srikanthccv
approved these changes
Jan 20, 2021
29b0612 to
d2295fb
Compare
Changes: - Update dbapi instrumentation to use the SQL statement name as the span instead of the entire SQL query. - Renamed TracedCursor with CursorTracing. The class was not a valid Cursor so the name was confusing. - Updated CursorTracing's (previously TracedCursor) traced_execution method to accept the cursor instance as the first argument. This is required as for some dbapi implementations, we need a reference to the cursor in order to correctly format the SQL query. - Updated psycopg2 instrumentation to leverage dbapi's `cursor_factory` mechanism instead of wrapping the cursor with wrapt. This results in a simpler instrumentation without monkey patching objects at runtime and allows psycopg2's type registration system to work. This should make it possible to use psycopg2 instrumentation when using the JSONB feature or with frameworks like Django.
Contributor
Author
|
@aabmass please take another look when you can. Thanks. |
codeboten
approved these changes
Jan 20, 2021
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #143
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist: