Repository navigation
Commit f33fc83
authored
fix(app): count legacy STATUS_CODE_ERROR spans as errors (#3181)
## Summary
The service dashboard and the LLM expressions each spelled out their own "is this an error" predicate as `lower(<status>) = 'error'`. Both are fed `source.statusCodeExpression` for trace sources (`serviceDashboard.ts:164`, `llm/lib/expressions.ts:443`), so a collector that writes the long OTel form, `STATUS_CODE_ERROR`, fell outside the predicate and those spans went uncounted. Error rate and error counts on the Services and LLM dashboards undercounted as a result.
This pulls the definition into one exported helper, `errorStatusPredicateSql` in `source.ts`, and matches both the short `Error` form and the long `STATUS_CODE_ERROR` one.
The helper is span-status only. Log severity text is a different vocabulary: the long status value can never appear in it, and the values severity text does use for errors (`fatal`, `crit` and friends) are a different set again. So the log call site (`expressions.ts:487`) keeps a predicate of its own, unchanged from before this branch, rather than borrowing the span-status one.
A single definition for span status also means the next place that needs it does not add another spelling.
## Test plan
- Updated the existing expectations in `expressions.test.ts` and `serviceDashboard.test.ts` to the widened predicate; both suites pass. Both of those assertions cover trace sources, which is the path that changes.
- Full app suite green (246 files, 4035 tests), plus `tsc --noEmit` and `eslint` with no new warnings.
No UI or layout change: this only widens which spans an existing query counts as errors. [ui-check: allow]
## Notes
- Adds a `patch` changeset.
- Two other places still carry their own error-status spelling: the service map (`useServiceMap.tsx:178`, `ServiceMapTooltip.tsx:81`) and the client-side check in `DBTraceWaterfallChart.tsx`. Both are outside this PR's files, and the waterfall one needs a JS-side predicate rather than SQL, so they are tracked in #3203 instead of widening this change.1 parent 2767b5c commit f33fc83
6 files changed
Lines changed: 38 additions & 6 deletions
File tree
- .changeset
- packages/app/src
- __tests__
- llm
- __tests__
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
277 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
455 | | - | |
| 457 | + | |
456 | 458 | | |
457 | 459 | | |
458 | 460 | | |
| |||
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
485 | 493 | | |
486 | 494 | | |
487 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
532 | 546 | | |
533 | 547 | | |
534 | 548 | | |
| |||
0 commit comments