Skip to content

Conversation

tammy-baylis-swi
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Dec 19, 2024

Description

Supports new, optional kwarg enable_attribute_commenter to opt into db.statement span attribute inclusion of sqlcomment for these db driver instrumentors:

  • psycopg2 instrumentor
  • psycopg instrumentor
  • mysqlclient instrumentor
  • PyMySQL instrumentor

Partially addresses #3107

Depends on approval and merge of #3115. Please make sure that's merged first.

Type of change

Breaking because db.statement span attribute inclusion of sqlcomment currently always happens if sqlcommenter enabled. It'll be opt-in with this update, so might break for those users relying on the feature introduced in 0.50b0.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • tox -e py312-test-instrumentation-psycopg2
  • tox -e py312-test-instrumentation-psycopg
  • tox -e py312-test-instrumentation-mysqlclient
  • tox -e py312-test-instrumentation-pymysq;

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review December 23, 2024 17:32
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner December 23, 2024 17:32
@xrmx xrmx merged commit 8406e2e into open-telemetry:main Jan 13, 2025
674 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the db-drivers-db-statement-comment-opt-in branch January 13, 2025 16:55
xrmx pushed a commit to xrmx/opentelemetry-python-contrib that referenced this pull request Jan 24, 2025
…metry#3121)

* db-api opt-in for enable_attribute_commenter

* Refactor db-api traced_execution

* Changelog

* Update comment

* psycopg(2), mysqlclient, pymysql support enable_attribute_commenter

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants