From 96029a372c18925f25a7f959da274d02a07d75de Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Tue, 25 Feb 2025 16:17:02 -0800 Subject: [PATCH 1/3] add browser exception events --- model/browser/events.yaml | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 model/browser/events.yaml diff --git a/model/browser/events.yaml b/model/browser/events.yaml new file mode 100644 index 0000000000..50b8776a25 --- /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. + examples: ["TypeError", "java.net.ConnectException", "OSError"] + \ No newline at end of file From 89a581763207ba4673f54bf812c067110c65b05c Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 15:13:22 -0800 Subject: [PATCH 2/3] update --- docs/browser/events.md | 41 +++++++++++++++++++++++++++++++++++++++ model/browser/events.yaml | 10 +++++----- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 docs/browser/events.md 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 index 50b8776a25..64dc3d177f 100644 --- a/model/browser/events.yaml +++ b/model/browser/events.yaml @@ -14,7 +14,7 @@ groups: - id: file_name type: string stability: development - brief: Name of the file that generated the error. + brief: Name of the file that generated the error. requirement_level: recommended examples: ["foo.js"] - id: line_number @@ -29,10 +29,10 @@ groups: brief: Column number where the error occurred. requirement_level: recommended examples: [5] - - id: message + - id: message type: string stability: development - brief: The exception message. + brief: The exception message. requirement_level: recommended examples: ["Can't convert 'int' object to str implicitly"] - id: stacktrace @@ -44,11 +44,11 @@ groups: requirement_level: recommended examples: ["Exception in thread main java.lang.RuntimeException: Test exception at com.example.GenerateTrace.methodB(GenerateTrace.java:13)"] - - id: type + - 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"] - \ No newline at end of file From 92799244e973069a59802d8717dea7def54282ed Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 15:16:04 -0800 Subject: [PATCH 3/3] update --- model/browser/events.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/browser/events.yaml b/model/browser/events.yaml index 64dc3d177f..07c49760b4 100644 --- a/model/browser/events.yaml +++ b/model/browser/events.yaml @@ -11,7 +11,7 @@ groups: stability: development type: map fields: - - id: file_name + - id: file_name type: string stability: development brief: Name of the file that generated the error. @@ -35,14 +35,14 @@ groups: brief: The exception message. requirement_level: recommended examples: ["Can't convert 'int' object to str implicitly"] - - id: stacktrace + - 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: + examples: ["Exception in thread main java.lang.RuntimeException: Test exception at com.example.GenerateTrace.methodB(GenerateTrace.java:13)"] - id: type type: string