Repository navigation
Commit d5ae601
fix(effect): Convert Effect span times to the Sentry clock (#24972)
Effect spans used Effect's own clock (a fixed origin plus a monotonic
clock) for their start, end and event times. #23054 makes Sentry correct
its clock for drift (e.g. after the device slept), so Effect spans could
end up shifted by the drift relative to the Sentry spans around them.
With this PR, an Effect span now starts on Sentry's clock, and its end
and event times are converted by their offset from the span's start.
This is the same per-span offset that OpenTelemetry's SDK uses. We also
do this for our spans now, see #24903 for details.
The PR keeps Effect's durations and any end time passed explicitly via
`span.end(time, exit)`. With `withTracerTiming(false)`, Effect passes
`0`, and we now use Sentry's clock instead of setting 1970 timestamps.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 164794b commit d5ae601
2 files changed
Lines changed: 63 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 67 | | |
75 | 68 | | |
76 | 69 | | |
| |||
127 | 120 | | |
128 | 121 | | |
129 | 122 | | |
| 123 | + | |
130 | 124 | | |
131 | 125 | | |
132 | 126 | | |
| |||
136 | 130 | | |
137 | 131 | | |
138 | 132 | | |
| 133 | + | |
139 | 134 | | |
140 | 135 | | |
141 | 136 | | |
| |||
144 | 139 | | |
145 | 140 | | |
146 | 141 | | |
| 142 | + | |
147 | 143 | | |
148 | 144 | | |
149 | 145 | | |
| |||
187 | 183 | | |
188 | 184 | | |
189 | 185 | | |
190 | | - | |
| 186 | + | |
191 | 187 | | |
192 | 188 | | |
193 | 189 | | |
194 | 190 | | |
195 | 191 | | |
196 | 192 | | |
197 | 193 | | |
198 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
381 | 393 | | |
382 | 394 | | |
383 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
384 | 399 | | |
385 | 400 | | |
386 | 401 | | |
387 | 402 | | |
388 | | - | |
| 403 | + | |
389 | 404 | | |
390 | 405 | | |
391 | 406 | | |
| |||
397 | 412 | | |
398 | 413 | | |
399 | 414 | | |
400 | | - | |
| 415 | + | |
401 | 416 | | |
402 | 417 | | |
403 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
200 | 235 | | |
201 | 236 | | |
202 | 237 | | |
| |||
0 commit comments