Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy: db.statement inclusion of sqlcomment as opt-in #3112

Conversation

tammy-baylis-swi
Copy link
Contributor

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

Description

Supports new, optional kwarg enable_attribute_commenter at SQLAlchemy instrumentation to opt into db.statement span attribute inclusion of sqlcomment.

Partially addresses #3107

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)
  • This change requires a documentation update

How Has This Been Tested?

  • tox -e py312-test-instrumentation-sqlalchemy-0
  • tox -e py312-test-instrumentation-sqlalchemy-1
  • tox -e py312-test-instrumentation-sqlalchemy-2
  • Instrumentation of a test app to check span attributes and mysql server logs when enable_attribute_commenter=True vs unset

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review December 17, 2024 20:20
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner December 17, 2024 20:20
@tammy-baylis-swi
Copy link
Contributor Author

cc'ing @alexmojaki , feel free to comment/review!

@tammy-baylis-swi tammy-baylis-swi requested a review from a team December 19, 2024 19:34
@tammy-baylis-swi
Copy link
Contributor Author

@lzchen , @xrmx : regarding this comment:

Would it be all right if we worked on getting this particular PR merged first (plus #3115 and #3121) to stop this feature from being On all the time in the next release?

@lzchen lzchen merged commit 26bcc93 into open-telemetry:main Jan 9, 2025
674 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the sqlalchemy-db-statement-comment-opt-in branch January 10, 2025 17:53
xrmx pushed a commit to xrmx/opentelemetry-python-contrib that referenced this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants