Skip to content
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

Deprecate exception.escaped attribute, update exception example #4368

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Jan 16, 2025

This is follow up on open-telemetry/semantic-conventions#1716 - cross signal guidance on how to record errors (and exceptions) in instrumentations.

Changes

Follow up for open-telemetry/semantic-conventions#1716

exception.escaped attribute is not used in practice within OTel instrumentations (checked Java, .NET, JS. Python, Go, C++ and Rust including contrib repos).
OTel instrumentations, in general, don't record handled exceptions, i.e. virtually all exceptions we're recording in non-native instrumentations are expected to escape span scope.

The litmus test whether to record exception on spans is whether the instrumentation is going to set span status to ERROR due to this exception.

A way to record all sorts of exceptions is being introduced in #4333 and leverages logs along with severity that conveys how critical the exception is in more expressive way than exception.escaped flag.

@lmolkova lmolkova force-pushed the deprecate-exception-escaped branch from 847e1a0 to 413eed9 Compare January 28, 2025 04:47
@lmolkova lmolkova changed the title [WIP] Deprecate exception.escaped attribute, update exception example Deprecate exception.escaped attribute, update exception example Jan 28, 2025
@lmolkova lmolkova marked this pull request as ready for review January 28, 2025 04:50
@lmolkova lmolkova requested review from a team as code owners January 28, 2025 04:50
specification/trace/exceptions.md Outdated Show resolved Hide resolved
specification/trace/exceptions.md Outdated Show resolved Hide resolved
@lmolkova lmolkova force-pushed the deprecate-exception-escaped branch from b8d5071 to 2169716 Compare January 28, 2025 16:12
@carlosalberto
Copy link
Contributor

Overall LGTM, but we should add this note from the semconv repo:

It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.

Mostly because the example seems to imply this, but better be super clear IMHO.

@lmolkova
Copy link
Contributor Author

Overall LGTM, but we should add this note from the semconv repo:

It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.

Mostly because the example seems to imply this, but better be super clear IMHO.

makes sense, @carlosalberto, updated in 0f7d54c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants