Adding an error to a sub/segment, forces a fault flag.
- Dominant language
- JavaScript
- Stars
- 280
- Forks
- 157
- PR merge metrics
- No merged PRs in 30d
Description
**Details**
`this.addFaultFlag();`
https://github.com/aws/aws-xray-sdk-node/blob/b8996144eb28293c436667e9cee9320938e8e5da/packages/core/lib/segments/segment.js#L228-L234
[AWS X-ray concepts regarding error categorization](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-errors)
> X-Ray tracks errors that occur in your application code, and errors that are returned by downstream services. Errors are categorized as follows.
>
> Error – Client errors (400 series errors)
> Fault – Server faults (500 series errors)
> Throttle – Throttling errors (429 Too Many Requests)
**Issue**
if `addError` refers directly to client errors then it is a bit confusing that it flags it as a "Fault" and not an "Error" flag.
If `addError` is more of an abstract method for all **x-ray error types**, then I don't have the option to specifiy which kind of **x-ray error** it is per the categorizations above. And I'm forced to have it flagged as a "Fault".
Contributor guide
Research direction
Start with packages/core/lib/segments/segment.js at lines 228-234 and compare the behavior with the linked AWS X-Ray error-categorization documentation. Resolve whether addError represents client errors only or needs to select among X-Ray error types; done means the intended categorization and caller-facing behavior are explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, observability-sre
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100