feat(pg): add returned and affected rows attributes#2410
Open
bdewater-thatch wants to merge 2 commits into
Open
feat(pg): add returned and affected rows attributes#2410bdewater-thatch wants to merge 2 commits into
bdewater-thatch wants to merge 2 commits into
Conversation
hannahramadan
approved these changes
Jun 30, 2026
hannahramadan
left a comment
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_COMMANDSarray 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 thepggem unaltered, like Active Record does.