Skip to content

Commit

Permalink
asyncpg: Use only the first word from query as a span name
Browse files Browse the repository at this point in the history
  • Loading branch information
krnr committed Sep 11, 2022
1 parent b00701d commit 7b3b244
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1208](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1208))
- `opentelemetry-instrumentation-aiohttp-client` Fix producing additional spans with each newly created ClientSession
- ([#1246](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1246))
- `opentelemetry-instrumentation-asyncpg` Fix high cardinality in the span name
- ([#1170](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1324))

## [1.12.0-0.33b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0-0.33b0) - 2022-08-08

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ async def _do_execute(self, func, instance, args, kwargs):
exception = None
params = getattr(instance, "_params", {})
name = args[0] if args[0] else params.get("database", "postgresql")
name = name.split()[0]

with self._tracer.start_as_current_span(
name, kind=SpanKind.CLIENT
Expand Down

0 comments on commit 7b3b244

Please sign in to comment.