Repository navigation
fix: count legacy STATUS_CODE_ERROR spans as errors - #3527
Conversation
Service map counts and the trace waterfall only matched the short status Error, so collectors that still write STATUS_CODE_ERROR showed no errors.
|
@Tyagiquamar is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 483540a The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| }); | ||
| } | ||
| return row.StatusCode === 'Error' ? 'error' : undefined; | ||
| return isErrorStatusCode(row.StatusCode) ? 'error' : undefined; |
There was a problem hiding this comment.
🔵 minor — Waterfall legacy-status fix has no component test
The waterfall's error count and row highlight now depend on isErrorStatusCode, but DBTraceWaterfallChart.test.tsx has no fixture with StatusCode: 'STATUS_CODE_ERROR'. A regression back to === 'Error' in getRowSeverity would still pass. Add a waterfall test with a legacy-status span and assert that the error count includes it and the row is marked as an error.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
3 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 2 minor 1 posted as inline comment(s) on the changed lines. 2 listed below. Findings outside the changed lines
1 minor
Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
Deep ReviewScope: ✅ No critical issues found. The change is strictly additive — the new SQL predicate matches a superset of the old 🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (5): correctness, testing, maintainability, kieran-typescript, performance. Testing gaps: No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
|
LGTM Thanks! |
Summary
Service map error counts, the error drill-down, and the trace waterfall now treat legacy
STATUS_CODE_ERRORspan statuses the same way the services dashboard already does. Collectors that still write that value no longer show a service or trace as error-free.Root cause
errorStatusPredicateSqlalready matches bothErrorandSTATUS_CODE_ERROR. The service map still counted onlyServerSpans.statusCode = 'Error', and its error drill-down used the same exact match. The waterfall'sgetRowSeverityreturned an error only whenStatusCode === 'Error'. On a deployment whose collector writesSTATUS_CODE_ERROR, those surfaces reported zero errors while the services dashboard did not.Fixes #3203.
Fix
The SQL predicate and a new
isErrorStatusCodehelper share one list:errorandstatus_code_error, compared case-insensitively. The service map count and the error drill-down use the SQL predicate. The waterfall uses the helper for the error count and the row highlight. Log severity is unchanged.Test plan
jest --testPathPatterns spanPredicatesfailed 5 cases (ERROR,error,STATUS_CODE_ERROR,status_code_error,Status_Code_Errorexpected true, received false) whenisErrorStatusCodewas an exact=== 'Error'check.packages/common-utils:node ..\..\.yarn\releases\yarn-4.13.0.cjs exec jest --coverage=false --testPathPatterns spanPredicatespassed, 17 tests.node .yarn/releases/yarn-4.13.0.cjs workspace @hyperdx/app exec jest --coverage=false --testPathPatterns "useServiceMap.test|ServiceMap/__tests__/utils.test"passed, 86 tests.node .yarn/releases/yarn-4.13.0.cjs workspace @hyperdx/common-utils buildsucceeded.eslint --flag v10_config_lookup_from_file --quieton the touched files exited 0. Prettier was run on those files.How to reproduce
Starting point: a trace source whose status column contains
STATUS_CODE_ERROR(legacy collector) as well asError. The public demo dataset does not store that legacy value, so the unit tests above are the reliable reproduction.On
main:STATUS_CODE_ERRORshow 0.00% errors.STATUS_CODE_ERRORspan. The waterfall does not mark that span as an error, and the header error count skips it.On this branch:
lower(StatusCode) IN ('error', 'status_code_error').Screenshots or video
No screenshots. The change is the status match used for counts and highlighting, not layout. Reproducing the visible difference needs rows stored as
STATUS_CODE_ERROR, which play.hyperdx.io does not provide.How to test on Vercel preview
N/A. This is not a layout change. The corrected counts show up only when the selected trace source stores
STATUS_CODE_ERROR.References