From 59fa855ec4a35d1b55474db2309c183eb598599a Mon Sep 17 00:00:00 2001 From: tammy-baylis-swi Date: Thu, 5 Dec 2024 13:35:22 -0800 Subject: [PATCH] Rm enable_commenter fixes for a different pr --- .../instrumentation/psycopg2/__init__.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py index a0c5bb1059..6354a3caf2 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/__init__.py @@ -164,8 +164,6 @@ def instrument_connection( self, connection, tracer_provider: typing.Optional[trace_api.TracerProvider] = None, - enable_commenter: bool = False, - commenter_options: dict = None, ): if self._is_instrumented_by_opentelemetry: # _instrument (via BaseInstrumentor) or instrument_connection (this) @@ -182,8 +180,6 @@ def instrument_connection( connection.cursor_factory = _new_cursor_factory( base_factory=connection.cursor_factory, tracer_provider=tracer_provider, - enable_commenter=enable_commenter, - commenter_options=commenter_options, ) self._is_instrumented_by_opentelemetry = True @@ -240,13 +236,7 @@ def get_statement(self, cursor, args): return statement -def _new_cursor_factory( - db_api: dbapi.DatabaseApiIntegration = None, - base_factory: pg_cursor = None, - tracer_provider: typing.Optional[trace_api.TracerProvider] = None, - enable_commenter: bool = False, - commenter_options: dict = None, -): +def _new_cursor_factory(db_api=None, base_factory=None, tracer_provider=None): if not db_api: db_api = DatabaseApiIntegration( __name__, @@ -254,9 +244,6 @@ def _new_cursor_factory( connection_attributes=Psycopg2Instrumentor._CONNECTION_ATTRIBUTES, version=__version__, tracer_provider=tracer_provider, - enable_commenter=enable_commenter, - commenter_options=commenter_options, - connect_module=psycopg2, ) base_factory = base_factory or pg_cursor