Skip to content

Commit 7f31cc0

Browse files
committed
ref(mysql): remove SpanAttributes
1 parent b1c2c79 commit 7f31cc0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

instrumentation/opentelemetry-instrumentation-mysql/tests/test_mysql_integration.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from opentelemetry import trace as trace_api
2121
from opentelemetry.instrumentation.mysql import MySQLInstrumentor
2222
from opentelemetry.sdk import resources
23-
from opentelemetry.semconv.trace import SpanAttributes
23+
from opentelemetry.semconv._incubating.attributes.db_attributes import DB_STATEMENT
2424
from opentelemetry.test.test_base import TestBase
2525

2626

@@ -157,7 +157,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled(self):
157157
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'*/;",
158158
)
159159
self.assertEqual(
160-
span.attributes[SpanAttributes.DB_STATEMENT],
160+
span.attributes[DB_STATEMENT],
161161
"Select 1;",
162162
)
163163

@@ -196,7 +196,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled_stmt_enabled(
196196
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'*/;",
197197
)
198198
self.assertEqual(
199-
span.attributes[SpanAttributes.DB_STATEMENT],
199+
span.attributes[DB_STATEMENT],
200200
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'*/;",
201201
)
202202

@@ -239,7 +239,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled_with_options(
239239
f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_threadsafety='123',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",
240240
)
241241
self.assertEqual(
242-
span.attributes[SpanAttributes.DB_STATEMENT],
242+
span.attributes[DB_STATEMENT],
243243
"Select 1;",
244244
)
245245

@@ -274,7 +274,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_not_enabled_default(
274274
spans_list = self.memory_exporter.get_finished_spans()
275275
span = spans_list[0]
276276
self.assertEqual(
277-
span.attributes[SpanAttributes.DB_STATEMENT],
277+
span.attributes[DB_STATEMENT],
278278
"Select 1;",
279279
)
280280

@@ -332,7 +332,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled(
332332
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'*/;",
333333
)
334334
self.assertEqual(
335-
span.attributes[SpanAttributes.DB_STATEMENT],
335+
span.attributes[DB_STATEMENT],
336336
"Select 1;",
337337
)
338338

@@ -373,7 +373,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled_stmt_enabled(
373373
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'*/;",
374374
)
375375
self.assertEqual(
376-
span.attributes[SpanAttributes.DB_STATEMENT],
376+
span.attributes[DB_STATEMENT],
377377
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'*/;",
378378
)
379379

@@ -418,7 +418,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled_with_options(
418418
f"Select 1 /*db_driver='mysql.connector%%3Afoobar',dbapi_threadsafety='123',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",
419419
)
420420
self.assertEqual(
421-
span.attributes[SpanAttributes.DB_STATEMENT],
421+
span.attributes[DB_STATEMENT],
422422
"Select 1;",
423423
)
424424

@@ -453,7 +453,7 @@ def test_instrument_with_dbapi_sqlcomment_not_enabled_default(
453453
spans_list = self.memory_exporter.get_finished_spans()
454454
span = spans_list[0]
455455
self.assertEqual(
456-
span.attributes[SpanAttributes.DB_STATEMENT],
456+
span.attributes[DB_STATEMENT],
457457
"Select 1;",
458458
)
459459

0 commit comments

Comments
 (0)