-
Notifications
You must be signed in to change notification settings - Fork 136
Don't set error status on otel spans for benign exceptions #1786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
packages/test/package.json
Outdated
"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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) }); |
There was a problem hiding this comment.
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:
span.setStatus({ code: statusCode, message: err instanceof Error ? err.message : String(err) }); | |
span.setStatus({ code: statusCode, message: (err as Error).message ?? String(err) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
merging - ci failing on unrelated failures |
What was changed
DWISOTT
Why?
We don't want benign exceptions to alert failures
Closes [Feature Request] Reclassify Benign Application errors in OpenTelemetry #1776
How was this tested:
Integration test
Any docs updates needed?
Don't think so