From 988f4c0e6b1d3ab718e5ab5a3ff9c11c5404cbc9 Mon Sep 17 00:00:00 2001 From: Nikolas Komonen Date: Mon, 26 Aug 2024 12:11:14 -0400 Subject: [PATCH] feat: Add `viewId` common definition type This adds a new type called `viewId` which uniquely identifies a part of the UI in an IDE window. The `viewId` should be a comma delimited string where each item appended is a more specific part of the UI within the previous item. The top level (first item) part of the string should be an identifier for the specific IDE window, as it is possible to have multiple windows of the same IDE opened at the same time. Then if there is a specific view within that specific IDE window you would append its identifier. Example: - I have 2 VS Code windows with IDs: `abc-123` and `xyz-789` - My Amazon Q chat view has an ID `amazonq-chat` - Result `viewId`: `abc-123,amazonq-chat` and `xyz-789,amazonq-chat` Now in my metrics I will be able to differentiate metrics by their viewId since they both share the same clientId by design. Signed-off-by: Nikolas Komonen --- package-lock.json | 6 ++++++ telemetry/definitions/commonDefinitions.json | 5 +++++ telemetry/vscode/src/generate.ts | 1 + 3 files changed, 12 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..53b9117f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "aws-toolkit-common", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/telemetry/definitions/commonDefinitions.json b/telemetry/definitions/commonDefinitions.json index 265fec14..49f27965 100644 --- a/telemetry/definitions/commonDefinitions.json +++ b/telemetry/definitions/commonDefinitions.json @@ -1681,6 +1681,11 @@ "type": "string", "description": "A generic version metadata" }, + { + "name": "viewId", + "type": "string", + "description": "Identifies a unique IDE window or sub-view within that unique IDE window. The value should be a comma delimited string where each item is a more specific view within the parent." + }, { "name": "workflowToken", "type": "string", diff --git a/telemetry/vscode/src/generate.ts b/telemetry/vscode/src/generate.ts index 405c1624..064eab63 100644 --- a/telemetry/vscode/src/generate.ts +++ b/telemetry/vscode/src/generate.ts @@ -136,6 +136,7 @@ const commonMetadata = [ 'requestId', 'requestServiceType', 'result', + 'viewId' ] as const /**