4 Commits

Author SHA1 Message Date
8b9202be6f Updated dbapi and psycopg2 instrumentations. (#246)
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.
2021-01-20 10:45:28 -08:00
bd39b36b82 Fix tests for sqlite 2020-11-18 01:36:16 +05:30
de626f7a02 Parent is now always passed in via Context, intead of Span or SpanContext (#1146)
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2020-10-22 17:13:55 -07:00
06e07b3088 Rename db framework packages from "ext" to "instrumentation" (#966) 2020-10-22 17:13:55 -07:00