Skip to content

Commit 4c7fcfb

Browse files
authored
telemetry(amazonq): metrics for code symbols, chat history, export #1023
## Problem - There is no telemetry for # and length of `@Code` added to messages by users - There is no telemetry to measure metrics for chat history and export features: - Number of tabs automatically restored from history - Number of users exporting chat transcripts, with which format (markdown vs html) - Number of users who are opening chat history list (will use existing ui_click metric, no changes needed in this PR) - Number of users who are searching, exporting, deleting, and opening conversations from history - How long it takes to complete history searches - History file sizes, time to load history files into memory ## Solution Add the following metrics: - amazonq_exportTab - amazonq_loadHistory - amazonq_performChatHistoryAction To measure code symbol use, add the following types to amazonq_addMessage metric: - cwsprChatCodeContextCount - cwsprChatCodeContextLength - cwsprChatCodeContextTruncatedLength
1 parent 8e55b60 commit 4c7fcfb

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

telemetry/definitions/commonDefinitions.json

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
"type": "double",
5656
"description": "The time it takes to generate code generation response"
5757
},
58+
{
59+
"name": "amazonqHistoryFileSize",
60+
"type": "int",
61+
"description": "The size of a chat history file (in bytes)"
62+
},
5863
{
5964
"name": "amazonqNumberOfFilesAccepted",
6065
"type": "double",
@@ -75,6 +80,16 @@
7580
"type": "double",
7681
"description": "Captures the size of the source code"
7782
},
83+
{
84+
"name": "amazonqTimeToLoadHistory",
85+
"type": "int",
86+
"description": "The time (in milliseconds) it takes to load chat history from filesystem"
87+
},
88+
{
89+
"name": "amazonqTimeToSearchHistory",
90+
"type": "int",
91+
"description": "The time (in milliseconds) it takes to search through all messages in chat history for a user-provided search string"
92+
},
7893
{
7994
"name": "amazonqUploadIntent",
8095
"type": "string",
@@ -1009,6 +1024,21 @@
10091024
"type": "int",
10101025
"description": "Index of the code block inside a message in the conversation."
10111026
},
1027+
{
1028+
"name": "cwsprChatCodeContextCount",
1029+
"type": "int",
1030+
"description": "Number of code symbols added to context"
1031+
},
1032+
{
1033+
"name": "cwsprChatCodeContextLength",
1034+
"type": "int",
1035+
"description": "Total length of code symbols added to context"
1036+
},
1037+
{
1038+
"name": "cwsprChatCodeContextTruncatedLength",
1039+
"type": "int",
1040+
"description": "Truncated length of code symbols added to context"
1041+
},
10121042
{
10131043
"name": "cwsprChatConversationId",
10141044
"type": "string",
@@ -1837,6 +1867,11 @@
18371867
"type": "string",
18381868
"description": "The old version of something. Useful when updating dependent resources."
18391869
},
1870+
{
1871+
"name": "openTabCount",
1872+
"type": "int",
1873+
"description": "The number of tabs automatically opened from history"
1874+
},
18401875
{
18411876
"name": "parentId",
18421877
"type": "string",
@@ -2247,6 +2282,18 @@
22472282
"type": "cwsprChatActiveEditorTotalCharacters",
22482283
"required": false
22492284
},
2285+
{
2286+
"type": "cwsprChatCodeContextCount",
2287+
"required": false
2288+
},
2289+
{
2290+
"type": "cwsprChatCodeContextLength",
2291+
"required": false
2292+
},
2293+
{
2294+
"type": "cwsprChatCodeContextTruncatedLength",
2295+
"required": false
2296+
},
22502297
{
22512298
"type": "cwsprChatConversationId"
22522299
},
@@ -2602,6 +2649,20 @@
26022649
}
26032650
]
26042651
},
2652+
{
2653+
"name": "amazonq_exportTab",
2654+
"description": "When a user exports the current Amazon Q chat tab",
2655+
"metadata": [
2656+
{
2657+
"type": "filenameExt",
2658+
"required": true
2659+
},
2660+
{
2661+
"type": "languageServerVersion",
2662+
"required": false
2663+
}
2664+
]
2665+
},
26052666
{
26062667
"name": "amazonq_feedback",
26072668
"description": "When a user gives feedback using vote or comment or rating in the conversation",
@@ -2788,6 +2849,28 @@
27882849
}
27892850
]
27902851
},
2852+
{
2853+
"name": "amazonq_loadHistory",
2854+
"description": "When a history file is loaded from the filesystem and open tabs are restored",
2855+
"metadata": [
2856+
{
2857+
"type": "amazonqHistoryFileSize",
2858+
"required": true
2859+
},
2860+
{
2861+
"type": "amazonqTimeToLoadHistory",
2862+
"required": true
2863+
},
2864+
{
2865+
"type": "languageServerVersion",
2866+
"required": false
2867+
},
2868+
{
2869+
"type": "openTabCount",
2870+
"required": true
2871+
}
2872+
]
2873+
},
27912874
{
27922875
"name": "amazonq_messageResponseError",
27932876
"description": "When an error has occured in response to a prompt",
@@ -2863,6 +2946,32 @@
28632946
}
28642947
]
28652948
},
2949+
{
2950+
"name": "amazonq_performChatHistoryAction",
2951+
"description": "When a user searches, exports, opens, or deletes a conversation from history",
2952+
"metadata": [
2953+
{
2954+
"type": "action",
2955+
"required": true
2956+
},
2957+
{
2958+
"type": "amazonqHistoryFileSize",
2959+
"required": false
2960+
},
2961+
{
2962+
"type": "amazonqTimeToSearchHistory",
2963+
"required": false
2964+
},
2965+
{
2966+
"type": "filenameExt",
2967+
"required": false
2968+
},
2969+
{
2970+
"type": "languageServerVersion",
2971+
"required": false
2972+
}
2973+
]
2974+
},
28662975
{
28672976
"name": "amazonq_startConversationInvoke",
28682977
"description": "Captures startConversation invocation process",

0 commit comments

Comments
 (0)