Skip to content

Commit 3d4ece0

Browse files
authored
Merge branch 'aws:main' into main
2 parents 6c33f26 + 84b1742 commit 3d4ece0

File tree

3 files changed

+181
-56
lines changed

3 files changed

+181
-56
lines changed

telemetry/definitions/commonDefinitions.json

Lines changed: 166 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
"description": "The intent of the upload",
8282
"allowedValues": [
8383
"TRANSFORMATION",
84-
"TASK_ASSIST_PLANNING"
84+
"TASK_ASSIST_PLANNING",
85+
"AUTOMATIC_FILE_SECURITY_SCAN",
86+
"FULL_PROJECT_SECURITY_SCAN"
8587
]
8688
},
8789
{
@@ -990,6 +992,16 @@
990992
"type": "string",
991993
"description": "Uniquely identifies a message with which the user interacts."
992994
},
995+
{
996+
"name": "cwsprChatFileContextCount",
997+
"type": "int",
998+
"description": "Number of files manually added to context"
999+
},
1000+
{
1001+
"name": "cwsprChatFolderContextCount",
1002+
"type": "int",
1003+
"description": "Number of folders manually added to context"
1004+
},
9931005
{
9941006
"name": "cwsprChatHasProjectContext",
9951007
"type": "boolean",
@@ -1033,6 +1045,16 @@
10331045
"type": "string",
10341046
"description": "Programming language associated with the message"
10351047
},
1048+
{
1049+
"name": "cwsprChatPromptContextCount",
1050+
"type": "int",
1051+
"description": "Number of saved prompts manually added to context"
1052+
},
1053+
{
1054+
"name": "cwsprChatRuleContextCount",
1055+
"type": "int",
1056+
"description": "Number of workspace rules automatically added to context"
1057+
},
10361058
{
10371059
"name": "cwsprChatTotalCodeBlocks",
10381060
"type": "int",
@@ -1357,6 +1379,11 @@
13571379
"type": "string",
13581380
"description": "HTTP status code for the request (if any) associated with a metric."
13591381
},
1382+
{
1383+
"name": "iac",
1384+
"type": "string",
1385+
"description": "The IaC being used"
1386+
},
13601387
{
13611388
"name": "iamResourceType",
13621389
"type": "string",
@@ -1514,13 +1541,25 @@
15141541
{
15151542
"name": "languageServerLocation",
15161543
"type": "string",
1517-
"allowedValues": ["cache", "remote", "fallback", "override"],
1544+
"allowedValues": [
1545+
"cache",
1546+
"remote",
1547+
"fallback",
1548+
"override"
1549+
],
15181550
"description": "The location of the language server"
15191551
},
15201552
{
15211553
"name": "languageServerSetupStage",
15221554
"type": "string",
1523-
"allowedValues": ["getManifest", "getServer", "validate", "launch", "handshake", "all"],
1555+
"allowedValues": [
1556+
"getManifest",
1557+
"getServer",
1558+
"validate",
1559+
"launch",
1560+
"handshake",
1561+
"all"
1562+
],
15241563
"description": "The stage of the LSP setup process"
15251564
},
15261565
{
@@ -1541,7 +1580,11 @@
15411580
{
15421581
"name": "manifestLocation",
15431582
"type": "string",
1544-
"allowedValues": ["cache", "remote", "override"],
1583+
"allowedValues": [
1584+
"cache",
1585+
"remote",
1586+
"override"
1587+
],
15451588
"description": "The location of the manifest"
15461589
},
15471590
{
@@ -2204,6 +2247,14 @@
22042247
"type": "cwsprChatConversationId",
22052248
"required": true
22062249
},
2250+
{
2251+
"type": "cwsprChatFileContextCount",
2252+
"required": false
2253+
},
2254+
{
2255+
"type": "cwsprChatFolderContextCount",
2256+
"required": false
2257+
},
22072258
{
22082259
"type": "cwsprChatHasProjectContext",
22092260
"required": false
@@ -2228,6 +2279,14 @@
22282279
"type": "cwsprChatProgrammingLanguage",
22292280
"required": false
22302281
},
2282+
{
2283+
"type": "cwsprChatPromptContextCount",
2284+
"required": false
2285+
},
2286+
{
2287+
"type": "cwsprChatRuleContextCount",
2288+
"required": false
2289+
},
22312290
{
22322291
"type": "cwsprChatTotalCodeBlocks",
22332292
"required": false
@@ -4645,6 +4704,34 @@
46454704
}
46464705
]
46474706
},
4707+
{
4708+
"name": "codewhisperer_codeScanIssueDetected",
4709+
"description": "Called when a code scan issue is returned from the service",
4710+
"metadata": [
4711+
{
4712+
"type": "autoDetected",
4713+
"required": false
4714+
},
4715+
{
4716+
"type": "codewhispererCodeScanJobId",
4717+
"required": false
4718+
},
4719+
{
4720+
"type": "detectorId"
4721+
},
4722+
{
4723+
"type": "findingId"
4724+
},
4725+
{
4726+
"type": "includesFix",
4727+
"required": false
4728+
},
4729+
{
4730+
"type": "ruleId",
4731+
"required": false
4732+
}
4733+
]
4734+
},
46484735
{
46494736
"name": "codewhisperer_codeScanIssueGenerateFix",
46504737
"description": "Generated fix for a code scan issue. variant=refresh means the user chose to generate a fix again after one already exists.",
@@ -4688,6 +4775,10 @@
46884775
"name": "codewhisperer_codeScanIssueHover",
46894776
"description": "Called when a code scan issue is hovered over",
46904777
"metadata": [
4778+
{
4779+
"type": "autoDetected",
4780+
"required": false
4781+
},
46914782
{
46924783
"type": "credentialStartUrl",
46934784
"required": false
@@ -4711,6 +4802,10 @@
47114802
"name": "codewhisperer_codeScanIssueIgnore",
47124803
"description": "User ignored a code scan issue. variant=all means the user ignored all issues of a specific type.",
47134804
"metadata": [
4805+
{
4806+
"type": "autoDetected",
4807+
"required": false
4808+
},
47144809
{
47154810
"type": "component"
47164811
},
@@ -4738,6 +4833,10 @@
47384833
"name": "codewhisperer_codeScanIssueViewDetails",
47394834
"description": "Called when a code scan issue webview is opened",
47404835
"metadata": [
4836+
{
4837+
"type": "autoDetected",
4838+
"required": false
4839+
},
47414840
{
47424841
"type": "credentialStartUrl",
47434842
"required": false
@@ -6154,6 +6253,21 @@
61546253
}
61556254
]
61566255
},
6256+
{
6257+
"name": "lambda_createServerlessLandProject",
6258+
"description": "Called when creating a new Serverless Project",
6259+
"metadata": [
6260+
{
6261+
"type": "iac"
6262+
},
6263+
{
6264+
"type": "runtimeString"
6265+
},
6266+
{
6267+
"type": "templateName"
6268+
}
6269+
]
6270+
},
61576271
{
61586272
"name": "lambda_delete",
61596273
"description": "called when deleting lambdas remotely",
@@ -7079,8 +7193,8 @@
70797193
]
70807194
},
70817195
{
7082-
"name": "toolkit_closeModule",
7083-
"description": "The user closed 'something' (specified by 'module'). Examples: a view, feature, resource, ...",
7196+
"name": "toolkit_didCloseModule",
7197+
"description": "The module has closed/terminated. Use this when the module is done being used.",
70847198
"metadata": [
70857199
{
70867200
"type": "module",
@@ -7089,6 +7203,33 @@
70897203
],
70907204
"passive": true
70917205
},
7206+
{
7207+
"name": "toolkit_didLoadModule",
7208+
"description": "The module has loaded, i.e it has rendered/resolved/finished. You can use this metric by itself, OR after `toolkit_willOpenModule` + `traceId` to close the loop on an asynchronous operation.",
7209+
"metadata": [
7210+
{
7211+
"type": "attempts",
7212+
"required": false
7213+
},
7214+
{
7215+
"type": "duration",
7216+
"required": false
7217+
},
7218+
{
7219+
"type": "module",
7220+
"required": true
7221+
},
7222+
{
7223+
"type": "result",
7224+
"required": true
7225+
},
7226+
{
7227+
"type": "version",
7228+
"required": false
7229+
}
7230+
],
7231+
"passive": true
7232+
},
70927233
{
70937234
"name": "toolkit_featureState",
70947235
"description": "Represents the current enabled state of a feature. Used to track user journey through a feature. Emitted after feature-specific operations of interest in the Toolkit.",
@@ -7154,33 +7295,6 @@
71547295
],
71557296
"passive": true
71567297
},
7157-
{
7158-
"name": "toolkit_initModule",
7159-
"description": "The Toolkit has completed initialization for the specified module.",
7160-
"metadata": [
7161-
{
7162-
"type": "attempts",
7163-
"required": false
7164-
},
7165-
{
7166-
"type": "duration",
7167-
"required": false
7168-
},
7169-
{
7170-
"type": "module",
7171-
"required": true
7172-
},
7173-
{
7174-
"type": "result",
7175-
"required": true
7176-
},
7177-
{
7178-
"type": "version",
7179-
"required": false
7180-
}
7181-
],
7182-
"passive": true
7183-
},
71847298
{
71857299
"name": "toolkit_invokeAction",
71867300
"description": "User invoked an action. `source` is the notification that produced the action",
@@ -7211,25 +7325,6 @@
72117325
}
72127326
]
72137327
},
7214-
{
7215-
"name": "toolkit_openModule",
7216-
"description": "User opened 'something' (specified by 'module'). Examples: a view, feature, resource, ...",
7217-
"metadata": [
7218-
{
7219-
"type": "module",
7220-
"required": true
7221-
},
7222-
{
7223-
"type": "result",
7224-
"required": true
7225-
},
7226-
{
7227-
"type": "source",
7228-
"required": true
7229-
}
7230-
],
7231-
"passive": true
7232-
},
72337328
{
72347329
"name": "toolkit_showAction",
72357330
"description": "Toolkit presented an action. `source` is the notification that produced the action. See also `toolkit_showNotification`.",
@@ -7310,6 +7405,25 @@
73107405
"name": "toolkit_viewLogs",
73117406
"description": "View logs for the toolkit"
73127407
},
7408+
{
7409+
"name": "toolkit_willOpenModule",
7410+
"description": "Indicates a module opening attempt began, not its successful completion. For load confirmation, use `toolkit_didLoadModule` with matching `traceId`. This separation handles asynchronous processes that can't be captured in a single metric. 'Module' refers to components like views, features, resources, etc.",
7411+
"metadata": [
7412+
{
7413+
"type": "module",
7414+
"required": true
7415+
},
7416+
{
7417+
"type": "result",
7418+
"required": true
7419+
},
7420+
{
7421+
"type": "source",
7422+
"required": true
7423+
}
7424+
],
7425+
"passive": true
7426+
},
73137427
{
73147428
"name": "ui_click",
73157429
"description": "User clicked/activated a UI element. This does not necessarily have to be an explicit mouse click. Any user action that has the same behavior as a mouse click can use this event.",

telemetry/telemetryformat.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@ _types_ is an array that holds telemetry metadata types. This is the information
2626

2727
### Metrics
2828

29-
_metrics_ is an array that contains the actual metrics posted to the service. `name` defines the metric name what is
30-
posted to the service, `metadata` contains data from `types` that define characteristics of the telemetry beyond
31-
`createTime` and a `value`. `name` must be in the format`namespace_camelCaseName` (e.g. `s3_uploadObject`). The field is optional.
29+
_metrics_ is an array that contains the actual metrics posted to the service.
30+
- `name` defines the metric name
31+
- it must be in the format `{namespace}_{did|will| }{verb}{Noun}` (eg: `toolkit_willOpenModule`, `toolkit_didLoadModule`, `toolkit_closeModule`)
32+
- This format aligns with legacy names while standardizing conventions for new names going forward, though we might have chosen differently if starting from scratch.
33+
- the part after the namespace must be in camelCase. `namespace_camelCaseName` (e.g. `s3_uploadObject`).
34+
- Common Namespaces:
35+
- `toolkit_` is for general non-feature-specific metrics created by the toolkit. Eg: `toolkit_openModule`
36+
- `ide_` is for IDE specific metrics, not controlled by our extension. Eg: `ide_openEditor`
37+
- NOTE: legacy metrics don't always follow the above rules, but new definitions must follow them.
38+
- `description` explains what the metric means
39+
- put effort to explaining the metrics purpose in detail. This tends to be the source of truth for what the metric actually means and how it should be used.
40+
- if a metric is deprecated, it must be indicated here
41+
- `metadata` contains fields (`types`) that define characteristics of the telemetry beyond `createTime` and a `value`.
42+
- This field is optional, but default fields (`types`) are always present on generated metrics.
3243

3344
```
3445
"metrics": [

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.298
1+
1.0.306

0 commit comments

Comments
 (0)