Semantic conventions for RPC exceptions

Status: Development

This document defines semantic conventions for recording exceptions on RPC operations.

RPC client call exception

Status: Development

The event name MUST be rpc.client.call.exception.

This event represents an exception that occurred during an outgoing RPC call, such as network failures, timeouts, serialization errors, or other errors that prevent the call from completing successfully.

This event SHOULD be recorded when an exception occurs during RPC client call 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 RPC client span.

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
exception.messageStableConditionally Required [1]stringThe exception message. [2]Division by zero; Can't convert 'int' object to str implicitly
exception.typeStableConditionally Required [3]stringThe 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
exception.stacktraceStableRecommendedstringA 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:

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

RPC server call exception

Status: Development

The event name MUST be rpc.server.call.exception.

This event represents an exception that occurred during incoming RPC call processing, such as application errors, internal failures, or other exceptions that prevent the server from successfully handling the call.

This event SHOULD be recorded when an exception occurs during RPC server call processing. Instrumentations SHOULD set the severity to ERROR (severity number 17) when recording this event. Instrumentations MAY provide a configuration option to populate exception events with the attributes captured on the corresponding RPC server span.

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
exception.messageStableConditionally Required [1]stringThe exception message. [2]Division by zero; Can't convert 'int' object to str implicitly
exception.typeStableConditionally Required [3]stringThe 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
exception.stacktraceStableRecommendedstringA 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:

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