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
| <aid="exception-escaped"href="#exception-escaped">`exception.escaped`</a> | boolean | SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. [1]|||
16
18
| <aid="exception-message"href="#exception-message">`exception.message`</a> | string | The exception message. |`Division by zero`; `Can't convert 'int' object to str implicitly`||
17
19
| <aid="exception-stacktrace"href="#exception-stacktrace">`exception.stacktrace`</a> | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. |`Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)`||
18
20
| <aid="exception-type"href="#exception-type">`exception.type`</a> | string | The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. |`java.net.ConnectException`; `OSError`||
19
21
20
-
**[1]`exception.escaped`:** An exception is considered to have escaped (or left) the scope of a span,
21
-
if that span is ended while the exception is still logically "in flight".
22
-
This may be actually "in flight" in some languages (e.g. if the exception
23
-
is passed to a Context manager's `__exit__` method in Python) but will
24
-
usually be caught at the point of recording the exception in most languages.
25
-
26
-
It is usually not possible to determine at the point where an exception is thrown
27
-
whether it will escape the scope of a span.
28
-
However, it is trivial to know that an exception
29
-
will escape, if one checks for an active exception just before ending the span,
30
-
as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
31
-
32
-
It follows that an exception may still escape the scope of the span
33
-
even if the `exception.escaped` attribute was not set or set to false,
34
-
since the event might have been recorded at a time where it was not
| <aid="exception-escaped"href="#exception-escaped">`exception.escaped`</a> | boolean | Indicates that the exception is escaping the scope of the span. ||<br>It's no longer recommended to record exceptions that are handled and do not escape the scope of a span. |
An exception SHOULD be recorded as an `Event` on the span during which it occurred.
23
-
The name of the event MUST be `"exception"`.
24
-
25
-
A typical template for an auto-instrumentation implementing this semantic convention
26
-
using an [API-provided `recordException` method](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/trace/api.md#record-exception)
27
-
could look like this (pseudo-Java):
28
-
29
-
```java
30
-
Span span = myTracer.startSpan(/*...*/);
31
-
try {
32
-
// Code that does the actual work which the Span represents
@@ -57,30 +30,13 @@ This event describes a single exception.
57
30
|---|---|---|---|---|---|
58
31
|[`exception.message`](/docs/attributes-registry/exception.md)| string | The exception message. |`Division by zero`; `Can't convert 'int' object to str implicitly`|`Conditionally Required`[1]||
59
32
|[`exception.type`](/docs/attributes-registry/exception.md)| string | The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. |`java.net.ConnectException`; `OSError`|`Conditionally Required`[2]||
60
-
|[`exception.escaped`](/docs/attributes-registry/exception.md)| boolean |SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. [3]||`Recommended`||
33
+
|[`exception.escaped`](/docs/attributes-registry/exception.md)| boolean |Indicates that the exception is escaping the scope of the span. ||`Recommended`|<br>It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.|
61
34
|[`exception.stacktrace`](/docs/attributes-registry/exception.md)| string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. |`Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)`|`Recommended`||
62
35
63
36
**[1]`exception.message`:** Required if `exception.type` is not set, recommended otherwise.
64
37
65
38
**[2]`exception.type`:** Required if `exception.message` is not set, recommended otherwise.
66
39
67
-
**[3]`exception.escaped`:** An exception is considered to have escaped (or left) the scope of a span,
68
-
if that span is ended while the exception is still logically "in flight".
69
-
This may be actually "in flight" in some languages (e.g. if the exception
70
-
is passed to a Context manager's `__exit__` method in Python) but will
71
-
usually be caught at the point of recording the exception in most languages.
72
-
73
-
It is usually not possible to determine at the point where an exception is thrown
74
-
whether it will escape the scope of a span.
75
-
However, it is trivial to know that an exception
76
-
will escape, if one checks for an active exception just before ending the span,
77
-
as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
78
-
79
-
It follows that an exception may still escape the scope of the span
80
-
even if the `exception.escaped` attribute was not set or set to false,
81
-
since the event might have been recorded at a time where it was not
Copy file name to clipboardExpand all lines: model/exceptions/registry.yaml
-23Lines changed: 0 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -31,26 +31,3 @@ groups:
31
31
at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n
32
32
at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n
33
33
at com.example.GenerateTrace.main(GenerateTrace.java:5)
34
-
- id: exception.escaped
35
-
type: boolean
36
-
stability: stable
37
-
brief: >
38
-
SHOULD be set to true if the exception event is recorded at a point where
39
-
it is known that the exception is escaping the scope of the span.
40
-
note: |-
41
-
An exception is considered to have escaped (or left) the scope of a span,
42
-
if that span is ended while the exception is still logically "in flight".
43
-
This may be actually "in flight" in some languages (e.g. if the exception
44
-
is passed to a Context manager's `__exit__` method in Python) but will
45
-
usually be caught at the point of recording the exception in most languages.
46
-
47
-
It is usually not possible to determine at the point where an exception is thrown
48
-
whether it will escape the scope of a span.
49
-
However, it is trivial to know that an exception
50
-
will escape, if one checks for an active exception just before ending the span,
51
-
as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
52
-
53
-
It follows that an exception may still escape the scope of the span
54
-
even if the `exception.escaped` attribute was not set or set to false,
55
-
since the event might have been recorded at a time where it was not
0 commit comments