* fix: Ensure compability with Psycopg3 to extract libpq build version
Struggling with getting dbapi and psycopg3 working.
Think this is the error, __libpq_version does not exist on psycopg3
https://github.com/psycopg/psycopg/blob/master/psycopg/psycopg/pq/pq_ctypes.py#L1220
* docs: Add changelog entry
* docs: Fix spelling
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Several issues have arisen from this bugfix, reverting here until a
better solution can be found.
Fixes#1658
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
* Fix install of Python 3.10 on GitHub Actions
In PR #1604 the Python version was upgraded to Python 3.10 to fix a
local issue on M1 MacBooks.
The GitHub Action workflows now exit with the following message for the
docker-tests, spellcheck and lint checks, skipping these checks.
```
lint create: /home/runner/work/opentelemetry-python-contrib/opentelemetry-python-contrib/.tox/lint
SKIPPED: InterpreterNotFound: python3.10
___________________________________ summary ____________________________________
SKIPPED: lint: InterpreterNotFound: python3.10
congratulations :)
```
Upgrade the Python version in the GitHub Actions workflow to fix this.
* Fix YAML interpretation of Python 3.10
* Upgrade Docker tests dependencies
Upgrade the asyncpg and psycopg2 packages, they don't work on Python
3.10.
This also fixes running these tests no M1 MacBooks.
* Fix linter issues merged into main
They went unnoticed while the CI didn't fail on the lint task not
working.
---------
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
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.