Skip to content

Commit 0a3f207

Browse files
author
Yuri Lobanoff
committed
asyncpg: Use only the first word from query as a span name
1 parent b00701d commit 0a3f207

File tree

1 file changed

+1
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg

1 file changed

+1
-0
lines changed

instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ async def _do_execute(self, func, instance, args, kwargs):
133133
exception = None
134134
params = getattr(instance, "_params", {})
135135
name = args[0] if args[0] else params.get("database", "postgresql")
136+
name = name.split()[0]
136137

137138
with self._tracer.start_as_current_span(
138139
name, kind=SpanKind.CLIENT

0 commit comments

Comments
 (0)