From 39243d9b78ac6e0194ad5086b664a9991fa83de4 Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Tue, 25 Feb 2025 17:08:16 -0800 Subject: [PATCH 1/5] add browser user action events --- model/browser/events.yaml | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 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..aed8eec955 --- /dev/null +++ b/model/browser/events.yaml @@ -0,0 +1,83 @@ +groups: + - id: event.browser.user_action + stability: development + type: event + name: browser.user_action + brief: > + This event describes actions performed by the user such as click, scroll, zoom, resize, etc. + body: + id: browser.user_action + requirement_level: required + stability: development + type: map + fields: + - id: element + type: string + stability: development + brief: Target element tag name and it is obtained via event.target.tagName. + requirement_level: recommended + examples: ["button"] + - id: element_xpath + type: string + stability: development + brief: Target element xpath + requirement_level: recommended + examples: ["//*[@id='testBtn']"] + - id: user_action_type + type: + members: + - id: clickleft + value: "cl" + stability: development + brief: An element is left clicked by a user. + - id: clickright + value: "cr" + stability: development + brief: An element is right clicked by a user. + - id: clickmiddle + value: "cm" + stability: development + brief: An element is middle clicked by a user. + - id: scroll + value: "s" + stability: development + brief: An element is scrolled by a user. + - id: zoom + value: "z" + stability: development + brief: An element is zoomed by a user. + - id: resize + value: "r" + stability: development + brief: An element is resized by a user. + - id: keyboardenter + value: "ke" + stability: development + brief: An element is entered via keyboard by a user. + - id: keyboardspace + value: "ks" + stability: development + brief: A space is entered via keyboard by a user. + - id: other + value: "o" + stability: development + brief: User actions that are not listed above. + stability: development + brief: > + Type of interaction. + See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. + requirement_level: required + examples: ["cl"] + - id: click_coordinates + type: string + stability: development + brief: Click coordinates captured as a string in the format {x}X{y}. + requirement_level: recommended + examples: ["345X23"] + - id: tags + type: string + stability: development + brief: Grab data from data-otel-* attributes in tree. + requirement_level: recommended + examples: ["id"] + \ No newline at end of file From 4971c2d164701a7c530da6b515c6b2bbcb716e8f Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 14:43:42 -0800 Subject: [PATCH 2/5] update --- docs/browser/events.md | 56 ++++++++++++++++++++++++ model/browser/events.yaml | 90 ++++++++++++++++++++------------------- 2 files changed, 102 insertions(+), 44 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..65a3d0359d --- /dev/null +++ b/docs/browser/events.md @@ -0,0 +1,56 @@ + + +# Semantic conventions for browser events + +**Status**: [Development][DocumentStatus] + +This document defines semantic conventions for browser (web) instrumentations +that emit events. + +## UserAction Event + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +The event name MUST be `browser.user_action`. + +This event describes actions performed by the user such as click, scroll, zoom, resize, etc. + +**Body fields:** + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| `click_coordinates` | string | Click coordinates captured as a string in the format {x}X{y}. | `345X23` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `element` | string | Target element tag name and it is obtained via event.target.tagName. | `button` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `element_xpath` | string | Target element xpath | `//*[@id='testBtn']` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `tags` | string | Grab data from data-otel-* attributes in tree. | `id` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| `user_action_type` | enum | Type of interaction. See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. | `cl` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | + +`user_action_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `cl` | An element is left clicked by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `cm` | An element is middle clicked by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `cr` | An element is right clicked by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `ke` | An element is entered via keyboard by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `ks` | A space is entered via keyboard by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `o` | User actions that are not listed above. | ![Development](https://img.shields.io/badge/-development-blue) | +| `r` | An element is resized by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `s` | An element is scrolled by a user. | ![Development](https://img.shields.io/badge/-development-blue) | +| `z` | An element is zoomed by a user. | ![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 aed8eec955..f708e19cae 100644 --- a/model/browser/events.yaml +++ b/model/browser/events.yaml @@ -11,7 +11,7 @@ groups: stability: development type: map fields: - - id: element + - id: element type: string stability: development brief: Target element tag name and it is obtained via event.target.tagName. @@ -20,64 +20,66 @@ groups: - id: element_xpath type: string stability: development - brief: Target element xpath + brief: Target element xpath requirement_level: recommended examples: ["//*[@id='testBtn']"] - - id: user_action_type - type: - members: - - id: clickleft - value: "cl" - stability: development - brief: An element is left clicked by a user. - - id: clickright - value: "cr" - stability: development - brief: An element is right clicked by a user. - - id: clickmiddle - value: "cm" - stability: development - brief: An element is middle clicked by a user. - - id: scroll - value: "s" - stability: development - brief: An element is scrolled by a user. - - id: zoom - value: "z" - stability: development - brief: An element is zoomed by a user. - - id: resize - value: "r" - stability: development - brief: An element is resized by a user. - - id: keyboardenter - value: "ke" - stability: development - brief: An element is entered via keyboard by a user. - - id: keyboardspace - value: "ks" - stability: development - brief: A space is entered via keyboard by a user. - - id: other - value: "o" - stability: development - brief: User actions that are not listed above. + - id: user_action_type + type: enum + members: + - id: clickleft + value: "cl" + stability: development + brief: An element is left clicked by a user. + - id: clickright + value: "cr" + stability: development + brief: An element is right clicked by a user. + - id: clickmiddle + value: "cm" + stability: development + brief: An element is middle clicked by a user. + - id: scroll + value: "s" + stability: development + brief: An element is scrolled by a user. + - id: zoom + value: "z" + stability: development + brief: An element is zoomed by a user. + - id: resize + value: "r" + stability: development + brief: An element is resized by a user. + - id: keyboardenter + value: "ke" + stability: development + brief: An element is entered via keyboard by a user. + - id: keyboardspace + value: "ks" + stability: development + brief: A space is entered via keyboard by a user. + - id: other + value: "o" + stability: development + brief: User actions that are not listed above. stability: development brief: > Type of interaction. - See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. + See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) + for potential values we could add support for. requirement_level: required examples: ["cl"] - - id: click_coordinates + - id: click_coordinates type: string stability: development brief: Click coordinates captured as a string in the format {x}X{y}. requirement_level: recommended examples: ["345X23"] - - id: tags + - id: tags type: string stability: development brief: Grab data from data-otel-* attributes in tree. requirement_level: recommended examples: ["id"] + \ No newline at end of file From 750650f9ed6f6cddd9ecd938979baca50fefc3fc Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 14:48:16 -0800 Subject: [PATCH 3/5] update --- model/browser/events.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/model/browser/events.yaml b/model/browser/events.yaml index f708e19cae..423ad1f99d 100644 --- a/model/browser/events.yaml +++ b/model/browser/events.yaml @@ -17,7 +17,7 @@ groups: brief: Target element tag name and it is obtained via event.target.tagName. requirement_level: recommended examples: ["button"] - - id: element_xpath + - id: element_xpath type: string stability: development brief: Target element xpath @@ -64,7 +64,7 @@ groups: brief: User actions that are not listed above. stability: development brief: > - Type of interaction. + Type of interaction. See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. requirement_level: required @@ -78,8 +78,6 @@ groups: - id: tags type: string stability: development - brief: Grab data from data-otel-* attributes in tree. + brief: Grab data from data-otel-* attributes in tree. requirement_level: recommended examples: ["id"] - - \ No newline at end of file From 2de255973cfabc64e6f56762427de06cdf52f9b8 Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 14:56:14 -0800 Subject: [PATCH 4/5] update --- model/browser/events.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model/browser/events.yaml b/model/browser/events.yaml index 423ad1f99d..846fc7757f 100644 --- a/model/browser/events.yaml +++ b/model/browser/events.yaml @@ -65,8 +65,7 @@ groups: stability: development brief: > Type of interaction. - See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) - for potential values we could add support for. + See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. requirement_level: required examples: ["cl"] - id: click_coordinates From 1621e7e46bfd5b9d13b46ccfcefdf986d32ef438 Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Wed, 26 Feb 2025 15:02:59 -0800 Subject: [PATCH 5/5] update --- docs/browser/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/browser/events.md b/docs/browser/events.md index 65a3d0359d..31b931fc4b 100644 --- a/docs/browser/events.md +++ b/docs/browser/events.md @@ -32,7 +32,7 @@ This event describes actions performed by the user such as click, scroll, zoom, | `element` | string | Target element tag name and it is obtained via event.target.tagName. | `button` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | `element_xpath` | string | Target element xpath | `//*[@id='testBtn']` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | `tags` | string | Grab data from data-otel-* attributes in tree. | `id` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| `user_action_type` | enum | Type of interaction. See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. | `cl` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | +| `user_action_type` | enum | Type of interaction. See enum [here](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-clickanalytics-js/src/Enums.ts) for potential values we could add support for. | `cl` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | `user_action_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.