-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Browser Exception Event #1942
base: main
Are you sure you want to change the base?
Changes from all commits
96029a3
89a5817
dd35ac7
9279924
8343d18
174cd01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!--- Hugo front matter used to generate the website version of this page: | ||
linkTitle: Events | ||
---> | ||
|
||
# Semantic conventions for browser events | ||
|
||
**Status**: [Development][DocumentStatus] | ||
|
||
This document defines semantic conventions for browser (web) instrumentations | ||
that emit events. | ||
|
||
<!-- semconv event.browser.exception --> | ||
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. --> | ||
<!-- see templates/registry/markdown/snippet.md.j2 --> | ||
<!-- prettier-ignore-start --> | ||
<!-- markdownlint-capture --> | ||
<!-- markdownlint-disable --> | ||
|
||
**Status:**  | ||
|
||
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` |  | | ||
| `file_name` | string | Name of the file that generated the error. | `foo.js` | `Recommended` |  | | ||
| `line_number` | int | Line number where the error occurred. | `3` | `Recommended` |  | | ||
| `message` | string | The exception message. | `Can't convert 'int' object to str implicitly` | `Recommended` |  | | ||
| `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` |  | | ||
| `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` |  | | ||
|
||
<!-- markdownlint-restore --> | ||
<!-- prettier-ignore-end --> | ||
<!-- END AUTOGENERATED TEXT --> | ||
<!-- endsemconv --> | ||
|
||
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets also "add" a top-level attribute |
||
body: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to see a comment here to clarify that this is temporary or that this will actually be an attribute. That way readers do not expect to find content in the actual 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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to reformat the examples to make the generated table look nicer |
||
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"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to comments I left on #1941, I think other client instrumentation would benefit from also having these relaxed to be non-browser. Alternatives:
rum.exception
,client.exception
,app.exception
,runtime.exception
.....There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think if we can defined a "standard" exception event would be a better approach (things have evolved quite a bit since we originally defined this).
Even if this also means that as part of a "standard" exception event it would define and use the top-level
exception.*
attributes, but this may also mean that we should define an exception "source" to make life a little easier when attempting to directly compare values-- community thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karlie-777 can you please review open-telemetry/opentelemetry-js-contrib#2751 which is an initial implementation of a browser "event" which is using the existing top-level 3 attributes.