diff --git a/ext/opentelemetry-ext-docker-tests/tests/asyncpg/test_asyncpg_functional.py b/ext/opentelemetry-ext-docker-tests/tests/asyncpg/test_asyncpg_functional.py index 75abdd71d11..0e8ef571516 100644 --- a/ext/opentelemetry-ext-docker-tests/tests/asyncpg/test_asyncpg_functional.py +++ b/ext/opentelemetry-ext-docker-tests/tests/asyncpg/test_asyncpg_functional.py @@ -171,6 +171,28 @@ async def _transaction_execute(): StatusCanonicalCode.OK, spans[2].status.canonical_code ) + @pytest.mark.asyncpg + def test_instrumented_method_doesnt_capture_parameters(self, *_, **__): + _await(self._connection.execute("SELECT $1;", "1")) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + self.assertEqual( + StatusCanonicalCode.OK, spans[0].status.canonical_code + ) + self.assertEqual( + spans[0].attributes, + { + "db.type": "sql", + "db.user": POSTGRES_USER, + # This shouldn't be set because we don't capture parameters by + # default + # + # "db.statement.parameters": "('1',)", + "db.instance": POSTGRES_DB_NAME, + "db.statement": "SELECT $1;", + }, + ) +