Skip to content

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

@DavidRigglemanININ

Description

@DavidRigglemanININ

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

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions