Commit be86418
committed
Add row count and affected rows to Trilogy spans
Identifying queries that return/update many rows is very useful for
improving database performance. Queries that return many rows can cause
applications to use excess memory (or in some cases like Vitess) could
be blocked altogether. Queries that update many rows can cause
replication lag and generally put more pressure on a database.
This commit adds both of these values (row_count and affected_rows) to
spans created from Trilogy#query to help identify these problematic
queries. Trilogy::Result#count will always return a value (0 for
mutations), but #affected_rows only returns values for mutations (nil
for SELECTs).1 parent 45d0a54 commit be86418
File tree
2 files changed
+13
-2
lines changed- instrumentation/trilogy
- lib/opentelemetry/instrumentation/trilogy/patches
- test/opentelemetry/instrumentation/trilogy
2 files changed
+13
-2
lines changedLines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| |||
0 commit comments