Skip to content

Conversation

@aryamohanan
Copy link
Contributor

Which problem is this PR solving?

Fixes #3193

When using prepared statements with the following syntax, query parameter values were not captured even when enhancedDatabaseReporting: true was enabled:

client.query(
  { name: 'statement_name', text: 'SELECT * FROM pg_tables WHERE schemaname = $1' },
  ['public']
);

Short description of the changes

  • Fixed missing parameter values when executing prepared statements.
  • Updated instrumentation to correctly read values from the second argument (args[1]) when the first argument is a query config object.
  • Ensured that db.postgresql.values is only recorded when enhancedDatabaseReporting:true.
  • Maintained query text sanitization, placeholders ($1, $2, etc.) remain in db.statement.

@github-actions github-actions bot requested a review from maryliag October 27, 2025 18:14
@aryamohanan aryamohanan marked this pull request as ready for review October 28, 2025 08:17
@aryamohanan aryamohanan requested a review from a team as a code owner October 28, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query values not captured when passed as second argument (prepared statements)

2 participants