Skip to content

docs(dbapi): fix pyodbc connect method example#4684

Open
popsiclelmlm wants to merge 1 commit into
open-telemetry:mainfrom
popsiclelmlm:codex/dbapi-pyodbc-connect-method
Open

docs(dbapi): fix pyodbc connect method example#4684
popsiclelmlm wants to merge 1 commit into
open-telemetry:mainfrom
popsiclelmlm:codex/dbapi-pyodbc-connect-method

Conversation

@popsiclelmlm

Copy link
Copy Markdown

Description

Summary

  • Updates the DBAPI instrumentation examples for pyodbc to wrap the module-level connect callable instead of Connection.

Reproduction

Root cause

  • trace_integration / wrap_connect wrap the DBAPI module function that creates connections. For pyodbc, that function is pyodbc.connect; using Connection in the example can lead users to wrap the wrong target.

Changes

  • Replace the pyodbc examples in the DBAPI instrumentation docs from "Connection" to "connect".

Tests

  • python3 -m compileall -q instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi
  • git diff --check
  • Not run: tox / uv based test environments, because neither tox nor uv is available in this local environment.

Screenshots/Logs

  • Not applicable.

Fixes #707

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

  • python3 -m compileall -q instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi
  • git diff --check

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Instrumentation dbapi is not capturing the odbc database commands

1 participant