Stabilize exception semantic conventions. (#619)

This commit is contained in:
Josh Suereth 2024-01-04 13:02:35 -05:00 committed by GitHub
parent 9423bd3a0b
commit 3a9d477cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View File

@ -8,10 +8,10 @@
<!-- semconv registry.exception(omit_requirement_level) --> <!-- semconv registry.exception(omit_requirement_level) -->
| Attribute | Type | Description | Examples | | Attribute | Type | Description | Examples |
|---|---|---|---| |---|---|---|---|
| `exception.escaped` | 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] | | | `exception.escaped` | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>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] | |
| `exception.message` | string | The exception message. | `Division by zero`; `Can't convert 'int' object to str implicitly` | | `exception.message` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The exception message. | `Division by zero`; `Can't convert 'int' object to str implicitly` |
| `exception.stacktrace` | 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)` | | `exception.stacktrace` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>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)` |
| `exception.type` | 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` | | `exception.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>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` |
**[1]:** An exception is considered to have escaped (or left) the scope of a span, **[1]:** An exception is considered to have escaped (or left) the scope of a span,
if that span is ended while the exception is still logically "in flight". if that span is ended while the exception is still logically "in flight".

View File

@ -4,7 +4,7 @@ linkTitle: Logs
# Semantic Conventions for Exceptions in Logs # Semantic Conventions for Exceptions in Logs
**Status**: [Experimental][DocumentStatus] **Status**: [Stable][DocumentStatus]
This document defines semantic conventions for recording exceptions on This document defines semantic conventions for recording exceptions on
[logs](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/logs/bridge-api.md#emit-a-logrecord) and [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/logs/event-api.md#emit-event) [logs](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/logs/bridge-api.md#emit-a-logrecord) and [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/logs/event-api.md#emit-event)

View File

@ -4,7 +4,7 @@ linkTitle: Spans
# Semantic Conventions for Exceptions on Spans # Semantic Conventions for Exceptions on Spans
**Status**: [Experimental][DocumentStatus] **Status**: [Stable][DocumentStatus]
This document defines semantic conventions for recording application This document defines semantic conventions for recording application
exceptions associated with spans. exceptions associated with spans.

View File

@ -8,6 +8,7 @@ groups:
attributes: attributes:
- id: type - id: type
type: string type: string
stability: stable
brief: > brief: >
The type of the exception (its fully-qualified class name, if applicable). 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 The dynamic type of the exception should be preferred over the static type
@ -15,10 +16,12 @@ groups:
examples: ["java.net.ConnectException", "OSError"] examples: ["java.net.ConnectException", "OSError"]
- id: message - id: message
type: string type: string
stability: stable
brief: The exception message. brief: The exception message.
examples: ["Division by zero", "Can't convert 'int' object to str implicitly"] examples: ["Division by zero", "Can't convert 'int' object to str implicitly"]
- id: stacktrace - id: stacktrace
type: string type: string
stability: stable
brief: > brief: >
A stacktrace as a string in the natural representation for the language runtime. 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. The representation is to be determined and documented by each language SIG.
@ -28,6 +31,7 @@ groups:
at com.example.GenerateTrace.main(GenerateTrace.java:5)' at com.example.GenerateTrace.main(GenerateTrace.java:5)'
- id: escaped - id: escaped
type: boolean type: boolean
stability: stable
brief: > brief: >
SHOULD be set to true if the exception event is recorded at a point where 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. it is known that the exception is escaping the scope of the span.