Skip to content

Expose capture_parameters in pymssql instrumentation - #4909

Open
saisharan0103 wants to merge 1 commit into
open-telemetry:mainfrom
saisharan0103:mergepath/issue-4792-opentelemetry-instrumentation-pymssql-ex
Open

Expose capture_parameters in pymssql instrumentation#4909
saisharan0103 wants to merge 1 commit into
open-telemetry:mainfrom
saisharan0103:mergepath/issue-4792-opentelemetry-instrumentation-pymssql-ex

Conversation

@saisharan0103

Copy link
Copy Markdown

Issue #4792 reports that opentelemetry-instrumentation-pymssql does not expose capture_parameters even though the pymssql instrumentor delegates tracing to the shared dbapi wrapper.

Root cause: PyMSSQLInstrumentor._instrument called dbapi.wrap_connect without reading or forwarding capture_parameters, instrument_connection only accepted connection and tracer_provider, and _PyMSSQLDatabaseApiIntegration can only enable inherited DatabaseApiIntegration parameter capture when the dbapi factory receives the flag.

This mirrors the psycopg2 forwarding surface by:

  • reading capture_parameters from _instrument kwargs with a False default
  • passing capture_parameters to dbapi.wrap_connect
  • adding capture_parameters to instrument_connection
  • forwarding it to dbapi.instrument_connection
  • documenting the new module API option with a concise example

No pymssql-specific parameter formatting is added; _PyMSSQLDatabaseApiIntegration continues to inherit DatabaseApiIntegration.__init__ so the shared dbapi integration stores the flag.

ruff check instrumentation/opentelemetry-instrumentation-pymssql/src/opentelemetry/instrumentation/pymssql/__init__.py instrumentation/opentelemetry-instrumentation-pymssql/tests/test_pymssql_integration.py reports no new findings on the changed files.
Ran pytest -x locally with no new failures.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (95747b8) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

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.

1 participant