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. |
Copy file name to clipboardExpand all lines: docs/cli/cli-spans.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ Span kind SHOULD be `INTERNAL` when the traced program is the callee or `CLIENT`
13
13
The span name SHOULD be set to `{process.executable.name}`.
14
14
Instrumentations that have additional context about executed commands MAY use a different low-cardinality span name format and SHOULD document it.
15
15
16
-
Span status SHOULD be set to `Error` if `{process.exit.code}` is not 0.
16
+
Span status SHOULD be set to `Error` if `{process.exit.code}` is not 0. Refer to the [Recording Errors](/docs/general/recording-errors.md) document for
Copy file name to clipboardExpand all lines: docs/database/cassandra.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,8 +69,7 @@ system specific term if more applicable.
69
69
70
70
**[5]`db.operation.name`:** If readily available and if there is a single operation name that describes the database call. The operation name MAY be parsed from the query text, in which case it SHOULD be the single operation name found in the query.
71
71
72
-
**[6]`db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
73
-
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
72
+
**[6]`db.response.status_code`:** All Cassandra protocol error codes SHOULD be considered errors.
74
73
75
74
**[7]`db.response.status_code`:** If the operation failed and status code is available.
Copy file name to clipboardExpand all lines: docs/database/cosmosdb.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,8 +193,7 @@ additional values when introducing new operations.
193
193
194
194
**[5]`db.operation.name`:** If readily available and if there is a single operation name that describes the database call. The operation name MAY be parsed from the query text, in which case it SHOULD be the single operation name found in the query.
195
195
196
-
**[6]`db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
197
-
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
196
+
**[6]`db.response.status_code`:** Response codes in the 4xx and 5xx range SHOULD be considered errors.
198
197
199
198
**[7]`error.type`:** 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.
200
199
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.
Copy file name to clipboardExpand all lines: docs/database/couchdb.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,15 @@ The Semantic Conventions for [CouchDB](https://couchdb.apache.org/) extend and o
23
23
|---|---|---|---|---|---|
24
24
|[`db.namespace`](/docs/attributes-registry/db.md)| string | The name of the database, fully qualified within the server address and port. |`customers`; `test.users`|`Conditionally Required` If available. ||
25
25
|[`db.operation.name`](/docs/attributes-registry/db.md)| string | The HTTP method + the target REST route. [1]|`GET /{db}/{docid}`|`Conditionally Required` If readily available. ||
26
-
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string | The HTTP response code returned by the Couch DB. [2]|`200`; `201`; `429`|`Conditionally Required`[3]||
26
+
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string | The HTTP response code returned by the Couch DB recorded as a string. [2]|`200`; `201`; `429`|`Conditionally Required`[3]||
27
27
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [4]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If and only if the operation failed. ||
28
28
|[`server.port`](/docs/attributes-registry/server.md)| int | Server port number. [5]|`80`; `8080`; `443`|`Conditionally Required`[6]||
29
29
|[`db.operation.batch.size`](/docs/attributes-registry/db.md)| int | The number of queries included in a batch operation. [7]|`2`; `3`; `4`|`Recommended`||
30
30
|[`server.address`](/docs/attributes-registry/server.md)| string | Name of the database host. [8]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
31
31
32
32
**[1]`db.operation.name`:** In **CouchDB**, `db.operation.name` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation.name` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
33
33
34
-
**[2]`db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
35
-
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
34
+
**[2]`db.response.status_code`:** HTTP response codes in the 4xx and 5xx range SHOULD be considered errors.
36
35
37
36
**[3]`db.response.status_code`:** If response was received and the HTTP response code is available.
Copy file name to clipboardExpand all lines: docs/database/elasticsearch.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,8 +82,7 @@ When a query string value is redacted, the query string key SHOULD still be pres
82
82
83
83
**[4]`db.elasticsearch.path_parts`:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names.
84
84
85
-
**[5]`db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
86
-
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
85
+
**[5]`db.response.status_code`:** HTTP response codes in the 4xx and 5xx range SHOULD be considered errors.
87
86
88
87
**[6]`error.type`:** 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.
89
88
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.
Copy file name to clipboardExpand all lines: docs/database/hbase.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The Semantic Conventions for [HBase](https://hbase.apache.org/) extend and overr
24
24
|[`db.collection.name`](/docs/attributes-registry/db.md)| string | The HBase table name. [1]|`mytable`; `ns:table`|`Conditionally Required` If applicable. ||
25
25
|[`db.namespace`](/docs/attributes-registry/db.md)| string | The HBase namespace. [2]|`mynamespace`|`Conditionally Required` If applicable. ||
26
26
|[`db.operation.name`](/docs/attributes-registry/db.md)| string | The name of the operation or command being executed. [3]|`findAndModify`; `HMSET`; `SELECT`|`Conditionally Required` If readily available. ||
27
-
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string | Protocol-specific response code recorded as string. [4]|`200`; `409`; `14`|`Conditionally Required` If response was received. ||
27
+
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string | Protocol-specific response code recorded as a string. [4]|`200`; `409`; `14`|`Conditionally Required` If response was received. ||
28
28
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [5]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If and only if the operation failed. ||
29
29
|[`server.port`](/docs/attributes-registry/server.md)| int | Server port number. [6]|`80`; `8080`; `443`|`Conditionally Required`[7]||
30
30
|[`db.operation.batch.size`](/docs/attributes-registry/db.md)| int | The number of queries included in a batch operation. [8]|`2`; `3`; `4`|`Recommended`||
-[SQLite result codes](https://www.sqlite.org/rescode.html)
68
-
69
-
These systems SHOULD set the `db.response.status_code` to a
70
-
known vendor-specific error code. If only SQLSTATE is available,
71
-
it SHOULD be used.
72
-
73
-
When multiple error codes are available and specificity is unclear,
74
-
instrumentation SHOULD set the `db.response.status_code` to the
75
-
concatenated string of all codes with '/' used as a separator.
76
-
77
-
For example, generic DB instrumentation that detected an error and has
78
-
SQLSTATE `"42000"` and vendor-specific `1071` should set
79
-
`db.response.status_code` to `"42000/1071"`."
45
+
**[2]`db.response.status_code`:** MariaDB uses vendor-specific error codes on all errors and reports [SQLSTATE](https://mariadb.com/kb/en/sqlstate/) in some cases.
46
+
MariaDB error codes are more granular than SQLSTATE, so MariaDB instrumentations SHOULD set the `db.response.status_code` to this known error code.
47
+
When SQLSTATE is available, SQLSTATE of "Class 02" or higher SHOULD be considered errors. When SQLSTATE is not available, all MariaDB error codes SHOULD be considered errors.
80
48
81
49
**[3]`error.type`:** 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.
82
50
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.
0 commit comments