Although psycopg2 uses dbapi, it does not instrument capture_parameters=True. It's therefore missing the ability for a user to enable/disable raw db.statement's.
For example, I would expect to apply the parameter similar to enable_commenter and see the raw db.statement:
Psycopg2Instrumentor().instrument(capture_parameters=True)
In my testing, I am seeing db.statements sanitized by default.
I think this is the relevant code:
|
dbapi.wrap_connect( |
|
__name__, |
|
psycopg2, |
|
"connect", |
|
self._DATABASE_SYSTEM, |
|
self._CONNECTION_ATTRIBUTES, |
|
version=__version__, |
|
tracer_provider=tracer_provider, |
|
db_api_integration_factory=DatabaseApiIntegration, |
|
enable_commenter=enable_sqlcommenter, |
|
commenter_options=commenter_options, |
|
) |
Although psycopg2 uses dbapi, it does not instrument
capture_parameters=True. It's therefore missing the ability for a user to enable/disable rawdb.statement's.For example, I would expect to apply the parameter similar to
enable_commenterand see the raw db.statement:In my testing, I am seeing db.statements sanitized by default.
I think this is the relevant code:
opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py
Lines 143 to 154 in e4d8f10