Skip to content

Expose capture_parameters in PyMySQL instrumentation - #4910

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

Expose capture_parameters in PyMySQL instrumentation#4910
saisharan0103 wants to merge 1 commit into
open-telemetry:mainfrom
saisharan0103:mergepath/issue-4791-opentelemetry-instrumentation-pymysql-ex

Conversation

@saisharan0103

Copy link
Copy Markdown

Issue #4791 notes that opentelemetry-instrumentation-pymysql delegates span creation to the shared dbapi instrumentation, but did not accept or forward the dbapi layer's capture_parameters option. That left PyMySQL users unable to enable parameter capture through either PyMySQLInstrumentor().instrument(capture_parameters=True) or PyMySQLInstrumentor().instrument_connection(conn, capture_parameters=True), even though dbapi supports the option and keeps it disabled by default.

This change mirrors the existing psycopg2/dbapi option plumbing for PyMySQL:

  • reads capture_parameters from _instrument kwargs with a False default
  • adds capture_parameters to instrument_connection
  • passes the option through to dbapi.wrap_connect and dbapi.instrument_connection
  • documents capture_parameters in the module docstring
  • keeps parameter formatting and semantic-convention behavior in the shared dbapi layer

Modified files:

  • instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/__init__.py
  • instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_integration.py

ruff check instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/__init__.py instrumentation/opentelemetry-instrumentation-pymysql/tests/test_pymysql_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 (29ba021) 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