Fix span name for aiopg

This commit is contained in:
Srikanth Chekuri
2020-11-18 01:33:01 +05:30
parent a3841304fa
commit 57fdce52d2

View File

@ -101,9 +101,16 @@ class AsyncTracedCursor(TracedCursor):
*args: typing.Tuple[typing.Any, typing.Any],
**kwargs: typing.Dict[typing.Any, typing.Any]
):
name = ""
if len(args) > 0 and args[0]:
name = args[0]
elif self._db_api_integration.database:
name = self._db_api_integration.database
else:
name = self._db_api_integration.name
with self._db_api_integration.get_tracer().start_as_current_span(
self._db_api_integration.name, kind=SpanKind.CLIENT
name, kind=SpanKind.CLIENT
) as span:
self._populate_span(span, *args)
try: