Fix span name for aiopg
This commit is contained in:
parent
a3841304fa
commit
57fdce52d2
|
|
@ -101,9 +101,16 @@ class AsyncTracedCursor(TracedCursor):
|
||||||
*args: typing.Tuple[typing.Any, typing.Any],
|
*args: typing.Tuple[typing.Any, typing.Any],
|
||||||
**kwargs: typing.Dict[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(
|
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:
|
) as span:
|
||||||
self._populate_span(span, *args)
|
self._populate_span(span, *args)
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue