feat: Record db.client.response.affected_rows histogram - #33
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #33 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 12 12
Lines 2164 2182 +18
=======================================
+ Hits 2163 2181 +18
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Mirror the existing `db.response.affected_rows` span attribute as a metric so dashboards can slice mutation throughput by the same dimensions they already use for duration / returned_rows. Recorded on `execute()` calls – the path where `QueryResult::rows_affected()` is meaningful – with the same connection / annotation / error attribute set as the duration histogram. Not recorded for `execute_many` (deprecated upstream). The metric is custom (no OTel semconv equivalent); the name `db.client.response.affected_rows` follows the `db.client.response.returned_rows` naming pattern.
chmodas
force-pushed
the
affected-rows-histogram
branch
from
May 4, 2026 16:23
b08c025 to
968dc69
Compare
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.
Mirror the existing
db.response.affected_rowsspan attribute as a metric so dashboards can slice mutation throughput by the same dimensions they already use for duration / returned_rows. Recorded onexecute()calls – the path whereQueryResult::rows_affected()is meaningful – with the same connection / annotation / error attribute set as the duration histogram. Not recorded forexecute_many(deprecated upstream). The metric is custom (no OTel semconv equivalent); the namedb.client.response.affected_rowsfollows thedb.client.response.returned_rowsnaming pattern.