Skip to content
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

psycopg2 and dbapi instrumentaiton fixes #246

Merged
merged 2 commits into from
Jan 20, 2021

Commits on Jan 20, 2021

  1. Updated dbapi and psycopg2 instrumentations.

    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.
    owais committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    c14d9e4 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into dbapi-rework

    alrex committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    fdd17f8 View commit details
    Browse the repository at this point in the history