Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 3.47 KB

File metadata and controls

62 lines (41 loc) · 3.47 KB

Semantic conventions for database exceptions

Status: Development

This document defines semantic conventions for recording exceptions on database client operations.

Database client operation exception

Status: Development

The event name MUST be db.client.operation.exception.

This event represents an exception that occurred during a database client operation, such as connection failures, query errors, timeouts, or other errors that prevent the operation from completing successfully.

This event SHOULD be recorded when an exception occurs during database client operations. Instrumentations SHOULD set the severity to WARN (severity number 13) when recording this event. Instrumentations MAY provide a configuration option to populate exception events with the attributes captured on the corresponding database client span.

Attributes:

Key Stability Requirement Level Value Type Description Example Values
exception.message Stable Conditionally Required [1] string The exception message. [2] Division by zero; Can't convert 'int' object to str implicitly
exception.type Stable Conditionally Required [3] 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. [4] java.net.ConnectException; OSError
exception.stacktrace Stable Recommended 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)

[1] exception.message: Required if exception.type is not set, recommended otherwise.

[2] exception.message:

Warning

This attribute may contain sensitive information.

[3] exception.type: Required if exception.message is not set, recommended otherwise.

[4] exception.type: If the recorded exception type is a wrapper that is not meaningful for failure classification, instrumentation MAY use the type of the inner exception instead. For example, in Go, errors created with fmt.Errorf using %w MAY be unwrapped when the wrapper type does not help classify the failure.