Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4368](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4368))
- `opentelemetry-instrumentation-celery`: Coerce timelimit values to strings in `set_attributes_from_context()` to prevent mixed-type span attribute warning
([#4361](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4361))
- `opentelemetry-instrumentation-mysqlclient`: Update unit tests to properly validate trace context trace flag values.
([#4560](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4560))

### Breaking changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled(self):
span = spans_list[0]
span_id = format(span.get_span_context().span_id, "016x")
trace_id = format(span.get_span_context().trace_id, "032x")
trace_flags = format(span.get_span_context().trace_flags, "02x")
self.assertEqual(
mock_cursor.execute.call_args[0][0],
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-{trace_flags}'*/;",
)
self.assertEqual(
span.attributes[DB_STATEMENT],
Expand Down Expand Up @@ -194,7 +195,7 @@ def test_instrument_connection_with_dbapi_sqlcomment_enabled_stmt_enabled(
)
self.assertEqual(
span.attributes[DB_STATEMENT],
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-{trace_flags}'*/;",
)

def test_instrument_connection_with_dbapi_sqlcomment_enabled_with_options(
Expand Down Expand Up @@ -391,7 +392,7 @@ def test_instrument_with_dbapi_sqlcomment_enabled_stmt_enabled(
)
self.assertEqual(
span.attributes[DB_STATEMENT],
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-01'*/;",
f"Select 1 /*db_driver='MySQLdb%%3Afoobar',dbapi_level='123',dbapi_threadsafety='123',driver_paramstyle='test',mysql_client_version='foobaz',traceparent='00-{trace_id}-{span_id}-{trace_flags}'*/;",
)

def test_instrument_with_dbapi_sqlcomment_enabled_with_options(
Expand Down
Loading