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
Copy file name to clipboardExpand all lines: docs/database/mariadb.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,9 @@ Instrumentation SHOULD document if `db.namespace` reflects the database provided
42
42
43
43
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
44
44
45
-
**[2]`db.response.status_code`:** When [SQLSTATE](https://mariadb.com/kb/en/sqlstate/) is available, SQLSTATE of "Class 02" or higher SHOULD be considered errors.). When SQLSTATE is not available, all Maria DB error codes SHOULD be considered errors.
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.
46
48
47
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.
48
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.
|[`db.namespace`](/docs/attributes-registry/db.md)| string | The database associated with the connection. [1]|`products`; `customers`|`Conditionally Required` If available without an additional network call. ||
25
-
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string |[MySQL error number](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html). [2]|`1005`; `MY-010016`|`Conditionally Required` If response has ended with warning or an error. ||
25
+
|[`db.response.status_code`](/docs/attributes-registry/db.md)| string |[MySQL error number](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) recorded as a string. [2]|`1005`; `MY-010016`|`Conditionally Required` If response has ended with warning or an error. ||
26
26
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [3]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` If and only if the operation failed. ||
27
27
|[`server.port`](/docs/attributes-registry/server.md)| int | Server port number. [4]|`80`; `8080`; `443`|`Conditionally Required`[5]||
28
28
|[`db.operation.batch.size`](/docs/attributes-registry/db.md)| int | The number of queries included in a batch operation. [6]|`2`; `3`; `4`|`Recommended`||
@@ -42,7 +42,7 @@ Instrumentation SHOULD document if `db.namespace` reflects the database provided
42
42
43
43
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
44
44
45
-
**[2]`db.response.status_code`:** All MySQL error codes SHOULD be considered errors.
45
+
**[2]`db.response.status_code`:**MySQL error codes are vendor specific error codes and don't follow [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) conventions. All MySQL error codes SHOULD be considered errors.
46
46
47
47
**[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.
48
48
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/postgresql.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
@@ -49,7 +49,7 @@ Instrumentation SHOULD document if `db.namespace` reflects the user provided whe
49
49
50
50
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
51
51
52
-
**[2]`db.response.status_code`:** Response codes of "Class 02" or higher SHOULD be considered errors.
52
+
**[2]`db.response.status_code`:**PostgreSQL follows SQL standard conventions for [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE). Response codes of "Class 02" or higher SHOULD be considered errors.
53
53
54
54
**[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.
55
55
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