aws / aws/aws-sdk-java-v2

Add way to prevent expected exceptions from being recorded as errors in open telemetry spans

Open
#6,995 9 comments 1 reaction 1 assignee Claimed by @debora-ito View on GitHub
feature-request
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

### Describe the feature

Currently, if there is an an error like a conditional check failure (400), this appears to get recorded with span.setStatus(Status.ERROR) and it's very challenging to try to undo that. This causes us a bunch of error spam that we would love to eliminate because these are errors that are expected and not unexpected ones. I completely understand not wanting this behavior to be the default, but just some optional config to allow us to provide a list of exception classes to ignore from setting the span to an error status would be great. Or an override callback to return a desired status based on some parameters would also be acceptable

### Use Case

Working with open telemetry and avoiding unnecessary error noise

### Proposed Solution

At a simplest level, just allowing us to specify a list of error classes (or even fully qualified class names) would be all that is needed. I could imagine more complicated and flexible solutions that involve callbacks, but those wouldn't be strictly necessary for us.

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS Java SDK version used

2.42.38

### JDK version used

21.0.10

### Operating System and version

MacOS 26.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.