opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Add sqlalchemy db.statement sanitization flag

Open nemoshlag opened this issue 2 years ago • 1 comments
trafficstars

Description

Added an optional query sanitizer to the SQLAlchemy instrumentation. Usage SQLAlchemyInstrumentor().instrument(sanitize_query=True)

This will affect the DB_STATEMENT value to contain the original query or sanitized one.

Fixes #1549
Following the specification discussion here

Type of change

Please delete options that are not relevant.

  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

How Has This Been Tested?

  • [x] Test A db.statement has been sanitized
  • [x] Test B no side affects occurred on a query without a db.statement attribute

Does This PR Require a Core Repo Change?

  • [x] No.

Checklist:

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

nemoshlag avatar Mar 01 '23 10:03 nemoshlag

@shalevr can this be merged? seems that comments were fixed

arbiv avatar Aug 09 '23 12:08 arbiv