In order to better manage the telemetry info, we should form a standard about the telemetry data points.
Below is a draft.
Telemetry Type:
Telemetry entries:
- UsageData
We divide the extension features into operation unit, and the usage data is based on operation.
Below is the code structure to wrap the telemetry workflow:
try {
telemetry.start(opId, opName);
...execute the operation
...
} catch (ex) {
telemetry.error(ex);
} finally {
telemetry.end(opId, opName, ex, duration);
}
Below is the telemetry schema:
{
"name": "vscjava.vscode-java-debug/opStart",
"customDimensions": {
"opId": "<UUID>",
"opName": "<opName>",
}
}
{
"name": "vscjava.vscode-java-debug/opEnd",
"customDimensions": {
"opId": "<UUID>",
"opName": "<opName>",
"errorMessage": "<message>", // null if it's a success
"errorCode": 1, // 0 indicates it's a success
"stackTrace": <>
},
"customMeasurements": {
"duration": 23 // operationFinishTimestamp - operationStartTimestamp, in milliseconds
}
}
The typical operation units:
(1) we can take the activate extension as an operation, then the opName is activate.
(2) we can take vscode command from vscode.commands.registerCommand as an operation, then the opName is
{
"name": "vscjava.vscode-java-debug/error",
"customDimensions": {
"errorMessage": "<message>", // null if it's a success
"errorCode": 1, // 0 indicates it's a success
"stackTrace": <>
}
}
- Info
per extension, log the corresponding diagnostics info.
In order to better manage the telemetry info, we should form a standard about the telemetry data points.
Below is a draft.
Telemetry Type:
Telemetry entries:
We divide the extension features into operation unit, and the usage data is based on operation.
Below is the code structure to wrap the telemetry workflow:
Below is the telemetry schema:
The typical operation units:
(1) we can take the activate extension as an operation, then the opName is
activate.(2) we can take vscode command from vscode.commands.registerCommand as an operation, then the opName is
per extension, log the corresponding diagnostics info.