You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
do nothing if the exception is handled by the instrumented library (retries, etc)
for unhandled (by client lib) exceptions:
set span status to error
set span status description to exception message
set error.type attribute on spans/metrics based on the exception type or more specific low-cardinality error code
DO NOT record exception event (by default) unless recording local root span or when the instrumentation knows that user code didn't handle the exception. Reason: exceptions are huge and expensive. Users decide if/how to record them when they catch them. If exception stays unhandled, the server instrumentation will record it.
We should document it and link from DB/messaging/gen-ai and other conventions.
The text was updated successfully, but these errors were encountered:
Another aspect of this to consider is whether information should be captured from the outermost exception or innermost in the case of nested exceptions.
In capturing error.type and span status description, my intuition is that the innermost exception type/message is the most useful because it most closely describes the root of the problem.
On the other hand, when a user opts in to recording exception events, my intuition is that the outermost exception may be the most useful because the stack trace captured usually contains information from all nested exceptions.
Interestingly, the DB semantic conventions seems to suggest capturing details from the innermost exception:
[9]: The error.type SHOULD match the db.response.status_code returned by the database or the client library, or the canonical name of exception that occurred. When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. Instrumentations SHOULD document how error.type is populated.
The HTTP semantic conventions seem less opinionated and does not have a similar statement.
DO NOT record exception event (by default) unless recording SERVER/CONSUMER span when the instrumentation knows that user code didn't handle the exception.
a slight variation on this is to replace SERVER/CONSUMER span above with "local root" span
The common approach seems to be:
error.type
attribute on spans/metrics based on the exception type or more specific low-cardinality error codeWe should document it and link from DB/messaging/gen-ai and other conventions.
The text was updated successfully, but these errors were encountered: