mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-01 09:13:23 +08:00
Update instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py
Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
This commit is contained in:
@ -118,14 +118,8 @@ class AsyncPGInstrumentor(BaseInstrumentor):
|
||||
tracer = getattr(asyncpg, _APPLIED)
|
||||
|
||||
exception = None
|
||||
params = getattr(instance, "_params", None)
|
||||
name = ""
|
||||
if args[0]:
|
||||
name = args[0]
|
||||
elif params and params.get("database"):
|
||||
name = params.get("database")
|
||||
else:
|
||||
name = "postgresql" # Does it ever happen?
|
||||
params = getattr(instance, "_params", {})
|
||||
name = args[0] if args[0] else params.get("database", "postgresql")
|
||||
|
||||
with tracer.start_as_current_span(name, kind=SpanKind.CLIENT) as span:
|
||||
if span.is_recording():
|
||||
|
Reference in New Issue
Block a user