Skip to content

Commit

Permalink
Rm enable_commenter fixes for a different pr
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Dec 5, 2024
1 parent b591b0a commit 59fa855
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -240,23 +236,14 @@ 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__,
Psycopg2Instrumentor._DATABASE_SYSTEM,
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
Expand Down

0 comments on commit 59fa855

Please sign in to comment.