Commit a9e9ecf
feat(posthog): correlate task events with copilot logs via request_id (#4453)
* feat(posthog): correlate task events with Go logs via request_id
Auto-injects server request_id into all PostHog server events from
AsyncLocalStorage context. Adds task_request_started client event fired
when SSE traceparent response header arrives, carrying the trace ID used
by Go for log correlation. task_generation_aborted now includes the
in-flight request_id when available.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* improvement(posthog): tighten trace ID parse and verbose comments
* fix(posthog): use traceparent header as canonical request_id source
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6bc34c5 commit a9e9ecf
5 files changed
Lines changed: 58 additions & 4 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]
- home
- hooks
- w/[workflowId]/components/panel
- lib/posthog
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
| |||
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
| 210 | + | |
201 | 211 | | |
202 | 212 | | |
203 | 213 | | |
| |||
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
1278 | 1279 | | |
1279 | 1280 | | |
1280 | 1281 | | |
| 1282 | + | |
| 1283 | + | |
1281 | 1284 | | |
1282 | 1285 | | |
1283 | 1286 | | |
| |||
1293 | 1296 | | |
1294 | 1297 | | |
1295 | 1298 | | |
1296 | | - | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1297 | 1303 | | |
1298 | 1304 | | |
1299 | 1305 | | |
| |||
1305 | 1311 | | |
1306 | 1312 | | |
1307 | 1313 | | |
1308 | | - | |
| 1314 | + | |
1309 | 1315 | | |
1310 | 1316 | | |
1311 | 1317 | | |
| |||
1351 | 1357 | | |
1352 | 1358 | | |
1353 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1354 | 1367 | | |
1355 | 1368 | | |
1356 | 1369 | | |
| |||
4209 | 4222 | | |
4210 | 4223 | | |
4211 | 4224 | | |
| 4225 | + | |
| 4226 | + | |
| 4227 | + | |
| 4228 | + | |
| 4229 | + | |
| 4230 | + | |
| 4231 | + | |
| 4232 | + | |
4212 | 4233 | | |
4213 | 4234 | | |
4214 | 4235 | | |
| |||
5103 | 5124 | | |
5104 | 5125 | | |
5105 | 5126 | | |
| 5127 | + | |
5106 | 5128 | | |
5107 | 5129 | | |
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
| |||
413 | 422 | | |
414 | 423 | | |
415 | 424 | | |
| 425 | + | |
416 | 426 | | |
417 | 427 | | |
418 | | - | |
| 428 | + | |
419 | 429 | | |
420 | 430 | | |
421 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
| |||
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
430 | 439 | | |
431 | 440 | | |
432 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
0 commit comments