Skip to content

Conversation

THardy98
Copy link
Contributor

What was changed

DWISOTT

Why?

We don't want benign exceptions to alert failures

  1. Closes [Feature Request] Reclassify Benign Application errors in OpenTelemetry #1776

  2. How was this tested:
    Integration test

  3. Any docs updates needed?
    Don't think so

@THardy98 THardy98 requested a review from a team as a code owner September 19, 2025 05:09
"test": "ava ./lib/test-*.js",
"test.watch": "ava --watch ./lib/test-*.js"
"test.watch": "ava --watch ./lib/test-*.js",
"test-otel": "ava ./lib/test-otel.js"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does otel seem important enough to have this separately, or was this a during development thing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does otel seem important enough to have this separately,

No. I'd prefer we don't add such things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

development thing - i'll remove

if (acceptableErrors === undefined || !acceptableErrors(err)) {
span.setStatus({ code: otel.SpanStatusCode.ERROR, message: err instanceof Error ? err.message : String(err) });
const statusCode = isBenignErr ? otel.SpanStatusCode.UNSET : otel.SpanStatusCode.ERROR;
span.setStatus({ code: statusCode, message: err instanceof Error ? err.message : String(err) });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being an Error is neither necessary nor sufficient to deduce that message will be present. Prefer this instead:

Suggested change
span.setStatus({ code: statusCode, message: err instanceof Error ? err.message : String(err) });
span.setStatus({ code: statusCode, message: (err as Error).message ?? String(err) });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@THardy98
Copy link
Contributor Author

merging - ci failing on unrelated failures

@THardy98 THardy98 merged commit d106a84 into main Sep 22, 2025
55 of 63 checks passed
@THardy98 THardy98 deleted the otel_benign_exceptions branch September 22, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Reclassify Benign Application errors in OpenTelemetry
3 participants