docs(dbapi): fix pyodbc connect method example#4657
Open
popsiclelmlm wants to merge 1 commit into
Open
Conversation
Assisted-by: GPT-5
tammy-baylis-swi
approved these changes
Jun 4, 2026
tammy-baylis-swi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this!
herin049
approved these changes
Jun 7, 2026
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 #707.
Summary
Updates the DBAPI documentation example for pyodbc to wrap the module-level
connectfunction instead ofConnection.Reproduction
The issue report shows
trace_integration(pyodbc, "Connection", "odbc")does not produce DB spans for pyodbc, while changing the connect method name to"connect"makes instrumentation work.Root cause
The documented pyodbc example uses the wrong connect method name.
trace_integrationandwrap_connectboth expect the DBAPI module function used to create connections.Changes
trace_integrationexample from"Connection"to"connect".wrap_connectexample from"Connection"to"connect".Tests
git diff --check/tmp/otel-rstcheck-venv/bin/rstcheck docs/instrumentation/dbapi/dbapi.rstpython3 -m compileall -q instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.pyScreenshots/Logs
Not applicable; docs-only change.
Type of change
Does This PR Require a Core Repo Change?
Checklist: