Commit ef7c39c
authored
Fix asyncpg spans (#3639)
- Change `span.set_data` to `span.set_attribute`
- Change `start_transaction`s in the tests to `start_span`s
- Stringify `db.params`, `db.paramstyle`, `db.cursor`
- ❗ Change how adding query source works.
Previously, we first let the DB span finish and then looked at its start and end timestamps to figure out if the query was slow enough to attach query data.
With the switch to OTel, we can no longer put stuff on a finished span, meaning the slow query span still has to be alive when adding data to it. So instead of looking at the end timestamp of a finished span, we keep the span alive and instead look at current time at the point when the query is finished.
This means the DB span will be longer than the actual query (since it now includes adding query data).1 parent f9187be commit ef7c39c
File tree
3 files changed
+123
-82
lines changed- sentry_sdk
- integrations
- tests/integrations/asyncpg
3 files changed
+123
-82
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
| |||
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
151 | | - | |
| 150 | + | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
168 | 167 | | |
169 | 168 | | |
170 | 169 | | |
171 | | - | |
| 170 | + | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
175 | | - | |
176 | | - | |
| 174 | + | |
| 175 | + | |
177 | 176 | | |
178 | 177 | | |
179 | | - | |
180 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
183 | 197 | | |
184 | | - | |
| 198 | + | |
185 | 199 | | |
| 200 | + | |
186 | 201 | | |
187 | 202 | | |
188 | 203 | | |
| |||
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
194 | | - | |
| 209 | + | |
195 | 210 | | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
199 | | - | |
200 | | - | |
| 214 | + | |
| 215 | + | |
201 | 216 | | |
202 | 217 | | |
203 | 218 | | |
204 | 219 | | |
205 | 220 | | |
206 | | - | |
| 221 | + | |
207 | 222 | | |
208 | 223 | | |
209 | 224 | | |
210 | | - | |
| 225 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
| |||
0 commit comments