diff --git a/.chloggen/joaquin-diaz_feat_add-user-action-event.yaml b/.chloggen/joaquin-diaz_feat_add-user-action-event.yaml new file mode 100644 index 0000000000..31021e3449 --- /dev/null +++ b/.chloggen/joaquin-diaz_feat_add-user-action-event.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: browser + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add `event.browser.user_action` to capture user action events in the browser + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [2992] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/browser/browser-events.md b/docs/browser/browser-events.md index c25a76fd3d..5de2e93f57 100644 --- a/docs/browser/browser-events.md +++ b/docs/browser/browser-events.md @@ -51,4 +51,49 @@ semantic convention tooling supports complex attributes +## Event: `browser.user_action.click` + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +The event name MUST be `browser.user_action.click`. + +This event describes a user click action in the browser. + +**Attributes:** + +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +|---|---|---|---|---|---| +| [`browser.css_selector`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Target element CSS Selector [1] | `#main > div:nth-child(2) > button.submit` | +| [`browser.page.x`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | Click x (horizontal) coordinates (in pixels) relative to the entire document. | `10` | +| [`browser.page.y`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | Click y (vertical) coordinates (in pixels) relative to the entire document. | `10` | +| [`browser.tag_name`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Target element tag name obtained via event.target.tagName. | `BUTTON` | +| [`browser.element.attributes.`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Map of data-otel-* attributes from the target element. [2] | `testBtn`; `submit` | +| [`hw.mouse.button`](/docs/registry/attributes/browser.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | User friendly name of the mouse button pressed. See [MouseEvent.buttons](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#value). | `left` | + +**[1] `browser.css_selector`:** Value SHOULD be a CSS selector that uniquely identifies the target element within the document. Value SHOULD be escaped using CSS.escape() to avoid issues with special characters. + +**[2] `browser.element.attributes.`:** Key is the attribute name after "data-otel-" and value is the attribute value. Example: `