diff --git a/docs/browser/events.md b/docs/browser/events.md new file mode 100644 index 0000000000..02cfe379c6 --- /dev/null +++ b/docs/browser/events.md @@ -0,0 +1,41 @@ + + +# Semantic conventions for browser events + +**Status**: [Development][DocumentStatus] + +This document defines semantic conventions for browser (web) instrumentations +that emit events. + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +The event name MUST be `browser.exception`. + +This event describes an error or exception that occurs in a browser application. + +**Body fields:** + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| `column_number` | int | Column number where the error occurred. | `5` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `file_name` | string | Name of the file that generated the error. | `foo.js` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `line_number` | int | Line number where the error occurred. | `3` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `message` | string | The exception message. | `Can't convert 'int' object to str implicitly` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `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 at com.example.GenerateTrace.methodB(GenerateTrace.java:13)` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `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. | `TypeError`; `java.net.ConnectException`; `OSError` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/model/browser/events.yaml b/model/browser/events.yaml new file mode 100644 index 0000000000..07c49760b4 --- /dev/null +++ b/model/browser/events.yaml @@ -0,0 +1,54 @@ +groups: + - id: event.browser.exception + stability: development + type: event + name: browser.exception + brief: > + This event describes an error or exception that occurs in a browser application. + body: + id: browser.exception + requirement_level: required + stability: development + type: map + fields: + - id: file_name + type: string + stability: development + brief: Name of the file that generated the error. + requirement_level: recommended + examples: ["foo.js"] + - id: line_number + type: int + stability: development + brief: Line number where the error occurred. + requirement_level: recommended + examples: [3] + - id: column_number + type: int + stability: development + brief: Column number where the error occurred. + requirement_level: recommended + examples: [5] + - id: message + type: string + stability: development + brief: The exception message. + requirement_level: recommended + examples: ["Can't convert 'int' object to str implicitly"] + - id: stacktrace + type: string + stability: development + brief: > + 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. + requirement_level: recommended + examples: ["Exception in thread main java.lang.RuntimeException: + Test exception at com.example.GenerateTrace.methodB(GenerateTrace.java:13)"] + - id: type + type: string + stability: development + brief: > + 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. + requirement_level: recommended + examples: ["TypeError", "java.net.ConnectException", "OSError"]