| 
20 | 20 | from opentelemetry import trace as trace_api  | 
21 | 21 | from opentelemetry.instrumentation.mysql import MySQLInstrumentor  | 
22 | 22 | from opentelemetry.sdk import resources  | 
23 |  | -from opentelemetry.semconv.trace import SpanAttributes  | 
 | 23 | +from opentelemetry.semconv._incubating.attributes.db_attributes import DB_STATEMENT  | 
24 | 24 | from opentelemetry.test.test_base import TestBase  | 
25 | 25 | 
 
  | 
26 | 26 | 
 
  | 
@@ -157,7 +157,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled(self):  | 
157 | 157 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
158 | 158 |             )  | 
159 | 159 |             self.assertEqual(  | 
160 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 160 | +                span.attributes[DB_STATEMENT],  | 
161 | 161 |                 "Select 1;",  | 
162 | 162 |             )  | 
163 | 163 | 
 
  | 
@@ -196,7 +196,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled_stmt_enabled(  | 
196 | 196 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
197 | 197 |             )  | 
198 | 198 |             self.assertEqual(  | 
199 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 199 | +                span.attributes[DB_STATEMENT],  | 
200 | 200 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
201 | 201 |             )  | 
202 | 202 | 
 
  | 
@@ -239,7 +239,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled_with_options(  | 
239 | 239 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_threadsafety='123',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
240 | 240 |             )  | 
241 | 241 |             self.assertEqual(  | 
242 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 242 | +                span.attributes[DB_STATEMENT],  | 
243 | 243 |                 "Select 1;",  | 
244 | 244 |             )  | 
245 | 245 | 
 
  | 
@@ -274,7 +274,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_not_enabled_default(  | 
274 | 274 |             spans_list = self.memory_exporter.get_finished_spans()  | 
275 | 275 |             span = spans_list[0]  | 
276 | 276 |             self.assertEqual(  | 
277 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 277 | +                span.attributes[DB_STATEMENT],  | 
278 | 278 |                 "Select 1;",  | 
279 | 279 |             )  | 
280 | 280 | 
 
  | 
@@ -332,7 +332,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled(  | 
332 | 332 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
333 | 333 |             )  | 
334 | 334 |             self.assertEqual(  | 
335 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 335 | +                span.attributes[DB_STATEMENT],  | 
336 | 336 |                 "Select 1;",  | 
337 | 337 |             )  | 
338 | 338 | 
 
  | 
@@ -373,7 +373,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled_stmt_enabled(  | 
373 | 373 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
374 | 374 |             )  | 
375 | 375 |             self.assertEqual(  | 
376 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 376 | +                span.attributes[DB_STATEMENT],  | 
377 | 377 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
378 | 378 |             )  | 
379 | 379 | 
 
  | 
@@ -418,7 +418,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled_with_options(  | 
418 | 418 |                 f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_threadsafety='123',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",  | 
419 | 419 |             )  | 
420 | 420 |             self.assertEqual(  | 
421 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 421 | +                span.attributes[DB_STATEMENT],  | 
422 | 422 |                 "Select 1;",  | 
423 | 423 |             )  | 
424 | 424 | 
 
  | 
@@ -453,7 +453,7 @@ def test_instrument_with_dbapi_sqlcomment_not_enabled_default(  | 
453 | 453 |             spans_list = self.memory_exporter.get_finished_spans()  | 
454 | 454 |             span = spans_list[0]  | 
455 | 455 |             self.assertEqual(  | 
456 |  | -                span.attributes[SpanAttributes.DB_STATEMENT],  | 
 | 456 | +                span.attributes[DB_STATEMENT],  | 
457 | 457 |                 "Select 1;",  | 
458 | 458 |             )  | 
459 | 459 | 
 
  | 
 | 
0 commit comments