Repository navigation
Commit 3aea457
fix(core): Use wall clock for structured log timestamps
Structured logs stamped their timestamp via `timestampInSeconds()`, which
returns `performance.timeOrigin + performance.now()` with no wall-clock
sanity check. On platforms where the Performance API is not anchored to the
UNIX epoch (notably React Native/Hermes, where it tracks device uptime),
this made log timestamps off by a large, constant offset while error events
(which use `Date.now()`) stayed correct.
Switch the log path to `dateTimestampInSeconds()` so log timestamps use the
wall clock and match error-event timestamps on every platform. Sub-second
ordering is preserved via the existing `sentry.timestamp.sequence` attribute.
Scope is limited to the log path; `timestampInSeconds()` and its other
consumers (spans, sessions, breadcrumbs, metrics) are unchanged.
Closes getsentry/sentry-react-native#6510
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b5bf632 commit 3aea457
2 files changed
Lines changed: 35 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
46 | 70 | | |
47 | 71 | | |
48 | 72 | | |
| |||
1186 | 1210 | | |
1187 | 1211 | | |
1188 | 1212 | | |
1189 | | - | |
| 1213 | + | |
1190 | 1214 | | |
1191 | 1215 | | |
1192 | 1216 | | |
| |||
1206 | 1230 | | |
1207 | 1231 | | |
1208 | 1232 | | |
1209 | | - | |
| 1233 | + | |
1210 | 1234 | | |
1211 | 1235 | | |
1212 | 1236 | | |
| |||
1233 | 1257 | | |
1234 | 1258 | | |
1235 | 1259 | | |
1236 | | - | |
| 1260 | + | |
1237 | 1261 | | |
1238 | 1262 | | |
1239 | 1263 | | |
| |||
0 commit comments