본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

RPC 예외 시맨틱 컨벤션

원문 보기 위키 갱신

Status: Development

출처: 문서

본문

이 문서는 RPC 연산에서 예외를 기록하기 위한 시맨틱 컨벤션을 정의해요.

  • RPC 클라이언트 호출 예외
  • RPC 서버 호출 예외

RPC 클라이언트 호출 예외(RPC client call exception)

Status:

이벤트 이름은 반드시 rpc.client.call.exception이어야 해요.

이 이벤트는 네트워크 실패, 타임아웃, 직렬화 오류처럼 호출이 성공적으로 완료되지 못하게 하는 오류 등, 나가는 RPC 호출 중 발생한 예외를 나타내요.

RPC 클라이언트 호출 연산 중 예외가 발생하면 이 이벤트를 기록해야 해요. 이 이벤트를 기록할 때 인스트루멘테이션은 심각도를 WARN(severity number 13)으로 설정해야 해요. 인스트루멘테이션은 해당 RPC 클라이언트 스팬에서 캡처한 속성으로 예외 이벤트를 채우는 구성 옵션을 제공할 수 있어요.

Attributes: | | Key | Stability | Requirement Level | Value Type | Description | Example Values

| exception.message | | Conditionally Required [1] | string | The exception message. [2] | Division by zero; Can't convert 'int' object to str implicitly

| exception.type | | 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 | | 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:

경고

이 속성은 민감한 정보를 포함할 수 있어요.

[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 실패 분류에 도움이 되지 않는 경우 인스트루멘테이션은 내부 예외의 타입을 사용할 수 있어요. 예를 들어 Go에서 fmt.Errorf로 만든 오류가 래퍼 타입이 실패 분류에 도움이 되지 않을 때 %w로 언랩될 수 있어요. 실패 분류에 도움이 되지 않을 때요.

RPC 서버 호출 예외(RPC server call exception)

이벤트 이름은 반드시 rpc.server.call.exception이어야 해요.

이 이벤트는 애플리케이션 오류, 내부 실패처럼 서버가 호출을 성공적으로 처리하지 못하게 하는 예외 등, 들어오는 RPC 호출 처리 중 발생한 예외를 나타내요.

RPC 서버 호출 처리 중 예외가 발생하면 이 이벤트를 기록해야 해요. 이 이벤트를 기록할 때 인스트루멘테이션은 심각도를 ERROR(severity number 17)로 설정해야 해요. 인스트루멘테이션은 해당 RPC 서버 스팬에서 캡처한 속성으로 예외 이벤트를 채우는 구성 옵션을 제공할 수 있어요.

Attributes: | | Key | Stability | Requirement Level | Value Type | Description | Example Values

| exception.message | | Conditionally Required [1] | string | The exception message. [2] | Division by zero; Can't convert 'int' object to str implicitly

| exception.type | | 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 | | 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:

경고

이 속성은 민감한 정보를 포함할 수 있어요.

[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 실패 분류에 도움이 되지 않는 경우 인스트루멘테이션은 내부 예외의 타입을 사용할 수 있어요. 예를 들어 Go에서 fmt.Errorf로 만든 오류가 래퍼 타입이 실패 분류에 도움이 되지 않을 때 %w로 언랩될 수 있어요. 실패 분류에 도움이 되지 않을 때요.