File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 111111import typing
112112
113113import mysql .connector
114- import wrapt
115114
116115from opentelemetry import trace as trace_api
117116from opentelemetry .instrumentation import dbapi
@@ -180,22 +179,19 @@ def instrument_connection(
180179 Returns:
181180 An instrumented connection.
182181 """
183- if isinstance (connection , wrapt .ObjectProxy ):
184- _logger .warning ("Connection already instrumented" )
185- return connection
186-
187- db_integration = DatabaseApiIntegration (
182+ return dbapi .instrument_connection (
188183 __name__ ,
184+ connection ,
189185 self ._DATABASE_SYSTEM ,
190186 self ._CONNECTION_ATTRIBUTES ,
191187 version = __version__ ,
192188 tracer_provider = tracer_provider ,
193189 enable_commenter = enable_commenter ,
194190 commenter_options = commenter_options ,
195191 connect_module = mysql .connector ,
192+ db_api_integration_factory = DatabaseApiIntegration ,
193+ get_cnx_proxy = get_traced_connection_proxy ,
196194 )
197- db_integration .get_connection_attributes (connection )
198- return get_traced_connection_proxy (connection , db_integration )
199195
200196 def uninstrument_connection (
201197 self ,
You can’t perform that action at this time.
0 commit comments