Skip to content

feat(pg): add returned and affected rows attributes#2410

Open
bdewater-thatch wants to merge 2 commits into
open-telemetry:mainfrom
thatch-health:pg-add-returned-rows
Open

feat(pg): add returned and affected rows attributes#2410
bdewater-thatch wants to merge 2 commits into
open-telemetry:mainfrom
thatch-health:pg-add-returned-rows

Conversation

@bdewater-thatch

@bdewater-thatch bdewater-thatch commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Postgres counterpart of the MySQL Trilogy adapter: #1290

A semconv proposal for affected_rows is open at open-telemetry/semantic-conventions#3094 (and already added for Azure Cosmos specifically). I've added it as a separate commit so it can be dropped if the maintainers prefer to wait for that go through the process, but IMO it's very useful to have. I'm using the AFFECTED_ROWS_COMMANDS array because cmd_tuples always returns an integer, also for commands outside of the proposal's definition, and defaults to 0. An alternative would be to pass through the value from the pg gem unaltered, like Active Record does.

@hannahramadan hannahramadan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recognizing that we are mixing semconv and a bit early on db.response.affected_rows, I'm still good with this given both new attributes are opt-in. I think the opt-in, experimental nature gives us more flexibility and these attributes seem useful for users.

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.

3 participants