Describe your environment
OS: macos 26
Python version: Python 3.12
Package version: 0.62b1
What happened?
opentelemetry-instrumentation-asyncpg patches Connection.execute(),
Connection.fetch(), Connection.fetchrow(), and Connection.fetchval().
It does not patch the equivalent methods on PreparedStatement
(PreparedStatement.execute(), .fetch(), .fetchrow(), .fetchval(),
.executemany()).
Any query that is executed through a PreparedStatement object is completely
invisible to the instrumentation - no span is emitted.
Steps to Reproduce
Use prepared statements, either directly or simply by using SQLAlchemy.
Here is a repository with MRE:
https://github.com/aleksul/asyncpg-opentelemetry-prepared-statments-mre
Expected Result
Expected that spans are emitted for prepared statements, similarly to how they are emitted for regular executions.
Actual Result
Spans are not emitted for prepared statements.
Additional context
No response
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe your environment
OS: macos 26
Python version: Python 3.12
Package version: 0.62b1
What happened?
opentelemetry-instrumentation-asyncpgpatchesConnection.execute(),Connection.fetch(),Connection.fetchrow(), andConnection.fetchval().It does not patch the equivalent methods on
PreparedStatement(
PreparedStatement.execute(),.fetch(),.fetchrow(),.fetchval(),.executemany()).Any query that is executed through a
PreparedStatementobject is completelyinvisible to the instrumentation - no span is emitted.
Steps to Reproduce
Use prepared statements, either directly or simply by using SQLAlchemy.
Here is a repository with MRE:
https://github.com/aleksul/asyncpg-opentelemetry-prepared-statments-mre
Expected Result
Expected that spans are emitted for prepared statements, similarly to how they are emitted for regular executions.
Actual Result
Spans are not emitted for prepared statements.
Additional context
No response
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.