Skip to content

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

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

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

Conversation

@popsiclelmlm

Copy link
Copy Markdown

Description

Fixes #707.

Summary

Updates the DBAPI documentation example for pyodbc to wrap the module-level connect function instead of Connection.

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_integration and wrap_connect both expect the DBAPI module function used to create connections.

Changes

  • Changes the pyodbc trace_integration example from "Connection" to "connect".
  • Changes the pyodbc wrap_connect example from "Connection" to "connect".

Tests

  • git diff --check
  • /tmp/otel-rstcheck-venv/bin/rstcheck docs/instrumentation/dbapi/dbapi.rst
  • python3 -m compileall -q instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py

Screenshots/Logs

Not applicable; docs-only change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated (not applicable; docs-only example change)
  • Unit tests have been added (not applicable; docs-only example change)
  • Documentation has been updated

@tammy-baylis-swi tammy-baylis-swi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 4, 2026
@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in Python PR digest Jun 4, 2026
@tammy-baylis-swi tammy-baylis-swi moved this from Ready for review to Easy to review / merge / close in Python PR digest Jun 4, 2026

@tammy-baylis-swi tammy-baylis-swi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@github-project-automation github-project-automation Bot moved this from Easy to review / merge / close to Approved PRs in Python PR digest Jun 4, 2026
@tammy-baylis-swi tammy-baylis-swi moved this from Approved PRs to Easy to review / merge / close in Python PR digest Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from Easy to review / merge / close to Approved PRs in Python PR digest Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

Instrumentation dbapi is not capturing the odbc database commands

3 participants